View Single Post
Old 04-11-2015, 01:37 PM   #70
Breeder
Human being with feelings
 
Breeder's Avatar
 
Join Date: Nov 2010
Location: Croatia
Posts: 1,926
Default

You can see possible strings here:
https://github.com/Jeff0S/sws/blob/4...e.cpp#L64-L106

But you can also use REAPER 5 API to change MIDI events position without changing their indexes. (same thing that applies to BR_Env functions applies here...FNG_MIDI stuff is using chunks so may be slower than native functions so choose wisely (in short, use BR_Env and FNG_MIDI only when you can't do it without native API (chunk API not included since doing chunks from ReaScript will be slower than doing them from C++ )

Code:
reaper.MIDI_SetNote(MediaItem_Take take ... boolean noSortInOptional)
So if you pass noSortInOptional as true, indexes won't change. Once done, you just have to call MIDI_Sort()
Code:
reaper.MIDI_Sort(MediaItem_Take take)
Regarding chunks vs separate functions - while I always recommend not using chunks if possible, please take into account that I love to micro optimize prematurely (that's a bad thing, lol) - so don't listen to me, instead profile stuff before optimization. For example, if you use some of FNG/SWS midi actions that change CC lanes or MIDI notes you will notice that you have to have a HUUUUUUUUUUGE number of MIDI events before you actually notice a slowdown inherent in chunks. Not to mention Jeffos' chunk parser which we use throughout the extension for a lot of stuff, and we're yet to hear from someone about how slow it is

Last edited by Breeder; 04-11-2015 at 03:43 PM.
Breeder is offline   Reply With Quote