Background: in REAPER 5.1 we changed the way MIDI pitch is handled on MIDI items.
Here's a script which will insert MIDI reset events (if they don't already exist) at the start of all selected MIDI items, effectively making the projects sound the same on both versions:
- in 4.x and 5.0, MIDI pitch was reset to neutral at the end of each item
- in 5.1+, MIDI pitch is chased to the last MIDI item, and not reset at the end of the item
Here's a script which will insert MIDI reset events (if they don't already exist) at the start of all selected MIDI items, effectively making the projects sound the same on both versions:
Code:
sel = reaper.CountSelectedMediaItems(0)
for itemidx=0,sel-1 do
item = reaper.GetSelectedMediaItem(0,itemidx)
if item ~= nil then
tk = reaper.GetMediaItemTake(item,-1)
if tk ~= nil then
for chan=0,15 do
ok = true
want = true
evt_idx=0
while ok and want do
ok,sel,mute,pos,msg1,msgchan,msg3,msg4 = reaper.MIDI_GetCC(tk,evt_idx)
evt_idx=evt_idx+1
if ok and not mute and msgchan == chan and msg1 == 0xe0 and pos < 1 then
want = false
end
end
if want then
reaper.MIDI_InsertCC(tk,false,false,0,0xe0,chan,0x0,0x40);
end
end
end
end
end