Can a long pressed button be converted to another message than the same button pressed quickly?

Hi! I’m trying to set up my midi pedal to control a looper which let me record to multiple looper tracks.

What I would like to do is have 1 foot switch send a midi message to the looper to trig record/play when pressed (short regular press) and when the same foot switch is pressed and held down for say 2 seconds another midi message is sent that will clear the recorded loop. Is this possible and how?

This way I could have all the controls I need for 6 looper tracks from just 6 foot switches instead of 12 and having to mess with switching banks on the foot controller.


1 Like

Looks like indeed it is possible! Check this out:

Button delay, different messages.mhp (460 Bytes)

The input should be Note On and Note Off message - if it is held for less than a second, the output will be CC#3=0, if it’s held for >= 1 and < 2 seconds, it will be CC#3=127, if it’s held longer, no output (cancel action).

A key thing is to map the note in particular to the Bypass argument of the Output pipe.

The principle of operation is to retrigger the saw up LFO upon a Note On message, so it goes through a cycle between 0 and 127 values within 2 seconds, a Note Off message is delayed by 63ms (1.0 / LFO resolution), so that the bypassed output gets unbypassed in time to receive the last CC message produced by the LFO before the LFO gets stopped.

The output messages are defined in the last 2 Transform pipes.

The input and output message types can be tweaked a little bit by editing the Transform pipes, or adding more of them. :slight_smile:

Let me know if your MIDI pedal can’t produce note on and note off messages, we’ll see how to adapt this.

Also, to put this into practical use, some filter pipes just after the input should be placed to drop any of the messages coming in from the input that shouldn’t be triggering this processing feat.


Awesome! Will try this tomorrow.

Been trying this out for a while and I don’t think my pedal controller can send note of messages unfortunately. It does send out the same note with a velocity of 0 when the pedal is released though. Is there a way to make that work instead?

When I try your pipe with a midi keyboard that does send out note on and off when a key is pressed and released the output is first a stream of multiple CC3 value 0 messages and after a second I get a stream of multiple CC3 value 127 messages. Is there a way to get it to only output one message?

Yes, you have to map the Bypass parameter of the output pipe to the Note message your controller sends.

I did that, I might have misread the midi monitor though. If I have the output block selected I can see a stream of output messages but when I check what’s coming out the cable with an external midi monitor or set the output to a virtual output and create another pipe I can see the stream is not sent.

How can I modify this to work with (for example) midi note C-1 with velocity of 100 on foot switch press and C-1 velocity 0 on foot switch release?

I figured it out with a transform pipe, thanks!

1 Like