Forums > MaxMSP

n00b: Stutterer device behaving erratically

March 24, 2008 | 4:41 pm

Hello,

I pasted the schematic of this stutterer device i’m working on below. To get it running just load a sound into the IO object and set it looping. Then activate the stutter toggle to hear what the effect does.

Here’s the difficulty i’m having: I have a groove object, and attached to its right outlet is a >~ comparison object. I’m using it to check to see if more than X % of the buffer has been played, and if so, a signal should be sent to turn off an envelope (because only a small part of the buffer should be played for any ‘grain’).

Sometimes this ‘off’ signal doesn’t get sent when i expect it to and the grain just keeps playing. I’m trying to figure out what’s causing this erratic behaviour. And i wondered if any of you guys might have an idea. Is it because important parts of my schematic use control signals when they should be using audio signals for greater accuracy?

I pasted the schematic below. And i’ve highlighted in red the areas where the trouble happens.

Thanks in advance to anyone who takes a look!

max v2;
#N vpatcher 153 63 749 744;
#P origin 129 -14;
#P window setfont "Sans Serif" 9.;
#P message 407 200 23 196617 0.4;
#P comment 166 54 162 196617 Load an audio file and loop it;
#P flonum 398 248 91 9 0. 0.04 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 341 89 90 196617 deceleration curve;
#N vpatcher 469 127 1069 527;
#P window setfont "Sans Serif" 9.;
#P message 181 236 14 196617 1;
#P newex 183 208 49 196617 delay 10;
#P newex 181 157 32 196617 sel 1;
#P outlet 202 312 15 0;
#P inlet 196 56 15 0;
#P connect 0 0 2 0;
#P connect 3 0 4 0;
#P connect 2 0 3 0;
#P connect 4 0 1 0;
#P connect 2 1 1 0;
#P pop 1;
#P newobj 47 326 110 196617 patcher delayedon_off;
#P button 279 256 15 0;
#P flonum 344 106 35 9 -1. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 417 67 1157 631;
#P window setfont "Sans Serif" 9.;
#P number 125 65 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N comlet curve (-1 .. 1);
#P inlet 267 34 15 0;
#P newex 168 174 65 196617 curve~;
#B color 5;
#P user number~ 128 228 167 243 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P button 153 105 15 0;
#P newex 168 123 46 196617 select 1;
#P newex 171 257 29 196617 gate;
#P newex 170 79 27 196617 t i i;
#P message 168 149 74 196617 15 , 500 3000;
#P newex 168 199 88 196617 train~ 200 0.75;
#B color 5;
#N comlet bangs;
#P outlet 171 306 15 0;
#N comlet boolean;
#P inlet 170 36 15 0;
#P connect 0 0 11 0;
#P connect 2 0 8 0;
#P connect 4 0 7 0;
#P connect 4 0 6 0;
#P connect 6 0 3 0;
#P connect 3 0 9 0;
#P connect 9 0 2 0;
#P connect 0 0 4 0;
#P fasten 4 1 5 0 393 96 393 233 176 233;
#P connect 5 0 1 0;
#P connect 2 1 5 1;
#P connect 10 0 9 2;
#P pop 1;
#P newobj 279 204 75 196617 patcher zipper;
#P button 547 136 15 0;
#N vpatcher 288 44 1053 716;
#P origin 0 -61;
#P window setfont "Sans Serif" 9.;
#P window linecount 3;
#P comment 324 198 100 196617 plays ‘grains’ from the buffer;
#P user waveform~ 512 557 200 74 3 9;
#W mode select;
#W mouseoutput continuous;
#W unit ms;
#W grid 1000.;
#W ticks 0;
#W labels 1;
#W vlabels 0;
#W vticks 1;
#W bpm 120. 4.;
#W frgb 33 0 0;
#W brgb 60 178 173;
#W rgb2 0 95 255;
#W rgb3 0 0 0;
#W rgb4 0 0 0;
#W rgb5 190 137 255;
#W rgb6 100 100 100;
#W rgb7 100 100 100;
#P window linecount 1;
#N vpatcher 597 320 1197 720;
#P button 214 145 15 0;
#P button 118 143 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 130 106 55 196617 select 0 1;
#P message 192 176 63 196617 0 0 0 , 1 0 1;
#P message 130 176 60 196617 0 0 1 , 1 0 0;
#N comlet loadbang;
#P inlet 262 31 15 0;
#N comlet stutter bool;
#P inlet 128 36 15 0;
#P outlet 129 272 15 0;
#P connect 5 0 6 0;
#P connect 4 0 0 0;
#P connect 3 0 0 0;
#P connect 1 0 5 0;
#P fasten 5 0 3 0 135 149 135 149;
#P connect 2 0 3 0;
#P fasten 5 1 4 0 157 149 197 149;
#P connect 5 1 7 0;
#P pop 1;
#P newobj 70 313 80 196617 patcher drywet;
#P window linecount 2;
#P comment 644 81 44 196617 loadbang;
#P window linecount 1;
#P comment 305 90 44 196617 bangs;
#P window linecount 0;
#N vpatcher 494 126 1295 684;
#P origin 0 7;
#P window setfont "Sans Serif" 9.;
#P newex 584 368 55 196617 snapshot~;
#P user number~ 344 389 372 404 9 3 3 2 0. 0. 0 0. 20 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 343 357 39 196617 >~ 0.1;
#P message 23 215 14 196617 1;
#P newex 23 240 29 196617 sig~;
#P message 42 286 14 196617 0;
#P window linecount 1;
#P newex 23 318 82 196617 groove~ mybuff;
#B color 5;
#P newex 346 415 40 196617 change;
#P button 321 454 15 0;
#P button 153 82 15 0;
#P user meter~ 37 357 117 370 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 276 218 356 231 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P user meter~ 216 528 296 541 50 0 168 0 103 103 103 255 153 0 255 0 0 217 217 0 153 186 0 12 3 3 3 3;
#P message 319 101 14 196617 1;
#P window linecount 0;
#P newex 345 436 46 196617 select 1;
#P window linecount 1;
#P comment 662 13 56 196617 loadbang;
#P comment 528 12 56 196617 grain len;
#P window linecount 0;
#P newex 238 218 30 196617 t b b;
#P message 300 101 14 196617 5;
#P window linecount 1;
#P message 202 133 67 196617 retrigger 10;
#P message 133 134 14 196617 0;
#P message 153 106 23 196617 1.;
#P newex 201 500 27 196617 *~;
#P newex 202 194 66 196617 adsr~;
#P flonum 546 306 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 4;
#P comment 330 281 100 196617 if we’ve played more that x % of the buffer , turn the env off (the grain has ended).;
#N comlet loadbang;
#P inlet 677 27 15 0;
#N comlet grain len;
#P inlet 546 27 15 0;
#P outlet 201 561 15 0;
#N comlet bangs;
#P inlet 153 33 15 0;
#P window linecount 0;
#P comment 141 19 56 196617 bangs;
#P comment 394 364 100 196617 Once in a while , a grain is not turned off but i’m not sure why.;
#P user panel 301 329 133 142;
#X brgb 255 9 14;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 6 0 29 0 682 66 28 66;
#P connect 29 0 28 0;
#P connect 28 0 26 0;
#P connect 27 0 26 0;
#P connect 26 0 22 0;
#P fasten 15 1 27 0 263 281 47 281;
#P fasten 18 0 12 0 8 453 8 124 138 124;
#P connect 3 0 23 0;
#P connect 3 0 11 0;
#P connect 9 0 10 0;
#P connect 10 0 4 0;
#P fasten 6 0 13 0 682 66 207 66;
#P connect 11 0 9 0;
#P connect 12 0 9 0;
#P connect 13 0 9 0;
#P connect 14 0 9 1;
#P connect 10 0 20 0;
#P fasten 26 0 10 1 28 469 223 469;
#P connect 9 2 15 0;
#P connect 19 0 9 3;
#P connect 14 0 9 4;
#P connect 9 0 21 0;
#P fasten 6 0 14 0 682 66 305 66;
#P fasten 6 0 19 0 682 66 324 66;
#P connect 18 0 24 0;
#P fasten 26 1 30 0 100 346 348 346;
#P connect 30 0 31 0;
#P connect 25 0 18 0;
#P connect 31 1 25 0;
#P fasten 8 0 30 1 551 339 377 339;
#P fasten 15 0 8 0 243 269 551 269;
#P connect 5 0 8 0;
#P pop;
#P newobj 313 176 76 196617 patcher player;
#P window linecount 1;
#P comment 447 86 44 196617 grainlength;
#P comment 17 82 29 196617 in;
#P message 242 173 14 196617 0;
#N comlet grain lenth;
#P inlet 451 117 15 0;
#N comlet record bool;
#P inlet 203 106 15 0;
#P message 483 476 34 196617 1000;
#P newex 512 524 106 196617 buffer~ mybuff 1000;
#P user number~ 415 548 454 563 9 3 3 2 0. 0. 0 0. 50 0. 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 70 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 414 525 81 196617 record~ mybuff;
#N comlet bangs;
#P inlet 313 117 15 0;
#N comlet audio in;
#P inlet 31 108 15 0;
#N comlet loadbang;
#P inlet 657 101 15 0;
#P outlet 102 608 15 0;
#N comlet stutter bool;
#P inlet 70 107 15 0;
#P newex 101 565 78 196617 matrix~ 2 1 0.;
#P window linecount 0;
#P comment 69 83 39 196617 stutter;
#P comment 193 83 44 196617 record;
#P comment 79 268 100 196617 controls the switch between dry and effected signals;
#P user panel 297 160 117 46;
#X brgb 198 0 5;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 5 0 11 0;
#P connect 5 0 23 0;
#P fasten 23 0 4 0 75 499 106 499;
#P fasten 8 0 4 0 36 499 106 499;
#P connect 4 0 6 0;
#P fasten 7 0 23 1 662 301 145 301;
#P fasten 20 0 4 1 318 492 174 492;
#P connect 15 0 17 0;
#P connect 9 0 20 0;
#P connect 16 0 20 1;
#P connect 7 0 20 2;
#P fasten 8 0 10 0 36 499 419 499;
#P fasten 15 0 10 0 208 483 419 483;
#P connect 10 0 12 0;
#P fasten 17 0 10 1 247 473 454 473;
#P fasten 7 0 14 0 662 448 488 448;
#P connect 14 0 10 2;
#P connect 13 1 24 0;
#P pop;
#P newobj 228 526 98 196617 patcher bufferwrap;
#B color 7;
#P toggle 5 75 15 0;
#P newex 213 73 27 196617 io;
#P user ezdac~ 213 583 257 616 0;
#P newex 398 161 32 196617 sel 1;
#P user pictctrl 47 86 31 30 purplebutton.pict 31 0 1 0 2 0 1 0 21 21 128 0 1 1 1 0 1 270;
#P newex 547 169 45 196617 loadbang;
#P comment 4 55 49 196617 Stutter;
#P comment 150 487 282 196617 audio , stutterbool , record bool , bangs , grain length , loadbang;
#P comment 405 231 100 196617 grain len;
#P user panel 200 507 168 53;
#X brgb 218 14 19;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 9 0 5 0;
#P connect 5 0 15 0;
#P connect 10 0 7 0;
#P fasten 8 0 10 0 218 391 233 391;
#P connect 15 0 10 1;
#P connect 10 0 7 1;
#P connect 5 0 10 2;
#P fasten 5 0 12 0 52 134 284 134;
#P connect 12 0 14 0;
#P fasten 12 0 10 3 284 483 284 483;
#P connect 17 0 10 4;
#P connect 4 0 10 5;
#P connect 13 0 12 1;
#P fasten 5 0 6 0 52 134 403 134;
#P connect 19 0 17 0;
#P connect 6 0 17 0;
#P fasten 4 0 19 0 552 193 412 193;
#P connect 11 0 4 0;
#P pop;


March 24, 2008 | 10:42 pm

Hi! I’ve looked at your patch, because I wanted to do what you have done with your patch. I’m not even a beginner in max, and this is quite complicated.

Just a "random" thought after looking your patch (not random, but just a feeling because I don’t know much hehe). With the effect on, the problem might be in the [player] patch, between the out of the adsr and the bangs it receives. The bang is constant, even when the grain isn’t turned of, so you have more or less a zone to work.

I’m sorry I can’t help you, but It would be great if you can solve this. Let us know when that happens, this is a wonderful patch!! Good luck ;)


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