Forums > MaxMSP

same note sustain in poly~

February 7, 2007 | 4:58 pm

I am using a combination of poly and poly~ to playback from a groove~ imbedded in a poly~ patch. I also have a release time section in the poly~ in the form of a line~ that ramps down the end volume of the sample being played back. The problem that I am having is that when I trigger the same MIDI note within the release time, the poly~ does not playback from a new patcher instance but instead routes it to the one that is already playing creating clicks and all sorts of ungood wierdness! The problem lies in poly alocating a voice number. I have tried delaying the MIDI note off message for as long as the sustain within poly~ but if I trigger the same note within this time it just dumps it out of the overflow output. All I want is that any identical MIDI notes triggered within the specified release time be assigned a different voice number than the one currently being played. Any ideas? Many thanks :)


February 7, 2007 | 5:39 pm

Why the need for poly and poly~? Maybe posting your patches would help. Also, you are prepending messages into poly~ with note or midinote and using thispoly~ to allocate voices I trust? Make sure voice stealing is not turned on. Also, I’ve found it easiest to pack all note info into a single list and send it into one input and then route things inside of poly~.

Quote: brokenman wrote on Wed, 07 February 2007 08:58
—————————————————-
> I am using a combination of poly and poly~
—————————————————-


February 7, 2007 | 6:56 pm

I’ve attached the poly~ abstraction here and the patch itself in the next message on this thread. you’ll need xgroove~ installed for it to work properly.


February 7, 2007 | 6:57 pm


February 7, 2007 | 11:31 pm

Sorry, the files don’t open for me when I download. Can you paste as text please?


February 8, 2007 | 12:20 pm

okay dokay: This is the abstraction:

max v2;
#N vpatcher 192 214 881 795;
#P origin -7 54;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 278 101 27 196617 t l b;
#N out 1;
#P newobj 403 526 33 196617 out 1;
#P newex 108 133 63 196617 prepend pos;
#N in 11;
#P newobj 108 112 33 196617 in 11;
#P newex 260 311 60 196617 loadmess 1;
#N in 10;
#P newobj 108 154 33 196617 in 10;
#P newex 321 449 28 196617 *~;
#N out~ 2;
#P newobj 321 497 39 196617 out~ 2;
#N in 9;
#P newobj 108 196 25 196617 in 9;
#P message 108 221 49 196617 xzone $1;
#N in 8;
#P newobj 109 244 25 196617 in 8;
#P message 109 266 41 196617 loop $1;
#N in 7;
#P newobj 109 288 25 196617 in 7;
#P newex 109 313 78 196617 prepend xshape;
#N in 6;
#P newobj 110 335 25 196617 in 6;
#P newex 110 359 72 196617 prepend xfade;
#P newex 223 313 27 196617 + 1;
#N in 5;
#P newobj 223 291 23 196617 in 5;
#P newex 223 335 38 196617 gate 2;
#P message 223 360 32 196617 pos 0;
#P message 194 360 25 196617 stop;
#P newex 194 261 48 196617 delay 0;
#P message 230 220 33 196617 start;
#P newex 194 175 46 196617 select 0;
#P button 230 199 15 0;
#P newex 278 173 29 196617 sig~;
#P newex 278 450 28 196617 *~;
#N out~ 1;
#P newobj 278 496 38 196617 out~ 1;
#P newex 403 501 51 196617 thispoly~;
#N in 4;
#P newobj 412 229 25 196617 in 4;
#P newex 505 345 43 196617 line~ 1.;
#P flonum 505 314 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 505 291 124 196617 expr pow($f1/127. \,4.);
#P message 459 315 30 196617 0 $1;
#P newex 459 266 56 196617 select 0;
#N in 3;
#P newobj 360 293 25 196617 in 3;
#N in 2;
#P newobj 319 293 25 196617 in 2;
#P newex 278 130 61 196617 unpack 0. 0;
#N in 1;
#P newobj 278 69 25 196617 in 1;
#P newex 278 407 92 196617 xgroove~ 2 one;
#B color 6;
#P connect 36 0 37 0;
#P connect 31 0 30 0;
#P connect 29 0 28 0;
#P connect 27 0 26 0;
#P connect 25 0 24 0;
#P fasten 2 1 16 0 334 168 199 168;
#P connect 16 0 18 0;
#P connect 18 0 19 0;
#P connect 22 0 23 0;
#P connect 35 0 21 0;
#P connect 23 0 21 0;
#P connect 21 0 20 0;
#P connect 16 1 15 0;
#P connect 15 0 17 0;
#P fasten 10 0 18 1 417 252 237 252;
#P fasten 18 0 21 1 199 283 256 283;
#P connect 1 0 39 0;
#P connect 39 0 2 0;
#P connect 2 0 14 0;
#P connect 34 0 0 0;
#P connect 28 0 0 0;
#P connect 20 0 0 0;
#P connect 19 0 0 0;
#P fasten 17 0 0 0 235 241 283 241;
#P connect 14 0 0 0;
#P connect 24 0 0 0;
#P connect 26 0 0 0;
#P connect 30 0 0 0;
#P connect 37 0 0 0;
#P connect 0 0 13 0;
#P connect 13 0 12 0;
#P fasten 9 0 13 1 510 438 301 438;
#P connect 3 0 0 1;
#P fasten 0 1 33 0 296 428 326 428;
#P connect 33 0 32 0;
#P fasten 9 0 33 1 510 438 344 438;
#P connect 4 0 0 2;
#P connect 13 0 11 0;
#P connect 33 0 11 0;
#P fasten 39 1 11 0 300 124 634 124 634 467 408 467;
#P connect 11 0 38 0;
#P fasten 2 1 5 0 334 206 464 206;
#P fasten 10 0 6 0 417 292 464 292;
#P connect 5 0 6 0;
#P connect 5 1 7 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P fasten 6 0 9 0 464 337 510 337;
#P pop;


