Double/triple button press help

I want to make it so one press of a button do function 1, double press do function 2, etc…

I tried to use this tutorial to base my project off of https://youtu.be/kmQo3hCu504?si=P0W3DTHlHlrVlTJv

Attached project
1501079124875_One-shot-timer.bmtp (1.5 KB)

But in my case I’m using control change instead of note on/off. I feel like I’m very close. I set the “function” translator to trigger on the specific pp value that is set up by the two translator before it. But for some reason, it’s not working. I can see in the log that it spits out the value just fine but says [port closed] after that. Some clarification would be much appreciated. Thanks in advance!

Hi,

Since the tutorial that you viewed was made, I made a new version that uses the ‘Perform’ feature of Bome MIDI Translator Pro 1.91.

I’ve attached it below. I currently have 2 notes programmed.
The rules of the translators in preset 3 determine the particular note and channel each gesture (single, double, triple etc) to trigger. Each translator has it’s on outgoing action. Right now they are all set to none.

If you tell me what note you want as an example and what the outgoing action can be I can set up an example set of translators for that note. Then you can copy, modify and use them for other notes as you need.

Gestures-with-perform.bmtp (12.7 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Ah I see. I’ll have to learn more about the Perform feature then. But at the moment, all I want to do is have a mouse left click one spot on single press, a different spot on double press, etc I want to assign it to a button that spits out either a B1 7B 7F or B1 7B 00. It’s kind of like a toggle on off button which I’ve gotten around by just setting “any value” as long as it’s B1 7B. I can set the mouse position myself if you can set that up. Thank you!

OK, this version uses CC instead of notes.

I set up translator 2.3 to send mouse position x=100 y=100 for single tap.
Translator 2.5 is sends mouse position x=200 y=100 for double tap.
Translator send mouse position x=300 y=100 for triple tap.

There is a lot going behind the scenes as ‘gestures’ is a complex set of action.

Basically we count the number of times a given button is pressed or release within 500 ms. Based on that count, we determine the proper output.
A single tap is count 2 (press and release)
A double tap is count 4 …etc

The CC # evaluation and MIDI channel and rules are done in each translator in preset 2 to determine if all are a match. If anything doesn’t match, the outgoing action does not happen, otherwise it will.

Here are the rules of 2.3 . Other translators have similar rules but look for different conditions to look for a match. Only one of the translators will fire because each have different conditions.


// First parameter is  MIDI CH
// Second parameter is Note Number
// Third parameter is count
if zz==1 then Log "Log Gesture called with ch=%oo% note=%pp% count=%qq%"
// Which channel
if oo!=1 then exit rules, skip Outgoing Action
// Which note
if pp!=123 then exit rules, skip Outgoing Action
// Which count
if qq!=2 then exit rules, skip Outgoing Action
if zz!=0 then Log "Log Perform Success on Gesture Single tap MIDI CH %oo% Note %pp%"

I use global variable zz to determine whether to send log messages. This is done for troubleshooting. You can turn these messages off by setting it to 0 in the rules of translator 0.2 and then restarting the project.

My aliases are as follows. You should set up your input device to your physical controller port.

image

You can learn more about aliases from this tutorial.

In my example a push of a button is CC with a value of 127 and release is with same CC with value of 0. If your buttons are toggle instead of momentary, then this will not work as you will not be able to determine the count correctly.

If you need gestures for other CC’s, you would duplicate translators 2.1 through 2.10 and modify the rules for their proper note (CC) number and MIDI Channel.

If you want different mouse locations than the example, simply set the desired X and Y mouse locations in translators 2.3, 2.5 and 2.7. I left unused gesture translators disabled.

Good luck!

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Thank you very much for the in-depth guide. Should I copy & paste the rules into translator 2.3 of the project file you attached in your first reply, or was there supposed to be a different project file attached in your most recent reply? If it’s the latter, I can’t seem to find a project file despite the very helpful explanation.

There are more toggle buttons on my controller than momentary buttons so it’d be great if there’s a way for it to work with toggle buttons. If not is there a way for MT Pro to turn toggle buttons into momentary? If how the gestures are setup simply doesn’t work with toggle buttons and there’s no work-around, then it’s not the end of the world.

Whoops, no it is different. I neglected to paste it. Here it is.

Gestures-with-perform-CC-2024-05-17.bmtp (9.7 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

This was a great example
One thing to ask is how best to integrate a super quick tap on a button?

Hi, you would start a timer when you press the button (i.e. note-on), and stop the timer when you release it (note-off). Then after note-off, you look at the elapsed time and depending on the value, send a different MIDI message.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz