Prev Previous Post   Next Post Next
Old 08-23-2023, 01:14 AM   #24
sockmonkey72
Human being with feelings
 
sockmonkey72's Avatar
 
Join Date: Sep 2021
Location: Berlin
Posts: 2,017
Default

Quote:
Originally Posted by Petey-B View Post
A Real Head Scratcher
In the MIDI Editor I have a script that moves selected notes by an interval; it works most of the time, but in one situation goes horribly awry.
This is the MIDI editor before running the script. The index of the selected note is 9, and overlaps the previous note.



This is the script:
Code:
-- Move the selected note back by an eigth
local _,_,_,s,e = reaper.MIDI_GetNote(take,9)
reaper.MIDI_SetNote(take,9,nil,nil,s-480,e-480,nil,nil,nil,true)
reaper.MIDI_Sort(take)
This is the result:



Notes:
This works correctly IF:
  • the notes aren't overlapped
  • the note is not selected
  • the notes are not the same pitch
  • the note is moved by the arrow keys rather than the script
If I use MIDI_GetNote to check the lengths after, they don't reflect the longer note. It does however appear correctly in the event list.
I haven't come up with a workaround for this, it always seems to happen when the notes fall on the same starting point.

I wasn't sure if this belonged in Bug Reports or Developer's Forum, but I found this thread and it seemed appropriate...
This is a long-standing bug in the high-level API. You can use my drop-in replacement, MIDIUtils (here), which solves it.
__________________
ReaPack Repository: right-click and copy index URL
sockmonkey72 is offline   Reply With Quote
 

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 05:53 PM.


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