Forums > MaxMSP

Sending "seek" times to sfplay within poly~

December 7, 2007 | 9:04 pm

I am trying to trigger sfplay within poly~ using seek times. Here are two examples. Times are packed into seek and sent to sfplay, which works. The second example, I have been playing around with different pack options even using note, midinote, and target with no luck. Notice on the second example that there are no errors in the "Max" window. Thanks you for your time,
Fletcher

NOTE: Below are two seperate files, the first should be saved as "SimplePoly01.pat" as this patch is used within the second patch of text below.

Poly Abtraction:

max v2;
#N vpatcher 364 44 677 450;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#N in 2;
#P newobj 169 29 28 196617 in 2;
#P newex 233 177 48 196617 loadbang;
#P message 223 263 54 196617 mute 0 , 1;
#P newex 156 310 52 196617 thispoly~;
#P message 156 263 54 196617 mute 1 , 0;
#N out 2;
#P newobj 201 352 33 196617 out 2;
#N out 1;
#P newobj 156 352 33 196617 out 1;
#N in 1;
#P newobj 98 29 25 196617 in 1;
#P newex 98 54 49 196617 unpack 0;
#N out~ 2;
#P newobj 85 352 39 196617 out~ 2;
#N out~ 1;
#P newobj 39 352 39 196617 out~ 1;
#P message 9 56 28 196617 open;
#N sfplay~ List 2 120960 0 ;
#P newobj 44 177 48 196617 sfplay~ 2;
#P connect 0 0 2 0;
#P connect 4 0 0 0;
#P connect 1 0 0 0;
#P connect 12 0 0 0;
#P connect 0 1 3 0;
#P connect 5 0 4 0;
#P connect 11 0 8 0;
#P fasten 0 2 8 0 87 214 161 214;
#P connect 8 0 9 0;
#P fasten 10 0 9 0 228 290 161 290;
#P connect 9 0 6 0;
#P connect 4 0 10 0;
#P pop;

Patch:

