Forums > MaxMSP

Sensors and trigger

January 24, 2006 | 10:26 pm

Hi everybody,

I am brand new in max/msp/jitter and I am having some problems to trigger a video with external sensors…
Anyone help please !!!!
I have a force sensor on the floor that runs from values 800 to 1000 and I want to trigger a video just if this value is higher than 900, for example if someone not too heavy steps on it and the value goes to 900, nothing happens, but if the value is 901 or higher a video is triggered. Is that possible?
Any help please….!!!

Thanks so much
Bird


January 24, 2006 | 11:18 pm

Yes. it’s possible.

The triggering stuff will look like

(whatever your sensor input is)
|
|
|
[> 900]
|
|
[change]
|
|
|
[select 1]
|
|
|
(however you plan to trigger your video)

The three Max objects you’ll need to understand are >, change, and select. You’ll have to look at the Jitter tutorials for how to play a video. There are took many ways of getting sensor data for me to generalize, but I’ll make some suggestions if you give me more information.

cheers,

mz


January 24, 2006 | 11:22 pm


January 24, 2006 | 11:25 pm

Included patch (copy/paste in text file then open it in maxmsp) shows
how to trigger when sensor value reaches a value higher than 900. It
then give one signal.

Cheers,
–Aadjan

max v2;
#N vpatcher 10 59 610 459;
#P origin 0 177;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 76 136 14 196617 0;
#P message 44 136 14 196617 1;
#P window setfont "Sans Serif" 12.;
#P comment 28 217 14 196620 0;
#P comment 27 178 14 196620 1;
#P user multiSlider 44 162 196 92 -1. 2. 1 3177 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P window setfont "Sans Serif" 9.;
#P newex 45 112 44 196617 togedge;
#P newex 44 88 78 196617 expr $i1 – 900;
#P newex 45 66 78 196617 r sensor_value;
#P window setfont "Sans Serif" 12.;
#P comment 41 42 221 196620 Trigger on value passing a theshold;
#P connect 1 0 2 0;
#P connect 3 0 7 0;
#P fasten 8 0 4 0 81 155 49 155;
#P fasten 7 0 4 0 49 154 49 154;
#P connect 2 0 3 0;
#P connect 3 1 8 0;
#P pop;


Viewing 4 posts - 1 through 4 (of 4 total)