Tempo Envelope Switch

Hello again. I have the same issue, but this time it’s the opposite. I’m trying to press a key to execute a sequence, but if I hold down the same button, it executes a different sequence instead.

I can’t believe I’m struggling so hard over a stupid variable switch, I’ve been doing this for 2 hours and nothing works.

I’m using the press down of the button (velocity 127) to trigger both evaluation timers, and release of the button (velocity 0) to trigger the first sequence, if the second one wasn’t triggered. Releasing the button should reset the variable to sequence 1, and triggering the second sequence should too. Have a 1 second delay to trigger the timer for the second sequence. Using a s9 global variable. I have no idea why it refuses to work at this point. It doesn’t make any sense.

Tempo Envelope Switch.bmtp (3.2 KB)

Yes, timers can be kind of tricky. I also moved this to a new thread because it is a different question.

So when you press the button you want to
1 - Click the mouse at a given position after 5ms
2- Move the mouse to another position after another 5 ms (10 ms total)

You also want to trigger a 1 shot timer 1000ms to kill the above timers, but killing a one-shot timer does not make sense because it would already have been fired and there is nothing to kill. Once you start a timer it will only be triggered if the kill command comes before the timer delay. So I’m not understanding what you want to do here

When you release the button you want to
1- Click the mouse at a given position
2- Move the mouse to another position after 5ms

I’m also not quite sure what you are doing with the global variable s9 and whether it is needed.

Maybe if you can just explain the sequence of mouse event you want to happen, I can help further.

Steve Caldwell
Bome Customer Care

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

Sorry, my explanation was probably bad. And I just added it to the other question because it’s basically the reciprocal of the same problem. Using a watchdog timer to do something based on a countdown timer. In this case it’s holding a button down for one second, instead of a timer expiring if no action is taken.

I just want to push a button and it will click on an ‘envelope’ object.
I want to hold down the same button and instead of clicking on the envelope button, it will click the tempo sync button. A quick button press clicks on env every time. Hold down will click on tempo.

I didn’t know timers died if they processed. Thought you had to manually kill them. Thought it wasn’t working because I had to kill them to reset the variable.

The two click translators is just the ‘get position’, click and then ‘return to position’. It’s just a single click on an object. The ‘Return’ translator is delayed so it waits for the click before returning the mouse cursor.

I’m just using the s9 variable to keep it independent of any other variable. Any kind of new sequence I’m doing, I use a new global variable to avoid conflicts.

So basically push button to click in one spot, hold down the same button to click on another spot.

Ah so we are back to gestures

Push and release - Click on one spot return to original spot when done
Push and Hold - Click on another spot return to original spot when done

Is that correct?

I can fairly easily modify one of the former project files that would do this. (I hope)

I can’t guarantee it wont use some of the same global variables you are already using in your larger project, however so you would need to inventory the global variables that I use and either change them or change some of the variable you use within your project.

Please confirm that this is what you are looking for.


Ya, I want to push the button and it triggers the first sequence.
Envelope Enable Capture Mouse And Click
Envelope Enable Return

Holding down the same button for more than a second cancels out the first click and triggers the second sequence.
Tempo Toggle Capture Mouse And Click
Tempo Toggle Return

I tried using the release message of the off button (note off - velocity zero) as the trigger for sequence 1, so it gives opportunity for the press (note on velocity 127) to trigger the evaluate timers. So after a second, the timer would cancel the release of the button trigger for sequence 1. But I’m doing something wrong. They both click or neither click.


See the attached. Since I believe you are using MIDIBuddy to capture the curser original position with ga and gb, I’m using za and zb instead in this example. This is using my original gestures template

gesture-example-2021-11-08.bmtp (20.0 KB)

Steve Caldwell
Bome Customer Care

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

Here is another version that does not use the standard gesture template. It focuses specifically on what you want to do

Sequence 1 handles push and hold
Sequence 2 handles push and release
I set it up for note 3 on MIDI CH 13 in the first translator
Evaluate is called when you press the button and counts presses and releasesand triggers timer “Trigger”
Incoming Trigger Count of 1 triggers Sequence 1 (Press and hold)
Incoming Trigger Count of 2 triggers Sequence 2 (Press and release)
Release after press and hold does not trigger anything as set in the last area of translator 0

SliceX-Simple-Example.bmtp (3.0 KB)

Steve Caldwell
Bome Customer Care

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