on/ off value from external button

Apr 22, 2007 at 9:15pm

on/ off value from external button

I have just started using this program and need to figure something out. I am creating an art piece where the viewer sits on a chair. When he sits down he applies pressure to a button of some sort. While he is sitting the button is “on” and when the pressure is off the button is “off”. What sort of button and cabling can i use? Surely I must use some sort of button where an electrical connection is made, and then max msp detects the current as the “on” value?

#31531
Apr 22, 2007 at 9:40pm

#102637
Apr 24, 2007 at 10:09am

Take a look at the new article “Making Connections: Connecting a Joystick to MaxMSP/Jitter” on the home page of this site. An old Joystick is by far the easiest and cheapest way to solder switches onto an interface which can be read by Max/MSP. Generally, you can connect wires in excess of 10 meters to such a device without instability (there is a maximum length, however, after which the switch will start to turn on and off chaotically. This will depend on the joystick, and will usually not be less than, say, three meters.) Forget special sensors and switches if you can; find a completely normal on/off switch and devise a way to connect it to the chair so that it does what you want it to. There are switches intended for doorways which really click on and off (look here to see what I mean: http://www.elmecoindia.com/microswitch.html )

You will also want an antihysterisis (anti-retrigger) element, such as this:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 490 167 71 9109513 loadmess 1000;
#P toggle 359 287 15 0;
#P number 480 203 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 409 225 81 9109513 if $i1 > $i2 then 0;
#P number 372 203 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 301 225 81 9109513 if $i1 > $i2 then 1;
#P window linecount 2;
#P comment 441 135 64 9109513 time between on and off;
#P number 409 167 71 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 409 139 29 9109513 timer;
#P number 301 167 71 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 301 139 29 9109513 timer;
#P newex 301 98 44 9109513 TogEdge;
#P toggle 301 74 15 0;
#P window linecount 2;
#P comment 230 139 64 9109513 time between off and on;
#P fasten 13 0 9 0 495 191 377 191;
#P fasten 13 0 11 0 495 191 485 191;
#P fasten 10 0 12 0 414 262 364 262;
#P fasten 8 0 12 0 306 262 364 262;
#P fasten 2 1 3 0 340 130 306 130;
#P lcolor 5;
#P fasten 2 1 5 1 340 130 433 130;
#P lcolor 5;
#P fasten 2 0 3 1 306 121 325 121;
#P fasten 2 0 5 0 306 121 414 121;
#P connect 6 0 10 0;
#P connect 11 0 10 1;
#P connect 4 0 8 0;
#P connect 9 0 8 1;
#P connect 5 0 6 0;
#P connect 3 0 4 0;
#P connect 1 0 2 0;
#P window clipboard copycount 14;

I’m sure it’s not the best solution, but it works, and will keep your installation from turning on and off each time the viewer shifts his or her weight.

#102638

You must be logged in to reply to this topic.