PageRenderTime 24ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/bin/data/patches/c_adsr.pd

http://github.com/mazbox/Speakotron
Unknown | 104 lines | 104 code | 0 blank | 0 comment | 0 complexity | 22472a6ed032a8e44f82aca32532dd14 MD5 | raw file
  1#N canvas 649 151 1006 740 10;
  2#X obj 105 111 inlet;
  3#X obj 435 151 inlet;
  4#X text 101 86 trigger;
  5#X obj 105 139 sel 0;
  6#X obj 244 155 t b;
  7#X obj 166 264 f \$1;
  8#X obj 166 289 pack 0 \$2;
  9#X obj 492 151 inlet;
 10#X obj 438 281 del \$2;
 11#X obj 462 304 f \$4;
 12#X obj 501 379 pack 0 \$3;
 13#X obj 554 151 inlet;
 14#X obj 616 151 inlet;
 15#X obj 689 150 inlet;
 16#X msg 105 170 stop;
 17#X obj 612 306 pack 0 \$5;
 18#X text 435 129 level;
 19#X obj 501 355 * \$1;
 20#X obj 458 454 outlet~;
 21#X text 102 378 and pack with;
 22#X text 103 398 attack time;
 23#X text 31 126 if zero;
 24#X text 32 143 release;
 25#X text 12 160 and cancel;
 26#X text 43 177 decay;
 27#X text 284 272 on attack \, set a;
 28#X text 278 305 recall sustain value;
 29#X text 315 378 pack with decay time;
 30#X text 605 332 on release ramp;
 31#X text 606 349 back to zero;
 32#X obj 462 329 * 0.01;
 33#X text 47 567 Objects such as "f" and "pack" can be given dollar sign
 34arguments to initialize their contents from adsr's creation arguments.
 35Inlets are supplied to change them on the fly.;
 36#X text 13 2 ADSR ENVELOPE;
 37#X text 488 129 attack;
 38#X text 555 128 decay;
 39#X text 609 129 sustain;
 40#X text 686 129 release;
 41#X text 202 71 attack;
 42#X obj 204 92 moses;
 43#X obj 194 122 t b b;
 44#X msg 128 290 0;
 45#X text 20 273 optionally;
 46#X text 10 291 bash to zero;
 47#X text 25 246 ATTACK:;
 48#X text 49 477 When you send this patch a positive trigger it schedules
 49a line~ to do an attack and decay \, and if zero \, it starts the release
 50ramp.;
 51#X text 495 629 Updated for Pd version 0.37;
 52#X text 255 89 test for negative trigger;
 53#X text 253 113 if so \, zero;
 54#X text 254 129 the output;
 55#X text 278 165 in any case;
 56#X text 303 355 multiply by peak level;
 57#X text 280 286 delay for sustain;
 58#X text 276 328 convert from percent;
 59#X text 155 340 ... then;
 60#X text 103 359 recall peak level;
 61#X text 439 113 peak;
 62#X text 281 149 ... do this;
 63#X text 47 529 Negative triggers cause the output to jump to zero and
 64then attack (instead of attacking from the current location).;
 65#X text 208 1 Arguments: level \, attack time \, decay time \, sustain
 66level \, release time. A \, D \, and R are in msec and S is in percent.
 67This patch is used as an abstraction in various examples.;
 68#N canvas 228 198 627 317 LICENSE-BSD 0;
 69#X text 121 56 This software is copyrighted by Miller Puckette \, Reality
 70Jockey Ltd. and others. The terms (the "Standard Improved BSD License")
 71apply to all files associated with the software unless explicitly disclaimed
 72in individual files.;
 73#X text 123 148 See the file LICENSE.txt for the full license text.
 74;
 75#X restore 823 80 pd LICENSE-BSD;
 76#X obj 458 429 line~;
 77#X connect 0 0 3 0;
 78#X connect 1 0 5 1;
 79#X connect 1 0 17 1;
 80#X connect 3 0 14 0;
 81#X connect 3 0 15 0;
 82#X connect 3 1 38 0;
 83#X connect 4 0 5 0;
 84#X connect 4 0 8 0;
 85#X connect 5 0 6 0;
 86#X connect 6 0 60 0;
 87#X connect 7 0 6 1;
 88#X connect 7 0 8 1;
 89#X connect 8 0 9 0;
 90#X connect 9 0 30 0;
 91#X connect 10 0 60 0;
 92#X connect 11 0 10 1;
 93#X connect 12 0 9 1;
 94#X connect 13 0 15 1;
 95#X connect 14 0 8 0;
 96#X connect 15 0 60 0;
 97#X connect 17 0 10 0;
 98#X connect 30 0 17 0;
 99#X connect 38 0 39 0;
100#X connect 38 1 4 0;
101#X connect 39 0 4 0;
102#X connect 39 1 40 0;
103#X connect 40 0 60 0;
104#X connect 60 0 18 0;