I am sending out a MIDI note with a delay (30 seconds), from an input MIDI note. This works correctly, however I want to prevent the output from happening again if the input MIDI note is pressed within the same time period (30 seconds). Is there a way to filter out multiple inputs within that given time period?
For context - the input MIDI note is tied with a start button to start a backing track. The BOME output note then queues the next track, ready to play when the start button is pressed again. However if I stop and start the same track again in quick succession then the output command is obviously sent twice, meaning that the queue command is sent twice (which results in a skipped track).
The following example should help. In this case I set the delay to 3 seconds as I didn’t want to wait too long in debugging the project .
The first translator will send out the delayed note only if ga!=1 Zero is
the default value for all global variables when a project is started.
The second translator sets ga to 1 and the triggers a watchdog timer that will set ga back to 0 in 3 seconds. The third translator sets ga back to 0 when the watchdog timer trips.
In doing this only the first trigger will fire the delayed output. All other triggers will not fire an output because ga=1.
Hi @SteveC , just wondered - is there a way to extend this functionality to cancel the delayed MIDI note completely if another MIDI note (tied to a stop button) is pressed within that given time period.
This would give an advantage as it means if I need to stop the track playback and then start it again after a minute or two, the delayed MIDI note (which queues the next track) won’t have been sent. With the current set up the next track will have already been queued and I will need to go back on my track selection first before hitting play.
In this case the initial trigger sets both a watchdog timer and a delayed note timer.
The watchdog timer triggers as it did before.
The delayed note timer is set for 3 seconds, and sends the note message (translatore 0.3) however if the cancellation message is sent (translator 0.4), then the timer is killed and the note is never sent.
@SteveC Sorry can I request one final variation of this (for a different function I’ve found). Is there a way to simply suppress/filter out repeat CC’s in a given time period? For example I have an issue with a button that I want to fire a CC immediately on press, but not fire again if that button is pressed again within the next 2 seconds. Is that possible? Many thanks again.
However … I am adding this test only on the initial setting of the Watchdog timer, not on the Translator that ends the timer and resets the variable to 0. So, I am thinking that the variable should always be reset in any case. All I am doing is preventing the extension of the timer if the trigger re-occurs before the timeout period.
< Details >
I use this for Ableton Track-Left and Track-Right actions fired from a rotary encoder set to Relative 2’s complement output (from an MPD-218). The speed was way too fast to make it useful, so I implemented your Watchdog technique on both the Left and Right actions. However, I did notice that, when turning continuously, the motion of Ableton was slower than if I turned the knob slowly. This issue turned out to be the culprit … constantly resetting the Timer. This was my fix.
< End Details>
And, by the way, I’ve been using BMT less than 48 hours and already love it. I’ve transitioned a chunk of Binding from Cantabile into BMT and this is definitely the tool for doing this kind of work!