1 and 0 on off switch

Jan 14, 2012 at 11:44pm

1 and 0 on off switch

using a toggle box which when a pressed inputs a 1 and released inputs a 0, is there any way to press it and release and have the one held in, its easier to see in the patch,

any help would be hugely appreciated.

  1. 1and0switch.maxpat
Jan 15, 2012 at 12:09am

You can use mousestate and a gate to do it:

– Pasted Max Patch, click to expand. –
Jan 15, 2012 at 1:12am

Or just use [pictctrl] and create yourself an image of the [toggle] on and off states stitched together!

Jan 15, 2012 at 1:24am

hey guys thanks for all the help, its actually using an xbox controller, for example pressing the green A button creates a 1 and then a 0 when releasing it

Jan 15, 2012 at 1:27am

That’s much better.

Jan 15, 2012 at 1:30am

but i cant get the toggle to stay “on” when pressing and realeasing it untill i press it again and it goes “off”

Jan 15, 2012 at 1:34am

Not sure I follow you now, do you want it to be momentary (press=on, release=off) or latching (press=on, press again=off).

If you’re using a control that sends a 1 and a 0 then you’re done already, when pressing the button, its a 1, and when you let it go it’s a zero, you don’t even need a toggle (if I understand you correctly). That’s how it is with the wiimote.

Jan 15, 2012 at 10:46pm

it would be a latching system, at the moment when i press and hold the button the step sequencer starts but it stops when i release it.

Thanks for all the support so far guys

Jan 15, 2012 at 10:52pm

[Togedge] is your friend here, if I’m understanding you correctly:

– Pasted Max Patch, click to expand. –
Jan 15, 2012 at 11:24pm

yessss sir! :D thanks soooo much! :D :D ^^

Jan 16, 2012 at 1:17am

i use [sel 1] for this..

– Pasted Max Patch, click to expand. –

You must be logged in to reply to this topic.