max v2;
#N vpatcher 3 44 363 636;
#P window setfont "Sans Serif" 9.;
#P comment 186 66 52 196617 Sart –>;
#P comment 230 546 100 196617 Adjust Start Time;
#P comment 14 546 100 196617 Adjust Start Time;
#P comment 128 537 98 196617 Last Preset = Stop;
#P comment 230 510 100 196617 Load Sample in Poly;
#P comment 230 528 100 196617 Use Preset # 2;
#N vpreset 8;
#X append 1 2 9 66 239 number int 0 ; 11 66 280 number int 0 ; 12 213 240 gain~ list 0 500. ; 14 213 276 gain~ list 0 500. ; 19 426 186 toggle int 0 ; 25 66 69;
#X append 1 2 number int 24 ; 27 66 110 number int 571 ; 28 213 69 gain~ list 113 500. ; 30 213 105 gain~ list 113 500. ; 35 426 14 toggle int 1 ;;
#X append 2 2 9 66 239 number int 13 ; 11 66 280 number int 608 ; 12 213 240 gain~ list 105 500. ; 14 213 276 gain~ list 105 500. ; 19 426 186 toggle int 1 ; 25 66 69;
#X append 2 2 number int 0 ; 27 66 110 number int 0 ; 28 213 69 gain~ list 0 500. ; 30 213 105 gain~ list 0 500. ; 35 426 14 toggle int 0 ;;
#X append 8 2 9 66 239 number int 0 ; 11 66 280 number int 0 ; 12 213 240 gain~ list 0 500. ; 14 213 276 gain~ list 0 500. ; 19 426 186 toggle int 0 ; 25 66 69;
#X append 8 2 number int 0 ; 27 66 110 number int 0 ; 28 213 69 gain~ list 0 500. ; 30 213 105 gain~ list 0 500. ; 35 426 14 toggle int 0 ;;
#P preset 146 505 47 27;
#P comment 201 27 125 196617 Not Working Seek – Poly;
#P message 14 129 30 196617 open;
#N sfplay~ 2 120960 0 ;
#P newobj 69 176 84 196617 sfplay~ 2;
#P newex 14 356 40 196617 key;
#B color 5;
#P newex 14 378 51 196617 select 32;
#P toggle 14 426 15 0;
#P message 37 426 27 196617 stop;
#P message 36 402 31 196617 start;
#P newex 69 466 28 196617 dac~;
#P user meter~ 123 213 136 439 50 68 0 150 0 0 0 191 202 255 255 255 255 163 141 255 89 0 248 12 3 3 3 3;
#P user gain~ 105 213 14 204 158 1 1.071519 7.94321 500.;
#P user meter~ 87 213 100 439 50 68 0 150 0 0 0 191 202 255 255 255 255 163 141 255 89 0 248 12 3 3 3 3;
#P user gain~ 69 213 14 204 158 1 1.071519 7.94321 500.;
#P number 110 66 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 69 89 44 196617 pack 0 0;
#P number 69 66 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 69 129 68 196617 seek $1 $2;
#N vpatcher 364 256 926 636;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 301 209 61 196617 Bypass? –>;
#P window setfont "Sans Serif" 12.;
#P newex 473 316 39 196620 s b01;
#P window setfont "Sans Serif" 9.;
#P message 319 321 147 196617 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
#P newex 473 281 62 196617 prepend set;
#P newex 430 142 48 196617 loadbang;
#P number 457 171 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 430 171 15 0;
#P newex 430 192 37 196617 metro;
#P message 430 214 58 196617 busymap 2;
#P newex 365 247 120 196617 poly~ SimplePoly01 16;
#P message 365 215 59 196617 note $1 $2;
#P outlet 401 281 15 0;
#P outlet 365 281 15 0;
#P comment 370 32 100 196617 Seek Poly Setup;
#P window setfont "Sans Serif" 12.;
#P newex 185 316 39 196620 s b01;
#P window setfont "Sans Serif" 9.;
#P message 31 321 147 196617 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
#P newex 185 281 62 196617 prepend set;
#P newex 142 142 48 196617 loadbang;
#P number 169 171 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 142 171 15 0;
#P newex 142 192 37 196617 metro;
#P message 142 214 58 196617 busymap 2;
#P newex 77 247 120 196617 poly~ SimplePoly01 16;
#P message 77 215 59 196617 note $1 $2;
#P newex 77 88 51 196617 stripnote;
#P newex 77 182 51 196617 pack 0 0;
#P outlet 113 281 15 0;
#P outlet 77 281 15 0;
#N comlet Velocity In;
#P inlet 118 61 15 0;
#N comlet Pitch In;
#P inlet 77 61 15 0;
#P comment 71 32 100 196617 Normal Poly Setup;
#P window linecount 0;
#P comment 10 83 66 196617 Bypassed –>;
#P user panel 294 52 247 304;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 7 52 246 304;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 17 0 18 0 190 310 36 310;
#P connect 9 0 8 0;
#P connect 8 0 10 0;
#P connect 10 0 11 0;
#P fasten 12 0 11 0 147 237 82 237;
#P connect 11 0 6 0;
#P connect 11 1 7 0;
#P connect 9 1 8 1;
#P connect 16 0 14 0;
#P connect 14 0 13 0;
#P connect 13 0 12 0;
#P connect 15 0 13 1;
#P connect 11 3 17 0;
#P connect 17 0 19 0;
#P fasten 30 0 31 0 478 310 324 310;
#P fasten 4 0 24 0 82 83 344 83 344 237 370 237;
#P fasten 25 0 24 0 435 237 370 237;
#P connect 23 0 24 0;
#P connect 24 0 21 0;
#P connect 24 1 22 0;
#P connect 29 0 27 0;
#P connect 27 0 26 0;
#P connect 26 0 25 0;
#P connect 28 0 26 1;
#P connect 24 3 30 0;
#P connect 30 0 32 0;
#P pop;
#P newobj 239 176 61 196617 p simplepoly;
#P message 186 129 30 196617 open;
#P newex 186 356 40 196617 key;
#B color 5;
#P newex 186 378 51 196617 select 32;
#P toggle 186 426 15 0;
#P message 208 426 27 196617 stop;
#P message 207 402 31 196617 start;
#P newex 240 466 28 196617 dac~;
#P user meter~ 294 213 307 439 50 68 0 150 0 0 0 191 202 255 255 255 255 163 141 255 89 0 248 12 3 3 3 3;
#P user gain~ 276 213 14 204 158 1 1.071519 7.94321 500.;
#P user meter~ 258 213 271 439 50 68 0 150 0 0 0 191 202 255 255 255 255 163 141 255 89 0 248 12 3 3 3 3;
#P user gain~ 240 213 14 204 158 1 1.071519 7.94321 500.;
#P number 280 66 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 239 89 44 196617 pack 0 0;
#P number 239 66 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 239 129 68 196617 seek $1 $2;
#P comment 27 27 111 196617 Working Seek – No Poly;
#P comment 14 510 100 196617 Load Sample Above;
#P comment 14 528 100 196617 Use Preset # 1;
#P user panel 7 505 113 63;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 223 505 113 63;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P comment 14 66 52 196617 Sart –>;
#P user panel 7 49 155 450;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 181 49 155 450;
#X brgb 191 191 191;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 37 0 36 0;
#P connect 36 0 35 0;
#P connect 25 0 26 0;
#P connect 26 0 24 0;
#P fasten 39 0 38 0 19 172 74 172;
#P connect 24 0 38 0;
#P fasten 38 0 28 0 74 202 74 202;
#P connect 33 0 32 0;
#P connect 34 0 32 0;
#P connect 35 0 32 0;
#P connect 28 0 32 0;
#P hidden connect 28 0 29 0;
#P connect 30 0 32 1;
#P connect 27 0 26 1;
#P hidden connect 28 1 30 0;
#P connect 38 1 30 0;
#P hidden connect 30 0 31 0;
#P connect 21 0 20 0;
#P connect 20 0 19 0;
#P connect 9 0 10 0;
#P connect 10 0 8 0;
#P connect 8 0 23 0;
#P fasten 23 2 12 0 278 200 245 200;
#P connect 17 0 16 0;
#P connect 18 0 16 0;
#P connect 19 0 16 0;
#P connect 12 0 16 0;
#P hidden connect 12 0 13 0;
#P connect 14 0 16 1;
#P connect 11 0 10 1;
#P fasten 23 3 14 0 295 200 281 200;
#P hidden connect 12 1 14 0;
#P hidden connect 14 0 15 0;
#P pop;


