Old 02-11-2020, 11:05 PM   #1
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,266
Default ReaScript InLine MIDI Editor

Just trying to use the inline editors rather than opening and closing the Midi Editor Windows.

reaper.MIDIEditor_GetActive()
only works on the active Midi Editor Window

and I need the take to count, get and set notes
midi_source_take = reaper.MIDIEditor_GetTake(ME)
_, notecnt = reaper.MIDI_CountEvts( midi_source_take )

reaper.MIDI_GetNote( midi_target_take, i )
reaper.MIDI_SetNote( midi_target_take,


__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Old 02-12-2020, 09:47 AM   #2
Ozman
Human being with feelings
 
Join Date: Feb 2015
Posts: 629
Default

Man...
It's heart warming to see that you are working on this.
Ozman is offline   Reply With Quote
Old 02-12-2020, 03:25 PM   #3
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,266
Default

I did post it in the ReaTrak forum https://forum.cockos.com/showthread....73#post2243773

to try it out.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Old 02-12-2020, 03:31 PM   #4
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,960
Default

MIDIEditor functions don't work on inline editors, so you'll have to get the take by using (for example) GetItemFromPoint and BR_IsMidiOpenInInlineEditor.

Once you have the take, the MIDI API functions work fine.
juliansader is offline   Reply With Quote
Old 02-12-2020, 06:11 PM   #5
MusoBob
Human being with feelings
 
MusoBob's Avatar
 
Join Date: Sep 2014
Posts: 1,266
Default

This worked to move the notes with or without opening the inline midi editor.

Code:
source_item = reaper.GetSelectedMediaItem( 0, 0 )
   
source_take = reaper.GetActiveTake( source_item )

_, notecnt = reaper.MIDI_CountEvts( source_take )

    for i = 0, notecnt -1 do
      _, selected, muted, startppqpos, endppqpos, chan, pitch, vel = reaper.MIDI_GetNote( source_take, i )
      
      reaper.MIDI_SetNote( source_take, i , true, muted, startppqpos, endppqpos, chan, pitch-2, vel, true )  
        
    end
I have been using the MIDI Editor Window to use it's available commands but I should be able to create them in other ways once I can count the notes. So this should make things a bit quicker and smoother.
__________________
ReaTrakStudio Chord Track for Reaper forum
www.reatrak.com
MusoBob is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:57 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.