#N canvas 330 49 927 598 12;
#X floatatom 35 96 5 0 0 0 - - - 0;
#X obj 81 486 tabwrite~ \$0-graph;
#X obj 107 455 metro 500;
#X obj 107 414 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X floatatom 116 179 5 0 10000 0 - - - 0;
#X floatatom 152 206 5 0 10000 0 - - - 0;
#X floatatom 224 289 5 0 10000 0 - - - 0;
#X msg 83 153 set 0;
#X obj 224 312 / 100;
#X obj 152 229 / 100;
#X text 158 179 cutoff frequency in linear region;
#X floatatom 188 256 5 0 10000 0 - - - 0;
#X text 231 246 asymptotic downward cutoff frequency (for downward slews greater than maximum), f 41;
#X text 305 332 asymptotic upward cutoff frequency (for upward slews greater than maximum), f 40;
#X floatatom 260 343 5 0 10000 0 - - - 0;
#X text 76 96 frequency of test oscillator;
#N canvas 477 38 964 672 compander-limiter 0;
#N canvas 622 189 476 482 generate-test 0;
#X obj 77 159 osc~ 440;
#X obj 197 162 line~;
#X msg 197 136 1 \, 0 500;
#X msg 130 125 -0.25;
#X obj 197 196 *~;
#X obj 78 256 *~;
#X obj 78 365 outlet~;
#X obj 178 299 tabwrite~ \$0-test-in;
#X obj 178 70 r \$0-testpulse;
#X connect 0 0 5 0;
#X connect 1 0 4 0;
#X connect 1 0 4 1;
#X connect 2 0 1 0;
#X connect 3 0 0 1;
#X connect 4 0 5 1;
#X connect 5 0 6 0;
#X connect 5 0 7 0;
#X connect 8 0 7 0;
#X connect 8 0 3 0;
#X connect 8 0 2 0;
#X restore 221 64 pd generate-test;
#X obj 88 99 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 88 126 metro 500;
#X obj 88 156 s \$0-testpulse;
#N canvas 323 324 347 253 resize 0;
#X obj 83 52 inlet;
#X msg 83 79 resize \$1;
#X obj 105 109 s \$0-test-in;
#X obj 98 141 s \$0-slop-out;
#X obj 83 168 s \$0-compander-out;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 1 0 3 0;
#X connect 1 0 4 0;
#X restore 607 610 pd resize;
#X msg 624 579 20000;
#N canvas 455 38 698 690 parameters 0;
#X obj 191 14 inlet;
#X obj 29 32 r \$0-limit;
#X obj 37 55 r \$0-knee;
#X obj 45 78 r \$0-boost;
#X obj 61 122 r \$0-thresh;
#X obj 54 100 r \$0-ratio;
#X obj 29 158 t b b;
#X obj 29 208 until;
#X obj 87 235 + 1;
#X msg 78 205 0;
#X obj 96 649 tabwrite \$0-dynamic-curve, f 52;
#X obj 472 427 moses;
#X obj 543 377 r \$0-thresh;
#X obj 605 414 r \$0-ratio;
#X obj 605 441 f;
#X obj 605 466 / 100;
#X obj 96 595 +;
#X msg 504 453 0;
#X obj 482 520 expr ($f1-$f2)*$f3;
#X obj 96 620 max 0;
#X obj 605 491 - 1;
#X obj 29 318 +;
#X obj 47 294 r \$0-boost;
#X obj 137 294 r \$0-limit;
#X obj 119 327 f;
#X obj 137 352 -;
#X obj 29 344 t f b;
#X obj 271 294 r \$0-knee;
#X obj 182 420 +;
#X obj 61 394 -;
#X obj 29 421 moses;
#X obj 96 451 moses;
#X obj 123 515 b;
#X obj 359 448 r \$0-limit;
#X obj 143 548 f;
#X obj 96 483 expr $f4 - ($f2-$f1)*($f2-$f1)/(4*$f3);
#X obj 51 462 +;
#X msg 29 183 102;
#X obj 271 320 f;
#X obj 271 345 / 2;
#X obj 155 327 r \$0-boost;
#X obj 86 419 r \$0-boost;
#X obj 29 266 trigger float float, f 61;
#X obj 161 514 r \$0-limit;
#X obj 29 233 float;
#X obj 191 49 unpack f f f f f f;
#N canvas 92 344 334 253 set-speed 0;
#X msg 115 81 set \$1;
#X obj 95 43 inlet;
#X obj 115 111 s \$0-speed-set;
#X obj 96 154 s \$0-speed;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 1 0 3 0;
#X restore 314 76 pd set-speed;
#N canvas 416 159 334 253 set-thresh 0;
#X msg 115 81 set \$1;
#X obj 95 43 inlet;
#X obj 115 111 s \$0-thresh-set;
#X obj 96 154 s \$0-thresh;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 1 0 3 0;
#X restore 289 103 pd set-thresh;
#N canvas 416 159 334 253 set-ratio 0;
#X msg 115 81 set \$1;
#X obj 95 43 inlet;
#X obj 115 111 s \$0-ratio-set;
#X obj 96 154 s \$0-ratio;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 1 0 3 0;
#X restore 264 129 pd set-ratio;
#N canvas 416 159 334 253 set-boost 0;
#X msg 115 81 set \$1;
#X obj 95 43 inlet;
#X obj 115 111 s \$0-boost-set;
#X obj 96 154 s \$0-boost;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 1 0 3 0;
#X restore 240 156 pd set-boost;
#N canvas 416 159 334 253 set-knee 0;
#X msg 115 81 set \$1;
#X obj 95 43 inlet;
#X obj 115 111 s \$0-knee-set;
#X obj 96 154 s \$0-knee;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 1 0 3 0;
#X restore 215 180 pd set-knee;
#N canvas 416 159 334 253 set-limit 0;
#X msg 115 81 set \$1;
#X obj 95 43 inlet;
#X obj 115 111 s \$0-limit-set;
#X obj 96 154 s \$0-limit;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 1 0 3 0;
#X restore 191 204 pd set-limit;
#X connect 0 0 45 0;
#X connect 1 0 6 0;
#X connect 2 0 6 0;
#X connect 3 0 6 0;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 6 0 37 0;
#X connect 6 1 9 0;
#X connect 7 0 44 0;
#X connect 8 0 44 1;
#X connect 9 0 44 1;
#X connect 11 0 18 0;
#X connect 11 1 17 0;
#X connect 12 0 11 1;
#X connect 12 0 18 1;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 20 0;
#X connect 16 0 19 0;
#X connect 17 0 16 1;
#X connect 18 0 16 1;
#X connect 19 0 10 0;
#X connect 20 0 18 2;
#X connect 21 0 26 0;
#X connect 22 0 21 1;
#X connect 23 0 24 1;
#X connect 24 0 25 0;
#X connect 25 0 28 0;
#X connect 25 0 29 0;
#X connect 26 0 30 0;
#X connect 26 1 24 0;
#X connect 27 0 38 0;
#X connect 28 0 31 1;
#X connect 28 0 35 1;
#X connect 29 0 30 1;
#X connect 30 0 36 0;
#X connect 30 1 31 0;
#X connect 31 0 35 0;
#X connect 31 1 32 0;
#X connect 32 0 34 0;
#X connect 33 0 35 3;
#X connect 34 0 16 0;
#X connect 35 0 16 0;
#X connect 36 0 16 0;
#X connect 37 0 7 0;
#X connect 38 0 39 0;
#X connect 39 0 29 1;
#X connect 39 0 28 1;
#X connect 39 0 35 2;
#X connect 40 0 25 1;
#X connect 41 0 36 1;
#X connect 42 0 21 0;
#X connect 42 1 10 1;
#X connect 42 1 11 0;
#X connect 43 0 34 1;
#X connect 44 0 8 0;
#X connect 44 0 42 0;
#X connect 45 0 51 0;
#X connect 45 1 50 0;
#X connect 45 2 49 0;
#X connect 45 3 48 0;
#X connect 45 4 47 0;
#X connect 45 5 46 0;
#X restore 719 530 pd parameters;
#X floatatom 618 340 4 0 100 0 limit \$0-limit-set \$0-limit 0;
#X floatatom 618 361 4 0 20 0 knee \$0-knee-set \$0-knee 0;
#X floatatom 618 382 4 0 50 0 boost \$0-boost-set \$0-boost 0;
#X floatatom 618 403 4 0 200 0 ratio \$0-ratio-set \$0-ratio 0;
#X floatatom 618 425 4 0 100 0 thresh \$0-thresh-set \$0-thresh 0;
#X floatatom 618 446 4 0 200 0 speed \$0-speed-set \$0-speed 0;
#N canvas 403 113 573 630 run-compander 0;
#X obj 47 20 inlet~;
#X obj 83 174 slop~ 0 0 0 0 1e+09;
#X obj 161 112 r \$0-speed;
#X obj 343 231 r \$0-testpulse;
#X obj 357 289 tabwrite~ \$0-slop-out;
#X obj 83 142 abs~;
#X obj 97 278 tabread4~ \$0-dynamic-curve;
#X obj 65 328 -~;
#X obj 65 353 +~ 100;
#X obj 65 378 dbtorms~;
#X obj 83 246 rmstodb~;
#X obj 47 428 *~;
#X obj 47 563 outlet~;
#X obj 343 517 tabwrite~ \$0-compander-out;
#X text 231 167 same envelope follower as in the peak meter example, f 26;
#X text 130 322 "correct" the level by applying a gain calculated from the difference between the measured and desired level, f 27;
#X floatatom 161 138 5 0 0 0 - - - 0;
#X text 203 139 hz;
#X connect 0 0 5 0;
#X connect 0 0 11 0;
#X connect 1 0 4 0;
#X connect 1 0 10 0;
#X connect 2 0 16 0;
#X connect 3 0 4 0;
#X connect 3 0 13 0;
#X connect 5 0 1 0;
#X connect 6 0 7 0;
#X connect 7 0 8 0;
#X connect 8 0 9 0;
#X connect 9 0 11 1;
#X connect 10 0 7 1;
#X connect 10 0 6 0;
#X connect 11 0 12 0;
#X connect 11 0 13 0;
#X connect 16 0 1 3;
#X restore 221 149 pd run-compander;
#X msg 616 551 2000;
#X msg 607 525 300;
#X text 827 367 no change;
#X text 835 397 limit;
#X text 868 422 expand;
#X text 868 452 compress;
#X text 872 480 noise gate;
#N canvas 601 360 267 339 (subpatch) 0;
#X obj 108 109 hsl 100 15 0 1 0 0 empty empty Volume 32 9 0 12 #dcdcdc #000000 #000000 0 1;
#X obj 87 43 inlet~;
#X obj 105 148 pow 4;
#X obj 105 199 line~;
#X msg 105 173 \$1 10;
#X obj 87 226 *~;
#X obj 87 257 dac~;
#X connect 0 0 2 0;
#X connect 1 0 5 0;
#X connect 2 0 4 0;
#X connect 3 0 5 1;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 5 0 6 1;
#X coords 0 -1 1 1 116 32 2 100 100;
#X restore 245 100 pd;
#N canvas 601 360 267 339 (subpatch) 0;
#X obj 108 109 hsl 100 15 0 1 0 0 empty empty Volume 32 9 0 12 #dcdcdc #000000 #000000 0 1;
#X obj 87 43 inlet~;
#X obj 105 148 pow 4;
#X obj 105 199 line~;
#X msg 105 173 \$1 10;
#X obj 87 226 *~;
#X obj 87 257 dac~;
#X connect 0 0 2 0;
#X connect 1 0 5 0;
#X connect 2 0 4 0;
#X connect 3 0 5 1;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 5 0 6 1;
#X coords 0 -1 1 1 116 32 2 100 100;
#X restore 221 186 pd;
#X text 440 47 See the HTML documentation (link on main page of this patch) for details.;
#X obj 710 339 loadbang;
#X text 36 22 Using [slop~] to make a compressor/expander/limiter;
#X msg 458 152 \; pd dsp \$1;
#X obj 458 117 set-dsp-tgl;
#X text 489 121 DSP on/off;
#X obj 34 241 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#X obj 34 411 cnv 19 498 68 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-test-in 20000 float 2;
#X coords 0 1 20000 -1 500 140 1 0 0;
#X restore 33 240 graph;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-slop-out 20000 float 2;
#X coords 0 1 20000 0 500 70 1 0 0;
#X restore 33 410 graph;
#X obj 34 512 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-compander-out 20000 float 2;
#X coords 0 1 20000 -1 500 140 1 0 0;
#X restore 33 511 graph;
#X obj 673 111 cnv 19 198 198 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-dynamic-curve 102 float 0;
#X coords 0 100 101 0 200 200 1 0 0;
#X restore 672 110 graph;
#X msg 710 368 100 0 0 100 0 5;
#X msg 720 397 90 10 0 100 0 5;
#X msg 730 424 100 0 0 200 100 10;
#X msg 740 452 100 0 0 50 100 10;
#X msg 750 481 100 0 0 200 60 3;
#X connect 0 0 13 0;
#X connect 0 0 21 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 5 0 4 0;
#X connect 13 0 22 0;
#X connect 14 0 4 0;
#X connect 15 0 4 0;
#X connect 24 0 37 0;
#X connect 27 0 26 0;
#X connect 37 0 6 0;
#X connect 38 0 6 0;
#X connect 39 0 6 0;
#X connect 40 0 6 0;
#X connect 41 0 6 0;
#X restore 701 291 pd compander-limiter;
#N canvas 522 50 880 817 slew-limiter 0;
#X floatatom 134 76 6 0 1000 0 - - - 0;
#X obj 134 100 t f b;
#X obj 166 129 samplerate~;
#X obj 134 129 /;
#X obj 74 368 metro 500;
#X obj 54 402 tabwrite~ \$0-slew-graph;
#X floatatom 214 187 6 0 1000 0 - - - 0;
#X obj 214 211 t f b;
#X obj 246 239 samplerate~;
#X obj 214 240 /;
#X obj 54 191 osc~ 100;
#X text 184 75 max downward slope;
#X text 265 186 max upward slope;
#X text 419 32 The slew limiter is a filter whose cutoff frequency is infinite (so that the output follows the input exactly) unless the input varies from the previous output by more than the highest slope we allow (the slew limit) times the sample period (i.e. \, the maximum variation allowed over the space of a sample). This limit is therefore in units of amplitude per sample. The number boxes specify amplitude change per second \, which we divide by the sample rate to convert to the units needed by [slop~]., f 61;
#X obj 74 326 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X text 98 325 <- start metronome to graph output, f 18;
#X text 83 17 Using [slop~] to make a slew limiter;
#X msg 280 372 \; pd dsp \$1;
#X obj 280 337 set-dsp-tgl;
#X text 310 341 DSP on/off;
#X obj 442 282 cnv 19 402 182 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-slew-graph 1000 float 0;
#X coords 0 1 999 -1 402 182 1 0 0;
#X restore 441 281 graph;
#X obj 137 49 hsl 162 19 628.3 100 0 0 empty empty empty -2 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X obj 217 161 hsl 162 19 628.3 100 0 0 empty empty empty -2 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X floatatom 134 160 9 0 0 0 - - - 0;
#X obj 54 292 slop~ 1e+09 0.0142 0 0.0142 0;
#X floatatom 214 265 9 0 0 0 - - - 0;
#X text 419 174 Here the maximum slope of the 100 Hz sinusoid is 200pi \, about 628.3. Setting upward or downward slew limits below that will replace the waveform with straight line segments on the way up and/or down. See the HTML documentation (link on main page of this patch) for details., f 61;
#X floatatom 212 506 5 10 125 0 - - - 0;
#X floatatom 212 598 8 0 0 0 - - - 0;
#X obj 125 595 sig~;
#X obj 125 465 tgl 20 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X floatatom 125 565 5 0 0 0 - - - 0;
#X text 254 489 amplitude per second, f 10;
#X obj 212 534 t f b;
#X obj 244 563 samplerate~;
#X obj 212 563 /;
#X obj 142 659 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 142 686 metro 25;
#X obj 125 716 snapshot~;
#X obj 128 771 hsl 162 19 0 1 0 0 empty empty empty -2 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X msg 212 483 1;
#X text 434 502 One way to look at it is that we define a maximum amplitude jump limit \, which slows the rising and falling of audio signals. On the example to the left we have immediate signal jumps that are slowed and smoothened by [slop~]., f 57;
#X text 434 582 Now \, instead of a fixed period of time that the change is smoothened \, like what you get with [line~] and [vline~] \, you get a fixed ramp step (or 'limit') no matter what the target point is. This means it has a fixed speed \, whereas [line~] and [vline~] provide a fixed time., f 57;
#X text 435 665 The input parameter is the step per sample. Hence \, the speed is then defined as "amplitude per second" when you divide it by the sample rate \, where a value of "1" means it takes one second to move from an amplitude value of 0 to 1 \, but it will take half a second to move from 0 to 0.5 \, test the values to the left., f 57;
#X floatatom 125 743 8 0 0 0 - - - 0;
#X text 166 659 <- convert to control data;
#X msg 140 498 0.5;
#X msg 149 527 0;
#X obj 212 458 loadbang;
#X text 278 590 amplitude per sample, f 11;
#X obj 125 628 slop~ 1e+09, f 16;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 1 1 2 0;
#X connect 2 0 3 1;
#X connect 3 0 24 0;
#X connect 4 0 5 0;
#X connect 6 0 7 0;
#X connect 7 0 9 0;
#X connect 7 1 8 0;
#X connect 8 0 9 1;
#X connect 9 0 26 0;
#X connect 10 0 25 0;
#X connect 14 0 4 0;
#X connect 18 0 17 0;
#X connect 22 0 0 0;
#X connect 23 0 6 0;
#X connect 24 0 25 2;
#X connect 25 0 5 0;
#X connect 26 0 25 4;
#X connect 28 0 34 0;
#X connect 29 0 51 4;
#X connect 29 0 51 2;
#X connect 30 0 51 0;
#X connect 31 0 32 0;
#X connect 32 0 30 0;
#X connect 34 0 36 0;
#X connect 34 1 35 0;
#X connect 35 0 36 1;
#X connect 36 0 29 0;
#X connect 37 0 38 0;
#X connect 38 0 39 0;
#X connect 39 0 45 0;
#X connect 41 0 28 0;
#X connect 45 0 40 0;
#X connect 47 0 32 0;
#X connect 48 0 32 0;
#X connect 49 0 41 0;
#X connect 51 0 39 0;
#X restore 701 243 pd slew-limiter;
#N canvas 590 165 749 548 peak-meter 0;
#X floatatom 217 132 5 0 50 0 - \$0-decay-speed-init - 0;
#N canvas 422 246 639 450 generate-test 0;
#X obj 45 196 osc~ 440;
#X msg 98 166 -0.25;
#X obj 165 239 *~;
#X obj 147 270 *~;
#X obj 147 395 outlet~;
#X obj 165 153 f;
#X msg 165 178 1 \, 0 \$1;
#X obj 338 87 loadbang;
#X obj 383 157 s \$0-decay-speed-init;
#X msg 338 127 30;
#X obj 97 78 metro 500;
#X obj 97 25 inlet;
#X msg 383 127 500;
#X obj 183 25 inlet;
#X obj 165 204 line~;
#X obj 338 187 s \$0-pulse-length-init;
#X obj 253 25 inlet;
#X obj 253 243 pow 4;
#X obj 253 294 line~;
#X msg 253 268 \$1 10;
#X obj 235 321 *~;
#X obj 235 352 dac~;
#X connect 0 0 3 0;
#X connect 1 0 0 1;
#X connect 2 0 3 1;
#X connect 3 0 4 0;
#X connect 3 0 20 0;
#X connect 5 0 6 0;
#X connect 6 0 14 0;
#X connect 7 0 9 0;
#X connect 7 0 12 0;
#X connect 9 0 15 0;
#X connect 10 0 5 0;
#X connect 10 0 1 0;
#X connect 11 0 10 0;
#X connect 12 0 8 0;
#X connect 13 0 5 1;
#X connect 14 0 2 0;
#X connect 14 0 2 1;
#X connect 16 0 17 0;
#X connect 17 0 19 0;
#X connect 18 0 20 1;
#X connect 19 0 18 0;
#X connect 20 0 21 0;
#X connect 20 0 21 1;
#X restore 47 101 pd generate-test;
#X text 365 155 Envelope follower for use in peak metering;
#X text 314 467 See the HTML documentation (link on main page of this patch) for more details., f 54;
#X floatatom 101 63 5 1 100 2 pulse-length \$0-pulse-length-init - 0;
#X obj 47 214 env~ 1024;
#X obj 139 183 abs~;
#X obj 139 248 snapshot~;
#X obj 139 281 rmstodb;
#X obj 127 347 vu 18 160 empty VU -20 20 0 12 #404040 #000000 1 0;
#X obj 139 213 slop~ 0 0 0 0 1e+09;
#X obj 47 248 t f b;
#X obj 47 289 - 100;
#X obj 139 306 - 100;
#X obj 47 24 tgl 19 0 empty empty empty 17 7 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 217 156 expr 1000 / $f1;
#X text 197 132 ms;
#X text 215 109 decay speed;
#X floatatom 217 182 5 0 0 0 - - - 0;
#X text 197 183 hz;
#X obj 159 72 hsl 128 19 0 1 0 0 empty empty empty 32 9 0 12 #dcdcdc #000000 #000000 0 1;
#X text 314 204 A slew limiter can be used as a fast-rising envelope follower \, useful for example in peak metering. In this example a short burst of sound is metered using both the [env~] follower (which measures an average over a time window) and a fast-rising envelope follower consisting of an [abs~] object (to rectify the signal) followed by a [slop~] object set to rise quickly (1e09 asymptotic rise speed \, 0 up-slew needed to engage it) and with controllable decay (asymptotic downward speed controlled by a number box). There is no linear region at all so the linear cutoff frequency has no effect., f 54;
#X text 314 368 The output is sampled using a [snapshot~] object. Both envelope followers are converted to dBFS for the IEM VU meter., f 54;
#X text 314 420 When the pulse is very short (1 msec \, for instance) the RMS meter acts badly but the [slop~]-driven one still shows the peak., f 54;
#X text 198 73 Volume;
#X text 71 23 <- turn on test pulse;
#X text 35 421 see also ->;
#X msg 385 81 \; pd dsp \$1;
#X obj 385 46 set-dsp-tgl;
#X text 416 50 DSP on/off;
#X connect 0 0 15 0;
#X connect 1 0 5 0;
#X connect 1 0 6 0;
#X connect 4 0 1 1;
#X connect 5 0 11 0;
#X connect 6 0 10 0;
#X connect 7 0 8 0;
#X connect 8 0 13 0;
#X connect 10 0 7 0;
#X connect 11 0 12 0;
#X connect 11 1 7 0;
#X connect 12 0 9 0;
#X connect 13 0 9 1;
#X connect 14 0 1 0;
#X connect 15 0 18 0;
#X connect 18 0 10 3;
#X connect 20 0 1 2;
#X connect 28 0 27 0;
#X restore 701 267 pd peak-meter;
#X text 129 152 set state (previously stored output);
#N canvas 467 45 850 454 jitter-remover 0;
#X floatatom 132 204 7 0 100 0 - - - 0;
#X obj 95 354 metro 500;
#X obj 95 308 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 69 70 osc~ 100;
#X obj 69 385 tabwrite~ \$0-jitter-graph;
#X obj 69 101 clip~ -0.3 0.3;
#X obj 186 85 osc~ 1000;
#X obj 69 146 +~;
#X obj 69 255 slop~ 0 0 1e+09 0 1e+09;
#X text 69 27 jitter remover;
#X text 417 150 Set the jitter range to zero to see the original signal and raise it to see smoothing., f 53;
#X text 417 59 If you have a noisy sensor \, one approach to smoothing it is to set slop~ up to only react to motion past a certain window. The linear frequency cutoff is set to zero so that the output only changes when the input strays by more than the maximum upward or downward slew., f 53;
#X text 120 308 <-- start metronome to graph output, f 19;
#X msg 281 108 \; pd dsp \$1;
#X obj 281 73 set-dsp-tgl;
#X text 312 77 DSP on/off;
#X obj 306 263 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-jitter-graph 1000 float 0;
#X coords 0 1 999 -1 500 140 1 0 0;
#X restore 305 262 graph;
#X obj 135 175 hsl 162 19 0 0.1 0 0 empty empty empty -2 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X text 190 203 jitter range (0 to 0.1);
#X obj 186 110 *~ 0.03;
#X connect 0 0 8 2;
#X connect 0 0 8 4;
#X connect 1 0 4 0;
#X connect 2 0 1 0;
#X connect 3 0 5 0;
#X connect 5 0 7 0;
#X connect 6 0 20 0;
#X connect 7 0 8 0;
#X connect 8 0 4 0;
#X connect 14 0 13 0;
#X connect 18 0 0 0;
#X connect 20 0 7 1;
#X restore 701 317 pd jitter-remover;
#X text 688 216 Examples:;
#X text 22 565 see also:;
#X obj 101 565 lop~;
#X obj 151 565 fexpr~;
#X obj 24 44 slop~, f 7;
#X obj 10 75 cnv 1 910 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 436 15 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 10 551 cnv 1 910 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#N canvas 798 148 488 282 html-reference 0;
#X obj 101 59 inlet;
#X obj 101 190 pdcontrol;
#X obj 101 130 pdcontrol;
#X msg 101 105 dir;
#X text 205 94 this window opens the html reference link via the [pdcontrol] object., f 25;
#X msg 101 159 browse \$1/../8.topics/slop-tilde.htm;
#X connect 0 0 3 0;
#X connect 2 0 5 0;
#X connect 3 0 2 0;
#X connect 5 0 1 0;
#X restore 436 44 pd html-reference;
#N canvas 734 107 574 398 reference 0;
#X obj 11 46 cnv 5 550 5 empty empty INLETS: 8 18 0 13 #202020 #000000 0;
#X obj 11 242 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 11 275 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 10 371 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X obj 11 75 cnv 1 550 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0;
#X obj 9 117 cnv 1 550 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0;
#X obj 24 15 slop~, f 7;
#X obj 11 141 cnv 1 550 1 empty empty 3rd: 8 12 0 13 #7c7c7c #000000 0;
#X obj 9 165 cnv 1 550 1 empty empty 4th: 8 12 0 13 #7c7c7c #000000 0;
#X obj 11 191 cnv 1 550 1 empty empty 5th: 8 12 0 13 #7c7c7c #000000 0;
#X obj 9 217 cnv 1 550 1 empty empty 6th: 8 12 0 13 #7c7c7c #000000 0;
#X text 120 78 signal - input signal to be filtered., f 46;
#X text 85 96 set <float> - set state (previously stored output).;
#X text 120 120 signal - cutoff frequency in linear region., f 46;
#X text 120 144 signal - maximum downward slew of linear region.;
#X text 120 169 signal - asymptotic downward cutoff frequency.;
#X text 120 195 signal - maximum upward slew of linear region.;
#X text 120 250 signal - filtered signal.;
#X text 120 220 signal - asymptotic upward cutoff frequency.;
#X text 107 281 1) float - cutoff frequency in linear region (default 0)., f 62;
#X text 107 298 2) float - maximum downward slew of linear region (default 0)., f 62;
#X text 107 315 3) float - asymptotic downward cutoff frequency (default 0)., f 62;
#X text 107 332 4) float - maximum upward slew of linear region (default 0)., f 62;
#X text 107 349 5) float - asymptotic upward cutoff frequency (default 0)., f 62;
#X text 84 14 - slew-limiting / low-pass filter;
#X restore 739 44 pd reference;
#X text 837 43 <= click;
#X text 497 103 The [slop~] object is a low-pass filter whose frequency response (i.e. \, reaction speed) can vary according to the filter's state. It can be useful for slew limiting \, dynamics processing (companders/limiters/noise gates) \, and soft saturation. Examples below are explained in the HTML reference (linked above)., f 55;
#X text 459 14 <- Open HTML reference;
#X text 84 43 - slew-limiting / low-pass filter;
#X msg 252 489 \; pd dsp \$1;
#X obj 252 454 set-dsp-tgl;
#X text 283 458 DSP on/off;
#X obj 405 398 cnv 19 498 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-graph 1000 float 0;
#X coords 0 1 999 -1 500 140 1 0 0;
#X restore 404 397 graph;
#X text 686 564 updated for Pd version 0.50-0;
#X obj 35 122 osc~ 110;
#X obj 81 377 slop~ 55 1e+09 0 1e+09 0, f 26;
#N canvas 460 83 810 730 non-linear-envelope 0;
#X obj 207 585 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X text 232 585 <-- start metronome to graph output, f 19;
#X obj 469 514 cnv 19 248 138 empty empty empty 20 12 0 12 #e0e0e0 #404040 0;
#N canvas 0 50 450 250 (subpatch) 0;
#X array \$0-adsr 4410 float 0;
#X coords 0 1 4409 0 250 140 1 0 0;
#X restore 468 513 graph;
#X obj 181 662 tabwrite~ \$0-adsr;
#X obj 181 383 vline~;
#X obj 293 202 t f f;
#X obj 181 82 trigger float float;
#X obj 254 414 expr 1000./$f1;
#X msg 181 328 0;
#X obj 181 110 != 0;
#X obj 535 387 v D_\$0;
#X floatatom 466 359 5 0 0 0 - - - 0;
#X obj 466 278 loadbang;
#X obj 466 329 unpack float float float float;
#X floatatom 535 359 5 0 0 0 - - - 0;
#X floatatom 604 359 5 0 0 0 - - - 0;
#X floatatom 673 359 5 0 0 0 - - - 0;
#X obj 306 361 v D_\$0;
#X obj 604 387 s S_\$0;
#X obj 343 174 r S_\$0;
#X obj 466 387 s A_\$0;
#X obj 304 490 expr 1000./$f1;
#X obj 304 445 r A_\$0;
#X obj 254 360 v R_\$0;
#X obj 673 387 v R_\$0;
#X obj 292 257 pack f f f;
#X obj 359 229 r A_\$0;
#X msg 292 286 \$1 \, \$2 0 \$3;
#X obj 293 174 f;
#X obj 181 140 sel 0 1;
#X obj 325 229 *;
#X obj 181 24 tgl 22 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X floatatom 181 55 4 0 0 0 - - - 0;
#X msg 466 305 500 250 0.5 1500;
#X obj 207 631 metro 150;
#X text 453 644 0;
#X text 453 504 1;
#X obj 49 595 *~;
#X obj 49 513 osc~ 440;
#X obj 49 634 output~;
#X text 212 24 gate;
#X floatatom 304 520 6 0 0 0 - - - 0;
#X floatatom 254 520 6 0 0 0 - - - 0;
#X text 464 416 attack;
#X text 537 416 decay;
#X text 601 416 sustain;
#X text 669 416 release;
#X floatatom 254 390 6 0 0 0 - - - 0;
#X floatatom 304 467 6 0 0 0 - - - 0;
#X floatatom 343 200 6 0 0 0 - - - 0;
#X text 446 48 Here we use [vline~] and [slop~] to make a non-linear ADSR envelope. This example is hopefully simple enough to not require more details in the HTML reference., f 43;
#X text 446 118 This example uses [vline~] to schedule an attack and decay stage when receiving a gate on message. The sustain point is defined as a ratio of the gate value. The attack \, decay and release time are defined in ms and are converted to values in Hz., f 43;
#X obj 181 548 slop~, f 18;
#X connect 0 0 35 0;
#X connect 5 0 53 0;
#X connect 6 0 26 0;
#X connect 6 1 31 0;
#X connect 7 0 10 0;
#X connect 7 1 29 1;
#X connect 8 0 43 0;
#X connect 9 0 5 0;
#X connect 10 0 30 0;
#X connect 12 0 21 0;
#X connect 13 0 34 0;
#X connect 14 0 12 0;
#X connect 14 1 15 0;
#X connect 14 2 16 0;
#X connect 14 3 17 0;
#X connect 15 0 11 0;
#X connect 16 0 19 0;
#X connect 17 0 25 0;
#X connect 18 0 48 0;
#X connect 20 0 50 0;
#X connect 22 0 42 0;
#X connect 23 0 49 0;
#X connect 24 0 48 0;
#X connect 26 0 28 0;
#X connect 27 0 26 2;
#X connect 28 0 5 0;
#X connect 29 0 6 0;
#X connect 30 0 24 0;
#X connect 30 0 9 0;
#X connect 30 1 18 0;
#X connect 30 1 29 0;
#X connect 31 0 26 1;
#X connect 32 0 33 0;
#X connect 33 0 7 0;
#X connect 34 0 14 0;
#X connect 35 0 4 0;
#X connect 38 0 40 0;
#X connect 39 0 38 0;
#X connect 42 0 53 5;
#X connect 43 0 53 3;
#X connect 48 0 8 0;
#X connect 49 0 22 0;
#X connect 50 0 31 1;
#X connect 53 0 4 0;
#X connect 53 0 38 1;
#X restore 701 343 pd non-linear-envelope;
#X text 198 206 maximum downward slew of linear region (slew limit in amplitude per sample), f 38;
#X text 273 287 maximum upward slew of linear region (slew limit in amplitude per sample), f 36;
#X text 133 412 <-- graph output;
#X connect 0 0 41 0;
#X connect 2 0 1 0;
#X connect 3 0 2 0;
#X connect 4 0 42 1;
#X connect 5 0 9 0;
#X connect 6 0 8 0;
#X connect 7 0 42 0;
#X connect 8 0 42 4;
#X connect 9 0 42 2;
#X connect 11 0 42 3;
#X connect 14 0 42 5;
#X connect 27 0 29 0;
#X connect 36 0 35 0;
#X connect 41 0 42 0;
#X connect 42 0 1 0;
