playing a soundfile

Jan 15, 2007 at 12:58am

playing a soundfile

hello
Ok i am quite new in MAxMsp so probably i ask easy questions but ok. I have to start playing a soundfile when i get two numbers within given constraints. It are cpordinates of a ball i am tracking. EG: X (horizontal) is between 0 and 100 and Y (vertical) between 0 and 100 (Xand y have different inboxes, they get their values from a separate box)
Now lets say that you have X is 50 and Y 10, so now i have to start the playback of a soundfile A
Another soundfile has to play within the boundaries of lets say X between 100 and 200 and Y between 0 and 100.
How can i make this possible .
again sorry for asking lame questions but being new with this sofware makes it difficult, i try to master the software this year.
thanks in advance
Samuel Van Ransbeeck

#29673
Jan 15, 2007 at 7:12am

Something like this? (copy the text and in Max choose file -> new from clipboard) If you master Max in a year that will be a serious accomplishment! :)

You might also check out the objects sel, split, change, ==, >, < and scale for starters. I'm sure there are a zillion more elegant ways to do this, but none the less, here's a patch:

max v2;
#N vpatcher 93 245 563 638;
#P window setfont Helvetica 9.;
#P window linecount 1;
#P newex 75 224 45 1376265 onebang;
#P newex 233 112 27 1376265 t b i;
#P newex 75 181 112 1376265 if $i1 & $i2 == 1 then bang;
#P newex 233 89 142 1376265 if $i1 > 0 & $i1 < 100 then 1 else 0;
#P message 92 252 30 1376265 open;
#P newex 75 310 34 1376265 *~ 0.5;
#P message 75 253 14 1376265 1;
#N sfplay~ 1 120960 0 ;
#P newobj 75 277 40 1376265 sfplay~;
#P newex 75 336 30 1376265 dac~;
#P newex 75 90 152 1376265 if $i1 > 100 & $i1 < 200 then 1 else 0;
#P comment 233 43 22 1376265 y;
#P number 233 64 35 9 0 0 0 21 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 75 65 35 9 0 0 0 21 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 75 44 22 1376265 x;
#P connect 1 0 4 0;
#P connect 12 0 11 0;
#P connect 4 0 11 0;
#P connect 11 0 13 0;
#P connect 13 0 7 0;
#P connect 9 0 6 0;
#P connect 7 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 5 0;
#P connect 8 0 5 1;
#P fasten 6 1 13 1 110 300 133 300 133 215 115 215;
#P connect 12 1 11 1;
#P connect 2 0 10 0;
#P connect 10 0 12 0;
#P pop;

Quote: Thinksamuel wrote on Sun, 14 January 2007 16:58
—————————————————-
> hello
> Ok i am quite new in MAxMsp so probably i ask easy questions but ok. I have to start playing a soundfile when i get two numbers within given constraints. It are cpordinates of a ball i am tracking. EG: X (horizontal) is between 0 and 100 and Y (vertical) between 0 and 100 (Xand y have different inboxes, they get their values from a separate box)
> Now lets say that you have X is 50 and Y 10, so now i have to start the playback of a soundfile A
> Another soundfile has to play within the boundaries of lets say X between 100 and 200 and Y between 0 and 100.
> How can i make this possible .
> again sorry for asking lame questions but being new with this sofware makes it difficult, i try to master the software this year.
> thanks in advance
> Samuel Van Ransbeeck
—————————————————-

#93172

You must be logged in to reply to this topic.