February 8, 2007 | 12:21 pm

and this is the patch itself:

max v2;
#N vpatcher 177 67 759 799;
#P origin 98 171;
#P user ezdac~ 212 637 256 670 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 319 260 66 196617 loadmess 10;
#P message 396 261 43 196617 replace;
#B color 6;
#P newex 396 282 62 196617 buffer~ one;
#B color 6;
#P number 397 307 35 9 0 0 0 3 0 0 0 216 48 48 222 222 222 0 0 0;
#P number 443 599 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 355 453 14 196617 0;
#P newex 355 418 48 196617 loadbang;
#B color 1;
#P newex 463 518 27 196617 f;
#P message 463 542 65 196617 target 0 , $1;
#P newex 118 414 29 196617 gate;
#P newex 159 358 27 196617 t l b;
#P newex 118 223 27 196617 + 1;
#P newex 99 182 60 196617 loadmess 1;
#P newex 118 248 73 196617 gate 2;
#N comlet;
#P inlet 77 182 15 0;
#P newex 181 275 112 196617 expr $f1 – ($f1 + $f1);
#P newex 411 519 48 196617 loadbang;
#B color 1;
#P message 411 541 42 196617 set one;
#B color 1;
#N comlet xfade length;
#P inlet 383 455 15 0;
#P message 383 477 65 196617 target 0 , $1;
#N comlet loop mode;
#P inlet 355 479 15 0;
#P message 355 501 65 196617 target 0 , $1;
#N comlet xfading shape;
#P inlet 327 501 15 0;
#P message 327 523 65 196617 target 0 , $1;
#N comlet xfading mode;
#P inlet 299 524 15 0;
#P message 299 544 65 196617 target 0 , $1;
#P newex 290 456 60 196617 loadmess 0;
#N comlet release;
#P inlet 271 458 15 0;
#P message 271 480 65 196617 target 0 , $1;
#N comlet release;
#P inlet 243 468 15 0;
#P message 243 500 65 196617 target 0 , $1;
#N comlet loop end;
#P inlet 215 478 15 0;
#N comlet loop start;
#P inlet 187 510 15 0;
#P message 215 518 65 196617 target 0 , $1;
#P newex 159 570 295 196617 poly~ xgroove 32;
#B color 6;
#P message 187 535 65 196617 target 0 , $1;
#P message 159 454 85 196617 target $1 , $2 $3;
#P message 232 382 14 196617 0;
#P message 196 382 14 196617 1;
#P newex 196 418 27 196617 gate;
#P newex 232 314 60 196617 loadmess 1;
#B color 6;
#P number 232 334 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 159 310 55 196617 pack 0 0. 0;
#P newex 196 358 46 196617 select 1;
#B color 6;
#P flonum 181 225 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 181 202 40 196617 / 220.;
#P newex 159 42 71 196617 notein;
#P newex 159 136 78 196617 poly 32;
#P newex 181 176 31 196617 mtof;
#P comment 245 360 100 196617 < midi channel;
#P comment 435 309 100 196617 < release time;
#B color 6;
#P window linecount 8;
#P comment 319 138 208 196617 This is the section of my patch that I am having trouble with (you will need xgroove installed for the poly~ to work properly) . Having a release time of 10ms doesn’t seem to present too many problems but increase it to say 500ms and you’ll see what I meen! Thanks for taking the time to try and help me out :);
#P connect 37 0 40 0;
#P connect 40 0 38 0;
#P fasten 39 0 38 0 104 243 123 243;
#P fasten 37 0 42 0 82 305 123 305;
#P fasten 41 1 42 1 181 388 142 388;
#P connect 5 0 4 0;
#P connect 4 0 9 0;
#P connect 9 0 41 0;
#P connect 12 0 15 0;
#P connect 15 0 17 0;
#P connect 4 1 3 0;
#P connect 3 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 38 1;
#P connect 38 1 36 0;
#P connect 36 0 9 1;
#P connect 38 0 9 1;
#P connect 19 0 16 0;
#P connect 16 0 17 1;
#P fasten 5 2 8 0 224 348 201 348;
#P connect 8 0 13 0;
#P connect 13 0 12 0;
#P fasten 14 0 12 0 237 402 201 402;
#P connect 4 2 9 2;
#P connect 17 0 52 0;
#P fasten 41 0 12 1 164 412 218 412;
#P connect 20 0 18 0;
#P connect 18 0 17 2;
#P fasten 5 1 4 1 194 99 232 99;
#P connect 11 0 10 0;
#P connect 10 0 8 1;
#P connect 8 1 14 0;
#P connect 48 0 21 0;
#P connect 22 0 21 0;
#P connect 21 0 17 3;
#P connect 17 1 52 1;
#P connect 25 0 23 0;
#P connect 24 0 23 0;
#P connect 23 0 17 4;
#P connect 27 0 26 0;
#P connect 26 0 17 5;
#P connect 29 0 28 0;
#P connect 28 0 17 6;
#P connect 45 0 46 0;
#P connect 46 0 30 0;
#P connect 31 0 30 0;
#P connect 30 0 17 7;
#P connect 46 0 32 0;
#P connect 33 0 32 0;
#P connect 32 0 17 8;
#P connect 50 0 49 0;
#P connect 51 0 48 0;
#P connect 35 0 34 0;
#P connect 34 0 17 9;
#P fasten 43 0 17 10 468 562 444 562;
#P connect 17 2 47 0;
#P fasten 42 0 44 0 123 445 468 445;
#P connect 44 0 43 0;
#P fasten 20 0 44 1 220 497 485 497;
#P pop;


