Confirmed. There seems to be something wrong with
MIDI_InsertNote
I'm trying to add a note at pitch 0. It adds "00 00 00" events. Running the script three times finally adds the note. MIDI_InsertNote function returns "1".
If someone wants to test it:
- Open new MIDI item in editor
- Open "Raw MIDI data" window
- Run the script
Code:
function insert_note() local(take, ret)
(
(take = MIDIEditor_GetTake(MIDIEditor_GetActive())) ? (
//bool MIDI_InsertNote(MediaItem_Take* take, bool selected, bool muted, startppqpos, endppqpos, int chan, int pitch, int vel)
ret = MIDI_InsertNote(take, 1, 0, 0.0, 960.0, 0, 0, 96);
ShowConsoleMsg(sprintf(#, "%d", ret));
//UpdateArrange();
);
);
insert_note();
(REAPER v4.731, Win XP32)