stop sfplay~ loop

Apr 18, 2008 at 5:21am

stop sfplay~ loop

I’ve connected some FSRs -> Arduino -> Max. When an FSR is triggered, I’m using sfplay~ to play a short sound [??ms]. However, if the FSR remains on [>1] then the sound goes on repeatedly. Also, the FSRs are so sensitive that even with a quick hit, the sound plays more than once.

My question: Is there a way to only play the sound once when the FSR is triggered?

Many Thanks

#36988
Apr 18, 2008 at 7:17am

On 18 avr. 08, at 07:21, v1025kernel wrote:
>
> I’ve connected some FSRs -> Arduino -> Max. When an FSR is
> triggered, I’m using sfplay~ to play a short sound [??ms]. However,
> if the FSR remains on [>1] then the sound goes on repeatedly. Also,
> the FSRs are so sensitive that even with a quick hit, the sound
> plays more than once.
>
> My question: Is there a way to only play the sound once when the FSR
> is triggered?

Is this what you want:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 239 47 127 196617 From Arduino serial port;
#P inlet 181 42 15 0;
#P user ezdac~ 181 330 225 363 0;
#P message 106 257 72 196617 open anton.aif;
#P message 181 241 14 196617 1;
#P newex 181 214 54 196617 onebang 1;
#P newex 181 188 32 196617 sel 1;
#P newex 181 154 40 196617 change;
#N sfplay~ 1 120960 0 ;
#P newobj 181 282 44 196617 sfplay~;
#P newex 181 132 36 196617 > 120;
#P number 181 86 35 9 0 1023 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 239 88 100 196617 FSR (0-1023);
#P comment 240 133 100 196617 A threshold;
#P connect 11 0 2 0;
#P connect 4 0 10 0;
#P connect 4 0 10 1;
#P connect 9 0 4 0;
#P connect 8 0 4 0;
#P connect 6 0 7 0;
#P fasten 4 1 7 1 220 308 245 308 245 207 230 207;
#P connect 7 0 8 0;
#P connect 5 0 6 0;
#P connect 3 0 5 0;
#P connect 2 0 3 0;
#P window clipboard copycount 13;

_____________________________
Patrick Delges

Centre de Recherches et de Formation Musicales de Wallonie asbl

http://www.crfmw.be/max

#127316
Apr 18, 2008 at 3:10pm

Thanks Patrick!
That worked perfectly.

#127317

You must be logged in to reply to this topic.