Forums > MaxMSP

sfplay sequencer

April 21, 2007 | 11:35 pm

I am attempting to play back samples with this chain of sfplay~ objects. The concept of chaining the output bangs together seems to work fine for a few steps of the sequence, then breaks down. This usually happens after the 3rd step. The patch is in text form below. Any help regarding operator error or limitations that would cause this would be appreciated.

max v2;
#N vpatcher 8 103 1168 897;
#P origin 86 82;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 444 386 132 196617 651834 inverse retrograde;
#P comment 442 349 95 196617 459276 retrograde;
#P window linecount 2;
#P comment 75 127 49 196617 sequence on;
#P button 76 108 15 0;
#P button 578 112 15 0;
#P button 608 187 15 0;
#P window linecount 1;
#N sfplay~ 1 120960 0 ;
#P newobj 566 164 44 196617 sfplay~;
#P message 604 138 14 196617 1;
#P message 567 82 61 196617 open 4.wav;
#P button 461 112 15 0;
#P button 349 111 15 0;
#P button 491 187 15 0;
#N sfplay~ 1 120960 0 ;
#P newobj 449 164 44 196617 sfplay~;
#P message 487 138 14 196617 1;
#P message 450 82 61 196617 open 5.wav;
#P button 382 182 15 0;
#N sfplay~ 1 120960 0 ;
#P newobj 332 160 44 196617 sfplay~;
#P message 370 138 14 196617 1;
#P message 330 80 61 196617 open 9.wav;
#P button 253 107 15 0;
#P button 141 106 15 0;
#P newex 823 -28 66 196617 comb~;
#P button 283 182 15 0;
#N sfplay~ 1 120960 0 ;
#P newobj 241 159 44 196617 sfplay~;
#P message 279 133 14 196617 1;
#P message 242 77 61 196617 open 2.wav;
#P button 174 177 15 0;
#N sfplay~ 1 120960 0 ;
#P newobj 124 155 44 196617 sfplay~;
#P message 162 133 14 196617 1;
#P message 122 75 61 196617 open 7.wav;
#P button 0 87 15 0;
#P message 46 134 14 196617 1;
#P user gain~ 330 267 23 49 158 0 1.071519 7.94321 10.;
#P user ezdac~ 324 354 368 387 0;
#P button 57 180 15 0;
#P message 0 113 61 196617 open 6.wav;
#N sfplay~ 1 120960 0 ;
#P newobj 7 157 44 196617 sfplay~;
#P comment 20 89 49 196617 initialize;
#P window linecount 2;
#P comment 819 -7 100 196617 reverb: comb , tapin , tapout;
#P window linecount 1;
#P comment 442 329 70 196617 672954 basic;
#P comment 442 367 83 196617 438156 inverse;
#P connect 10 0 5 0;
#P connect 9 0 4 0;
#P connect 5 0 4 0;
#P connect 37 0 9 0;
#P connect 4 1 6 0;
#P connect 6 0 11 0;
#P connect 12 0 13 0;
#P connect 11 0 20 0;
#P connect 20 0 12 0;
#P connect 13 1 14 0;
#P connect 16 0 17 0;
#P connect 14 0 15 0;
#P connect 15 0 21 0;
#P connect 21 0 16 0;
#P connect 17 1 18 0;
#P connect 8 0 7 0;
#P connect 18 0 22 0;
#P connect 34 0 8 0;
#P connect 28 0 8 0;
#P connect 24 0 8 0;
#P connect 17 0 8 0;
#P connect 13 0 8 0;
#P connect 4 0 8 0;
#P connect 23 0 24 0;
#P connect 22 0 30 0;
#P connect 8 0 7 1;
#P connect 30 0 23 0;
#P connect 24 1 25 0;
#P connect 27 0 28 0;
#P connect 25 0 26 0;
#P connect 26 0 31 0;
#P connect 31 0 27 0;
#P connect 28 1 29 0;
#P connect 33 0 34 0;
#P connect 29 0 32 0;
#P connect 32 0 36 0;
#P connect 36 0 33 0;
#P connect 34 1 35 0;
#P pop;


April 22, 2007 | 12:32 pm

you can do this easily with only one sfplay~ object, see patch below…

cheers

max

max v2;
#N vpatcher 161 222 862 648;
#P window setfont "Sans Serif" 9.;
#P number 313 223 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 255 116 14 196617 2;
#P number 255 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 255 204 62 196617 prepend set;
#P newex 255 186 27 196617 + 1;
#N sfplay~ 2 120960 0 ;
#P newobj 352 140 60 196617 sfplay~ 2;
#P user gain~ 377 170 24 55 158 0 1.071519 7.94321 10.;
#P user ezdac~ 351 254 395 287 0;
#P user gain~ 352 170 24 55 158 0 1.071519 7.94321 10.;
#P window linecount 2;
#P message 352 102 247 196617 preload 2 1.wav , preload 3 2.wav ,
preload 4 3.wav , preload 5 4.wav , preload 6 5.wav , preload 7
6.wav;
#P window linecount 1;
#P comment 253 225 65 196617 now playing:;
#P connect 9 0 8 0;
#P fasten 7 0 8 0 260 222 250 222 250 164 260 164;
#P fasten 5 2 8 0 407 164 260 164;
#P connect 8 0 6 0;
#P connect 6 0 7 0;
#P fasten 8 0 10 0 260 184 318 184;
#P connect 2 0 3 0;
#P fasten 9 0 5 0 260 135 357 135;
#P connect 8 0 5 0;
#P connect 1 0 5 0;
#P connect 5 0 2 0;
#P connect 5 1 4 0;
#P connect 2 1 4 0;
#P connect 4 0 3 1;
#P pop;

_____________________________________________

m a x i m i l i a n m a r c o l l

http://www.maximilianmarcoll.de


April 22, 2007 | 12:53 pm

or even shorter:

max v2;
#N vpatcher 161 222 862 648;
#P origin 261 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N counter 2 99;
#X flags 0 0;
#P newobj 238 149 68 196617 counter 2 99;
#P message 280 70 14 196617 2;
#N sfplay~ 2 120960 0 ;
#P newobj 160 131 89 196617 sfplay~ 2;
#P user gain~ 198 161 24 55 158 0 1.071519 7.94321 10.;
#P user ezdac~ 159 245 203 278 0;
#P user gain~ 160 161 24 55 158 0 1.071519 7.94321 10.;
#P window linecount 2;
#P message 37 98 247 196617 preload 2 1.wav , preload 3 2.wav ,
preload 4 3.wav , preload 5 4.wav , preload 6 5.wav , preload 7
6.wav;
#P connect 1 0 2 0;
#P fasten 5 0 4 0 285 126 165 126;
#P connect 6 0 4 0;
#P fasten 0 0 4 0 42 126 165 126;
#P connect 4 0 1 0;
#P connect 3 0 2 1;
#P connect 4 1 3 0;
#P connect 1 1 3 0;
#P connect 4 2 6 0;
#P connect 5 0 6 3;
#P pop;

_____________________________________________

m a x i m i l i a n m a r c o l l

http://www.maximilianmarcoll.de


April 22, 2007 | 2:21 pm

Emily Voegtlin schrieb:
> The concept of chaining the output bangs together seems to
> work fine for a few steps of the sequence, then breaks down.

Beside the fine solution Maximilian posted, you should know that the
problem was, that you didn’t preloaded/opened the files BEFORE you
started them. If the starting "1" arrives before the file had been
loaded with the open command, it would just fail. Opening and starting
in the same tick isn’t a good idea. It works sometimes, but not always…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com


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