December 8, 2007 | 3:24 am

Update:
I removed an unnecessary? pack in the poly~ abstraction as well as added a global "open" which does so for all 16 voices. No errors in Max windows so I am not sure where to go next. I am going to start experimenting with bangs into poly~ (would that be necessary since there is no note on/off messages?) I am attaching a zip file with both patches if that is easier than all of the text. Thanks for your time!
Fletcher


December 11, 2007 | 5:25 pm

A better title may be "Controlling poly~ using "seek" times into sfplay~"

Any avenues I could pursue would be greatly appreciated.

Fletcher


December 11, 2007 | 7:14 pm

you need to send the "target n" message to your poly, replacing n with the voice number you want to send the seek message to.
also, it looks like you are muting the voice at loadbang, but you never unmute the voice when you receive the seek message.


December 12, 2007 | 12:26 am

Thanks for the reply Rob! I actually got this baby working by packing the times into a "prepend note" into Poly~ (Thanks Dr. Mikel Kuehn at Bowling Green for also pointing out my stupid mistake with the mute and giving me the prepend note and prepend seek ideas.) I have attached a working version!

A side note concerning presets: I actually had this thing setup right a couple of times but what was throwing me off and leading me to try all kinds of different versions was using the preset. I guess the preset turned on the seek times before the dac~. This then led to the buffer getting full but never playing. I only figured it out accidentally by opening another poly patch I made and playing it, then all of the sudden the buffers (all 16) came blowing out!

Fletcher


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