|
|
|
08-30-2017, 12:06 PM
|
#1
|
Human being with feelings
Join Date: Feb 2008
Posts: 67
|
Midi items bug? All Notes Off Question - Lua
Hello,
I had a problem when inserting notes in a midi item take.
A bit hard to explain but can be demonstrated with the interactive reascript.
Start with an empty reaper projet.
Insert the following lines in ireascript.
At the end there will be two All note offs in the take.
I know the notes are inserted out of the midi take length.
But can this be avoided?
Here are the steps.
reaper.InsertTrackAtIndex(0, true)
trk = reaper.GetTrack(0,0)
item = reaper.CreateNewMIDIItemInProj(trk, 0, 5, false)
take = reaper.GetMediaItemTake(item, 0)
dummy = reaper.MIDI_InsertNote(take, false,false,90*960,94 * 960,0,60,127,true)
dummy = reaper.MIDI_InsertNote(take, false,false,80*960,84 * 960,0,60,127,true)
dummy = reaper.MIDI_InsertNote(take, false,false,1*960,2 * 960,0,60,127,true)
sorty = reaper.MIDI_Sort(take)
reaper.Main_OnCommandEx(40612, 0, 0)
( The last command changes the item length to the take length.
So the question is.
How to avoid two or more all note offs after MIDI_sort outside the take length.
Regards,
Johan
|
|
|
08-30-2017, 04:09 PM
|
#2
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
Not a complete answer to your question but Reaper inserts All notes off messages automatically in MIDI items.
This can be observed e.g. when inserting a new blank MIDI item via Insert - New MIDI item and switch to event list in the MIDI editor.
So I think having that All notes off message is not totally avoidable (someone correct me if wrong).
I don't know why you get two of them in your case though and how this can be avoided.
|
|
|
08-30-2017, 04:18 PM
|
#3
|
Human being with feelings
Join Date: Feb 2008
Posts: 67
|
Hello,
The all note offs is not a problem if there is only one at the end of a take.
I think I get them because my notes are inserted outside the take lenght.
When reaper does the midi_sort function I suppose reaper does keep the original all notes off and ads a new one.
When doing this multiple times with a take there will be multiple all note offs.
Regards,
Johan
|
|
|
08-30-2017, 04:24 PM
|
#4
|
Human being with feelings
Join Date: Oct 2007
Location: home is where the heart is
Posts: 12,109
|
Ok, I thought you wasn't aware of the auto adding All notes off by Reaper to start with, sorry.
Other than that, I have close to none experience with MIDI scripting, so no idea how to help further, hopefully a more experienced MIDI scripter comes by.
Good luck.
|
|
|
04-08-2019, 04:54 PM
|
#5
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Been experiencing the same, tons of all notes off are being added, when notes cross the all notes off message, that limits the take.
|
|
|
04-09-2019, 11:50 AM
|
#6
|
Human being with feelings
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
|
1) Extend MIDI take with MIDI_SetItemExtents()
2) modify MIDI data, preserving last AllNotesOff message
OR just do stuff preserving last AllNotesOff message, see Julian Sader`s MIDI scripts
Last edited by mpl; 04-09-2019 at 11:59 AM.
|
|
|
04-10-2019, 08:08 AM
|
#7
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Thanks man!
My bad, I enlarged the item while setting the last note in the string.
I'm now iterating to the last note and checking if the position + new_position will exceed the item boundaries and extend the item BEFORE the notes are written in the take.
|
|
|
05-13-2019, 08:20 AM
|
#8
|
Human being with feelings
Join Date: Jun 2012
Location: Spain
Posts: 7,268
|
In one project I am having problems, a lot of random All Note Offs on some of my piano MIDI items, and I need to figure out why do I have them. How to know what can cause this? a MIDI script? I certainly have not inserted so many All Notes Off messages randomly.
|
|
|
05-13-2019, 08:40 AM
|
#9
|
Human being with feelings
Join Date: Oct 2017
Location: Black Forest
Posts: 5,067
|
Yes indeed, my nudge notes scripts did this (I think), when moving the notes out of the boundaries. Hadn't thought of that case, but fixed it in the meanwhile. I could imagine that other scripters missed this too, maybe.
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 12:08 PM.
|