Page 1 of 1

Wait a few frames between midi messages

Posted: 05 Feb 2013 15:22
by Tim
Hi,

I'd like to create a button which sends a midi message then waits a few frames or a set amount of time and then send out another midi message.
For example when pressing a button:

midiout(0, {0xB0, 0x10, 0x01});
//Wait a few frames
midiout(0, {0xB0, 0x11, 0x01});

Is there an easy way to do this?

Thanks!

Re: Wait a few frames between midi messages

Posted: 05 Feb 2013 17:20
by Softcore
proof of concept with one pad with "fixed" delay (look inside pad for variable delay) and a pad with a knob which sets the desired delay in seconds up to 5 seconds (for more precise control the limit can be set by changing the number multiplied with x - look inside pad for 'delay' variable)...

For showcasing the logic I have used a monitor object where the display text is changed - replace the actions commented in the scripts with your midi args....
delayed_action.jzml
(12.81 KiB) Downloaded 106 times

Re: Wait a few frames between midi messages

Posted: 05 Feb 2013 17:41
by Tim
It's working! Thank you so much Softcore!

I've edited the script a bit so that you don't have to hold the pad for the delayed action to take place, I've attached it for those who are interested.

Thanks again Softcore!

Re: Wait a few frames between midi messages

Posted: 05 Feb 2013 18:21
by Softcore
Nice one! thanks for sharing!