Momentary button

Andy Maskell's icon

Does anybody know of an object, external or other method to create a momentary toggle button that will turn on with mouse down and turn off with mouse up?

Thanks.

Roman Thilenius's icon


ubutton, led, lcd, pctctrl, mousestate, jit.display ...

double_UG's icon

live.button

Max Patch
Copy patch and select New From Clipboard in Max.

Andy Maskell's icon

This actually does the trick it seems:

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

toggle means change state on one input trigger

momentary is something totally different

this is all you need to produce 1 on mouse down
and 0 on mouse up

Andy Maskell's icon

What I meant was creating a button of some sort that outputs a 1 all the while it is pressed and a zero when it's released. That's momentary to me. I've removed toggle from the title of the thread!

Source Audio's icon

I see
As workaround I use ubutton with 1 & 0 messages.
You can also try pictctrl in button mode.
in 32bit max version there was rs.textbutton
which I used a lot.

Andy Maskell's icon

I've been able to encapsulate my momentary button in an embedded bpatcher and save it as a snippet. Works a treat!

Max Patch
Copy patch and select New From Clipboard in Max.

Pietro Gualducci's icon

Hi Andy Maskell, can you show me the patch plis? I need to understand how does it works

Andy Maskell's icon

@Pietro At the end of my last post, you can see a grey box marked “Max Patch”. Click on the blue box with the Copy icon. That copies the patch to the clipboard. Now in Max, select “New from Clipboard” under the file menu and my patch will be inserted and available for you to analyse.

Once you have opened the patcher, you will need to hover your mouse over the blue border of the [bpatcher] object and then double click the margin to open the embedded patch. Then click on the yellow "Presentation" icon on the bottom toolbar to expand the code.