Wait a few frames between midi messages

Discuss Lemur and share techniques.
Post Reply
Tim
Newbie
Posts: 11
Joined: 07 Dec 2011 13:50
Location: The Netherlands
Contact:

Wait a few frames between midi messages

Post 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!
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Wait a few frames between midi messages

Post 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 104 times
Tim
Newbie
Posts: 11
Joined: 07 Dec 2011 13:50
Location: The Netherlands
Contact:

Re: Wait a few frames between midi messages

Post 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!
Attachments
delayed_action_edited.jzml
(12.81 KiB) Downloaded 101 times
Softcore
Regular
Posts: 1613
Joined: 04 Nov 2012 08:34

Re: Wait a few frames between midi messages

Post by Softcore »

Nice one! thanks for sharing!
Post Reply