February 9, 2007 | 11:53 am

did that work?


February 9, 2007 | 6:28 pm

Quote: brokenman wrote on Fri, 09 February 2007 03:53
—————————————————-
> did that work?
—————————————————-

Sorry, finally just found time to install xgroove~ and take a look. The problem seems to be in the way you’re assigning voices out of poly. If I trigger the same note twice quickly with a long release time poly uses voice 1 for each trigger since it’s already received a noteoff message for the first one. It then sends that voice number twice to poly~ with the target message thereby negating the polyphonic goodness of poly~ and creating a retrigger to a new amplitude with a nice click. I made a small change using the midinote message to send the note data from poly to poly~ and now poly~ assigns new voices as long as the release ramp is still happening. I also had to move the mtof stuff into the poly~ abstraction because the midinote message wasn’t inputing the float playback speed for some reason. It was a quick and dirty fix but take a look and you should be able to make it cleaner….unless of course you’re still experiencing the problem and I missed it – in which case I’ve no idea. :)

—–the poly—–

max v2;
#N vpatcher 192 214 881 795;
#P origin -7 54;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 278 184 37 196617 abs 0.;
#P flonum 278 206 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 278 163 112 196617 expr $f1 – ($f1 + $f1);
#P flonum 278 145 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 278 122 40 196617 / 220.;
#P newex 278 101 31 196617 mtof;
#P window setfont Helvetica 9.;
#P flonum 397 102 35 9 0 0 0 21 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 340 101 35 9 0 0 0 21 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 278 51 27 196617 t l b;
#N out 1;
#P newobj 403 526 33 196617 out 1;
#P newex 108 133 63 196617 prepend pos;
#N in 11;
#P newobj 108 112 33 196617 in 11;
#P newex 260 311 60 196617 loadmess 1;
#N in 10;
#P newobj 108 154 33 196617 in 10;
#P newex 321 449 28 196617 *~;
#N out~ 2;
#P newobj 321 497 39 196617 out~ 2;
#N in 9;
#P newobj 108 196 25 196617 in 9;
#P message 108 221 49 196617 xzone $1;
#N in 8;
#P newobj 109 244 25 196617 in 8;
#P message 109 266 41 196617 loop $1;
#N in 7;
#P newobj 109 288 25 196617 in 7;
#P newex 109 313 78 196617 prepend xshape;
#N in 6;
#P newobj 110 335 25 196617 in 6;
#P newex 110 359 72 196617 prepend xfade;
#P newex 223 313 27 196617 + 1;
#N in 5;
#P newobj 223 291 23 196617 in 5;
#P newex 223 335 38 196617 gate 2;
#P message 223 360 32 196617 pos 0;
#P message 194 360 25 196617 stop;
#P newex 194 261 48 196617 delay 0;
#P message 230 220 33 196617 start;
#P newex 194 175 46 196617 select 0;
#P button 230 199 15 0;
#P newex 278 226 29 196617 sig~;
#P newex 278 450 28 196617 *~;
#N out~ 1;
#P newobj 278 496 38 196617 out~ 1;
#P newex 403 501 51 196617 thispoly~;
#N in 4;
#P newobj 412 229 25 196617 in 4;
#P newex 505 345 43 196617 line~ 1.;
#P flonum 505 314 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 505 291 124 196617 expr pow($f1/127. \,4.);
#P message 459 315 30 196617 0 $1;
#P newex 459 266 56 196617 select 0;
#N in 3;
#P newobj 360 293 25 196617 in 3;
#N in 2;
#P newobj 319 293 25 196617 in 2;
#P newex 278 78 61 196617 unpack 0. 0;
#N in 1;
#P newobj 278 19 25 196617 in 1;
#P newex 278 407 92 196617 xgroove~ 2 one;
#B color 6;
#P connect 36 0 37 0;
#P connect 31 0 30 0;
#P connect 29 0 28 0;
#P connect 27 0 26 0;
#P connect 25 0 24 0;
#P fasten 2 1 16 0 334 168 199 168;
#P connect 16 0 18 0;
#P connect 18 0 19 0;
#P connect 22 0 23 0;
#P connect 35 0 21 0;
#P connect 23 0 21 0;
#P connect 21 0 20 0;
#P connect 16 1 15 0;
#P connect 15 0 17 0;
#P fasten 10 0 18 1 417 252 237 252;
#P fasten 18 0 21 1 199 283 256 283;
#P connect 1 0 39 0;
#P connect 39 0 2 0;
#P connect 2 0 42 0;
#P connect 42 0 43 0;
#P connect 43 0 44 0;
#P connect 44 0 45 0;
#P connect 45 0 47 0;
#P connect 47 0 46 0;
#P connect 46 0 14 0;
#P connect 34 0 0 0;
#P connect 28 0 0 0;
#P connect 20 0 0 0;
#P connect 19 0 0 0;
#P fasten 17 0 0 0 235 247 283 247;
#P connect 14 0 0 0;
#P connect 24 0 0 0;
#P connect 26 0 0 0;
#P connect 30 0 0 0;
#P connect 37 0 0 0;
#P connect 0 0 13 0;
#P connect 13 0 12 0;
#P fasten 9 0 13 1 510 438 301 438;
#P connect 3 0 0 1;
#P fasten 0 1 33 0 296 428 326 428;
#P connect 33 0 32 0;
#P fasten 9 0 33 1 510 438 344 438;
#P connect 2 0 40 0;
#P connect 4 0 0 2;
#P connect 2 1 41 0;
#P connect 13 0 11 0;
#P connect 33 0 11 0;
#P fasten 39 1 11 0 300 75 634 75 634 467 408 467;
#P connect 11 0 38 0;
#P fasten 2 1 5 0 334 206 464 206;
#P fasten 10 0 6 0 417 292 464 292;
#P connect 5 0 6 0;
#P connect 5 1 7 0;
#P connect 7 0 8 0;
#P connect 8 0 9 0;
#P fasten 6 0 9 0 464 337 510 337;
#P pop;

