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.

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

You can use mousestate and a gate to do it:

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

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

#220756
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

#220757
Jan 15, 2012 at 1:27am

That’s much better.

#220758
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”

#220759
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.

#220760
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

#220761
Jan 15, 2012 at 10:52pm

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

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

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

#220763
Jan 16, 2012 at 1:17am

i use [sel 1] for this..

– Pasted Max Patch, click to expand. –
#220764

You must be logged in to reply to this topic.