Old 10-10-2019, 02:15 PM   #1
pandabot
Human being with feelings
 
pandabot's Avatar
 
Join Date: Oct 2018
Posts: 56
Default reaper.MIDI_Sort() deletes notes it shouldn't

As you can see in the below animation, the right note is deleted by MIDI_Sort.



Code:
reaper.MIDI_InsertNote(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()), false, false, 3840.0, 7680.0, 0, 55, 96, true)
reaper.MIDI_InsertNote(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()), false, false, 0.0, 3840.0, 0, 55, 96, true)
reaper.MIDI_Sort(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()))
pandabot is online now   Reply With Quote
Old 10-14-2019, 09:44 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,474
Default

This is expected due to the ambiguity of MIDI note on vs off. Insert earlier notes first, or don’t disable sorting when adding notes that overlap...
Justin is offline   Reply With Quote
Old 10-14-2019, 10:09 AM   #3
pandabot
Human being with feelings
 
pandabot's Avatar
 
Join Date: Oct 2018
Posts: 56
Default

It also happens when noSort is false

Code:
reaper.MIDI_InsertNote(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()), false, false, 3840.0, 7680.0, 0, 55, 96, false)
reaper.MIDI_InsertNote(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()), false, false, 0.0, 3840.0, 0, 55, 96, false)


or when sorting twice

Code:
reaper.MIDI_InsertNote(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()), false, false, 3840.0, 7680.0, 0, 55, 96, true)
reaper.MIDI_Sort(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()))
reaper.MIDI_InsertNote(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()), false, false, 0.0, 3840.0, 0, 55, 96, true)
reaper.MIDI_Sort(reaper.MIDIEditor_GetTake(reaper.MIDIEditor_GetActive()))

Last edited by pandabot; 10-14-2019 at 10:36 AM.
pandabot is online now   Reply With Quote
Old 10-14-2019, 10:18 AM   #4
pandabot
Human being with feelings
 
pandabot's Avatar
 
Join Date: Oct 2018
Posts: 56
Default

For context it affects my ChordGun tool, for example when replacing a chord in a progression with one that shares notes with the following chord. I can't seem to find a way around it

pandabot is online now   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 09:55 PM.


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