——the player—–

max v2;
#N vpatcher 236 72 818 804;
#P origin 98 171;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 123 488 48 196617 pack 1 2;
#P newex 123 454 67 196617 unpack 1 2 3;
#P window setfont Helvetica 9.;
#P number 114 157 35 9 0 0 0 21 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 247 102 35 9 0 0 0 21 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 168 106 35 9 0 0 0 21 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 124 93 35 9 0 0 0 21 0 0 0 221 221 221 222 222 222 0 0 0;
#P user ezdac~ 212 637 256 670 0;
#P window setfont "Sans Serif" 9.;
#P newex 319 260 66 196617 loadmess 10;
#P message 396 261 43 196617 replace;
#B color 6;
#P newex 396 282 62 196617 buffer~ one;
#B color 6;
#P number 397 307 35 9 0 0 0 3 0 0 0 216 48 48 222 222 222 0 0 0;
#P number 443 599 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 355 453 14 196617 0;
#P newex 355 418 48 196617 loadbang;
#B color 1;
#P newex 463 518 27 196617 f;
#P message 463 542 65 196617 target 0 , $1;
#P newex 118 414 29 196617 gate;
#P newex 159 358 27 196617 t l b;
#P newex 118 223 27 196617 + 1;
#P newex 99 182 60 196617 loadmess 1;
#P newex 118 248 73 196617 gate 2;
#N comlet;
#P inlet 77 182 15 0;
#P newex 411 519 48 196617 loadbang;
#B color 1;
#P message 411 541 42 196617 set one;
#B color 1;
#N comlet xfade length;
#P inlet 383 455 15 0;
#P message 383 477 65 196617 target 0 , $1;
#N comlet loop mode;
#P inlet 355 479 15 0;
#P message 355 501 65 196617 target 0 , $1;
#N comlet xfading shape;
#P inlet 327 501 15 0;
#P message 327 523 65 196617 target 0 , $1;
#N comlet xfading mode;
#P inlet 299 524 15 0;
#P message 299 544 65 196617 target 0 , $1;
#P newex 290 456 60 196617 loadmess 0;
#N comlet release;
#P inlet 271 458 15 0;
#P message 271 480 65 196617 target 0 , $1;
#N comlet release;
#P inlet 243 468 15 0;
#P message 243 500 65 196617 target 0 , $1;
#N comlet loop end;
#P inlet 215 478 15 0;
#N comlet loop start;
#P inlet 187 510 15 0;
#P message 215 518 65 196617 target 0 , $1;
#P newex 159 570 295 196617 poly~ xgroove 32;
#B color 6;
#P message 187 535 65 196617 target 0 , $1;
#P message 98 535 78 196617 midinote $1 $2;
#P message 232 382 14 196617 0;
#P message 196 382 14 196617 1;
#P newex 196 418 27 196617 gate;
#P newex 232 314 60 196617 loadmess 1;
#B color 6;
#P number 232 334 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 159 310 57 196617 pack 0 0 0;
#P newex 196 358 46 196617 select 1;
#B color 6;
#P newex 159 42 71 196617 notein;
#P newex 159 136 78 196617 poly 32;
#P comment 245 360 100 196617 < midi channel;
#P comment 435 309 100 196617 < release time;
#B color 6;
#P window linecount 8;
#P comment 319 138 208 196617 This is the section of my patch that I am having trouble with (you will need xgroove installed for the poly~ to work properly) . Having a release time of 10ms doesn’t seem to present too many problems but increase it to say 500ms and you’ll see what I meen! Thanks for taking the time to try and help me out :);
#P connect 54 0 12 0;
#P connect 3 0 52 0;
#P connect 33 0 36 0;
#P fasten 35 0 34 0 104 243 123 243;
#P connect 36 0 34 0;
#P fasten 33 0 38 0 82 305 123 305;
#P connect 9 0 53 0;
#P connect 53 1 54 0;
#P connect 4 0 49 0;
#P fasten 37 1 38 1 181 388 142 388;
#P connect 4 0 3 0;
#P connect 3 0 6 0;
#P connect 6 0 37 0;
#P connect 12 0 14 0;
#P connect 53 2 54 1;
#P connect 4 1 50 0;
#P connect 3 1 34 1;
#P connect 34 1 6 1;
#P connect 34 0 6 1;
#P connect 16 0 13 0;
#P connect 13 0 14 1;
#P fasten 4 2 5 0 224 348 201 348;
#P connect 5 0 10 0;
#P fasten 11 0 9 0 237 402 201 402;
#P connect 10 0 9 0;
#P connect 3 2 6 2;
#P connect 14 0 48 0;
#P fasten 37 0 9 1 164 412 218 412;
#P connect 17 0 15 0;
#P connect 15 0 14 2;
#P fasten 4 1 3 1 194 99 232 99;
#P connect 8 0 7 0;
#P connect 7 0 5 1;
#P connect 5 1 11 0;
#P connect 19 0 18 0;
#P connect 44 0 18 0;
#P connect 18 0 14 3;
#P connect 14 1 48 1;
#P connect 4 2 51 0;
#P connect 21 0 20 0;
#P connect 22 0 20 0;
#P connect 20 0 14 4;
#P connect 24 0 23 0;
#P connect 23 0 14 5;
#P connect 26 0 25 0;
#P connect 25 0 14 6;
#P connect 41 0 42 0;
#P connect 42 0 27 0;
#P connect 28 0 27 0;
#P connect 27 0 14 7;
#P connect 30 0 29 0;
#P connect 42 0 29 0;
#P connect 29 0 14 8;
#P connect 46 0 45 0;
#P connect 47 0 44 0;
#P connect 32 0 31 0;
#P connect 31 0 14 9;
#P fasten 39 0 14 10 468 562 444 562;
#P connect 14 2 43 0;
#P fasten 38 0 40 0 123 445 468 445;
#P connect 40 0 39 0;
#P fasten 17 0 40 1 220 497 485 497;
#P pop;


February 10, 2007 | 12:42 pm

you are an excellent person! Thank you so much, that has saved me alot of headache!


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