|
Post by Dchild on Aug 11, 2018 2:16:01 GMT
Looking to delay a note after the live input quantiser script.
Guessing this is really simple
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Aug 11, 2018 8:31:21 GMT
Pretty simple:
NX = XX +D500
will delay all notes (on and off) by 500ms. Obviously you can change the 500 to whatever suits you!
Regards, Nic.
|
|
|
Post by ralph on Feb 1, 2020 9:30:11 GMT
I would like to delay note-on messages but pass through note-off messages without delay.
From my understanding, modifying your example NX=XX +D500
to N8=XX +D500 N9=XX
should do that, but how can I stop StreamByter from sending a delayed note-on if during the delay time, a note-off was received for the same note on the same MIDI channel?
Thank you.
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 1, 2020 10:46:46 GMT
Hi ralph , To delay just note on messages you would change the rule as follows: 9X XX 01-7F = XX +D500 However, your second part is a bit more complex and you would need to replace that simple rule with some logic for handling that. Regards, Nic.
|
|
|
Post by ralph on Feb 1, 2020 10:51:49 GMT
OK, I thought so. Do you remember anyone who has done anything similar like working with expiring timers and doing logic comparisons etc.?
|
|
nic
Soapbox Supremo
Troublemaker
Press any key to continue
Posts: 2,011
|
Post by nic on Feb 1, 2020 14:04:50 GMT
No, I don't remember anyone! But here is how I would approach it.
First you want to maintain a timeline in ms as each note on/off comes in. This will keep the current timeline in L80 and each event is given a timestamp in ms:
if MT < A0 calc L80 = L80 + T0
# L80 will contain the timestamp # for this note off/on end
Be aware that L80 will go up to about 65K ms and then cycle back to zero. Your logic will need to cater for this. Then you need to keep track of each currently sounding note's expiry time. Because you want to be able to do this for any note on any MIDI channel, we need to use the 'W' array to store expiry times indexed by channel+note number. Something like this (inside that if clause above):
# calculate index into W array into I0 calc I0 = $128 * MC calc I0 = I0 + M1
if MT == 90 # store expiry time calc WI0 = L80 + K0
# delay the note on send M0 M1 M2 +DK0 block end
then when you get a note off before the expiry time, set the expiry time to 0 (hopefully that won't occur naturally) again inside that 1st if clause
if MT == 80 assign WI0 = 0 end
finally, modify the IF MT == 90 clause so that it only does the send/block bit if WI0 is not zero.
Something like that. There could be a smarter way.
Regards, Nic.
|
|
|
Post by julienj on Nov 27, 2023 14:05:02 GMT
Hi! Is it possible to have a delay based on tempo instead of milliseconds?
|
|
|
Post by redheronmusic on Nov 28, 2023 13:21:18 GMT
Hi! Is it possible to have a delay based on tempo instead of milliseconds? This is a very different, but interesting question. Please start a new thread, and I will reply with some ideas.
|
|
|
Post by julienj on Dec 2, 2023 11:31:19 GMT
|
|