|
Post by nonjohn on Sept 6, 2018 13:09:16 GMT
Dear Nic,
I am in need of a module to prepare MIDI notes before they are sent to a Yamaha Disklavier for playback. Sometimes, because of mappings I use, I might generate double instances of the same note-on before a note-off is generated for that same corresponding note. My digital pianos can make sense of this and trigger the same sample multiple times, but an acoustic player piano needs to have the key release by way of note off before it can restrike that same key. Thus, I need a Stream Byter module that can detect if there is a second instance of a note-on for the same MIDI note number that already has a current note-on, and if so, delay the second note-on until the module can first generate and send out a note-off for that same MIDI note number, and then let the second MIDI note on be sent out without any more delay than necessary.
Thanks as always for any help you can lend with this matter.
-Nonjohn (AKA John Tennison)
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 7, 2018 8:48:46 GMT
Hi nonjohn, I will see what I can come up with for you. Will not be until next week, I'm afraid. Regards, Nic.
|
|
|
Post by nonjohn on Sept 7, 2018 10:59:40 GMT
Nic,
As always, thank you so much!
-Nonjohn
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Sept 12, 2018 10:15:02 GMT
Hi nonjohn , Try this: # nonjohn note magic by audeonic # init vars IF LOAD ASS I0 = 0 IF I0 < 80 +L ASS LI0 = 0 # last note velocity ASS KI0 = 0 # per note instance count MAT I0 = I0 + 1 END END 9X XX 00 = 8X IF MT == 90 # increment note instance count MAT KM1 = KM1 + 1
# is this note now multiply sounding? IF KM1 > 1 # retain velocity ASS LM1 = M2 # block the note on # (effectively delay) XX = XX +B END END
IF MT == 80 # decrement note instance count MAT KM1 = KM1 - 1
# still sounding? IF KM1 > 0 # send delayed note on # (after this note off) MAT I0 = 90 + MC SND I0 M1 LM1 END END
Note, this will only work with max 2 instances of the same note being sounded simultaneously. I haven't tried this myself and also just typed it in. Might be syntax/logic errors. Regards, Nic.
|
|