Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Bug Reports

Reply
 
Thread Tools Display Modes
Old 09-16-2016, 08:57 PM   #1
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,764
Default MIDI_Sort extends non-overlapping notes that end in Note-Ons with vel=0 (FIXED)

Overlapping notes are notorious for causing havoc on ReaScripts. More ominously, some bug reports have reported that even non-overlapping notes can become extended when running ReaScripts:

Using MIDI_SetNote with noSort=true to move notes onto same pitch

SetNote Bug on Not Overlapping Notes?

This may have something to do with notes ending in Note-Ons with velocity=0 instead of Note-Offs, as the following GIF demonstrates:




This behavior may also be related to another (fixed) bug in which Note-On note-ends were inadvertently treated as normal note starts instead of Note-Offs:

Weird MIDI velocities problem [FIXED]

Edit Velocity via mousewheel bug (FIXED)


EDIT: I suggest that these ReaScript bugs should be regarded as urgent, since they seriously undermine users' confidence in ReaPack scripts (Reaper for Orchestral work). Not only do they trash a MIDI item's notes, but they can also cause REAPER to hang - as if the MIDI editor is trying to figure out how to arrange the MIDI data, but failing. Even a classic script such as spk77's Velocity/CC Tool is victim to these bugs and is therefore avoided by some users (MIDI CC compress/expand tool, available?).

Last edited by juliansader; 09-19-2016 at 04:39 AM.
juliansader is offline   Reply With Quote
Old 09-17-2016, 05:47 AM   #2
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,439
Default

Quote:
Originally Posted by juliansader View Post

This may have something to do with notes ending in Note-Ons with velocity=0 instead of Note-Offs, as the following GIF demonstrates:

I can't duplicate this (created a project with notes that use 0x90 note off syntax), and used the following code:
Code:
editor = reaper.MIDIEditor_GetActive()
take = reaper.MIDIEditor_GetTake(editor)
reaper.MIDI_Sort(take)
can you post a minimal .rpp and test script?
Justin is offline   Reply With Quote
Old 09-17-2016, 06:43 AM   #3
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 2,764
Default

Thanks for looking into this so quickly!

An RPP is attached.

In this example, the first note ends in a Note-On, but the second note gets extended to the end of the item when MIDI_Sort is run. (The difference seems to be due to the first note being selected. Selected and unselected notes seem to be handled separately.)




To test the notes, I use exactly the same 3-line script as you do.

Strangely, the MIDI editor and the arrange view display the extended note differently: the MIDI editor extends the second note to the end of the item, whereas the inline arrange view shows the *first* note as extended.
Attached Images
File Type: jpg Second note gets extended after running MIDI_Sort.jpg (25.3 KB, 205 views)
Attached Files
File Type: rpp Note ending in Note-On.RPP (3.1 KB, 143 views)

Last edited by juliansader; 09-17-2016 at 07:58 AM.
juliansader is offline   Reply With Quote
Old 09-17-2016, 12:24 PM   #4
Justin
Administrator
 
Justin's Avatar
 
Join Date: Jan 2005
Location: NYC
Posts: 12,439
Default

Thanks, fixing for 5.25rc2!
Justin 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 09:17 PM.


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