#N canvas 468 38 821 760 12;
#X declare -stdpath ./;
#X obj 34 252 r trigger;
#X obj 34 473 *~;
#X obj 34 366 *~ 0.01;
#X obj 34 401 *~;
#X obj 34 431 *~;
#X obj 81 395 r pitch;
#X obj 81 445 mtof;
#X floatatom 81 420 4 0 0 0 - - - 0;
#X floatatom 55 307 4 0 0 0 - - - 0;
#X obj 55 282 r level;
#X floatatom 118 307 4 0 0 0 - - - 0;
#X obj 118 282 r attack;
#X floatatom 186 307 4 0 0 0 - - - 0;
#X obj 186 282 r decay;
#X floatatom 250 307 4 0 0 0 - - - 0;
#X floatatom 326 307 4 0 0 0 - - - 0;
#X obj 250 282 r sustain;
#X obj 326 282 r release;
#X obj 636 486 r note;
#X obj 636 533 t b f;
#X obj 712 508 s pitch;
#X obj 712 533 r duration;
#X floatatom 712 558 4 0 0 0 - - - 0;
#X floatatom 636 509 4 0 0 0 - - - 0;
#X obj 290 349 r trigger;
#X floatatom 310 405 4 0 0 0 - - - 0;
#X floatatom 369 435 4 0 0 0 - - - 0;
#X floatatom 459 435 4 0 0 0 - - - 0;
#X floatatom 545 435 4 0 0 0 - - - 0;
#X floatatom 641 435 4 0 0 0 - - - 0;
#X obj 310 380 r level2;
#X obj 369 410 r attack2;
#X obj 459 410 r decay2;
#X obj 545 410 r sustain2;
#X obj 641 410 r release2;
#X obj 81 470 tabosc4~ array1;
#X floatatom 241 395 4 0 0 0 - - - 0;
#X floatatom 292 560 4 0 5 0 - - - 0;
#X obj 292 535 r q;
#X obj 310 430 / 69.23;
#X obj 241 420 mtof;
#X obj 241 445 sqrt;
#X obj 241 470 sqrt;
#X obj 219 363 r filter;
#X obj 241 523 *~;
#X obj 241 548 *~;
#X obj 290 498 +~ 1;
#X obj 241 495 *~;
#X text 111 252 ADSR for amplitude:;
#X obj 229 648 output~;
#X text 396 337 ADSR for filter. Here \, it works better to make the envelope modify a constant "filter pitch"--so the "filter" receive gets the "mtof" treatment and the ADSR is an offset in halftones., f 50;
#X obj 680 583 delay;
#X msg 500 189 line 0 \, auto;
#X text 545 48 click to open:;
#X obj 512 74 text define -k seq2;
#A set note 36 \; 1000 note 34 \; 1000 note 33 \; 1000 note 31 \; 1000 loop bang \;;
#X obj 500 258 text sequence seq2 -g;
#X msg 515 218 stop;
#X msg 606 216 tempo \$1 permsec;
#X obj 606 166 r tempo;
#X floatatom 606 191 4 0 0 0 - - - 0;
#X obj 290 473 adsr, f 15;
#N canvas 396 375 341 457 init 0;
#X obj 107 94 loadbang;
#X msg 107 131 \; level 100 \; attack 20 \; decay 300 \; sustain 70 \; release 300 \; duration 300 \; pitch 72 \; filter 38 \; level2 49 \; attack2 19 \; decay2 300 \; sustain2 17 \; release2 700 \; q 3 \; tempo 4;
#X obj 100 394 declare -stdpath ./;
#X text 59 23 This subpatch initialize the patch and loads values into number boxes., f 28;
#X connect 0 0 1 0;
#X restore 98 617 pd init;
#X obj 34 340 adsr, f 16;
#X obj 500 159 bng 19 250 50 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000;
#X text 527 160 start;
#X obj 36 24 cnv 5 5 25 empty empty Analog\ Synth\ Style\ Using\ [text] 15 13 0 16 #dfdfdf #202020 0;
#X obj 500 132 r loop;
#X obj 680 669 s trigger;
#X obj 680 638 tgl 19 0 empty empty empty 0 -10 0 12 #dfdfdf #000000 #000000 0 1;
#X msg 636 583 1;
#X msg 680 608 0;
#X text 62 145 The [text definfe] stores a sequence that is read by [text sequence]. The sequence contains four "note" messages and a 'bang' message at the end that restarts the loop. The "note" messages are translated into a pitch change and triggers for the ADSRs., f 54;
#N canvas 0 0 450 300 (subpatch) 0;
#X array array1 67 float 1;
#A 0 0 0 0 0 0.714286 0.742857 0.757143 0.771429 0.778571 0.785714 0.785714 0.785714 0.785714 0.790476 0.795238 0.614286 0.585714 0.442857 0.271429 -0.128571 -0.142857 -0.157143 -0.171429 -0.642857 -0.528571 -0.614286 -0.685714 -0.828571 -0.828571 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.557143 0.571429 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0;
#X coords 0 1 66 -1 200 140 1;
#X restore 404 549 graph;
#X obj 229 598 bob~;
#X text 62 66 This is an analog-synth sound made using a wavetable oscillator and a [bob~] object. Unlike the "floyd" example earlier \, we use a [text] object to do the sequencing. This can also be adapted to make a keyboard synth., f 54;
#X connect 0 0 62 0;
#X connect 1 0 73 0;
#X connect 2 0 3 0;
#X connect 2 0 3 1;
#X connect 3 0 4 0;
#X connect 3 0 4 1;
#X connect 4 0 1 0;
#X connect 5 0 7 0;
#X connect 6 0 35 0;
#X connect 7 0 6 0;
#X connect 8 0 62 1;
#X connect 9 0 8 0;
#X connect 10 0 62 2;
#X connect 11 0 10 0;
#X connect 12 0 62 3;
#X connect 13 0 12 0;
#X connect 14 0 62 4;
#X connect 15 0 62 5;
#X connect 16 0 14 0;
#X connect 17 0 15 0;
#X connect 18 0 23 0;
#X connect 19 0 69 0;
#X connect 19 0 51 0;
#X connect 19 1 20 0;
#X connect 21 0 22 0;
#X connect 22 0 51 1;
#X connect 23 0 19 0;
#X connect 24 0 60 0;
#X connect 25 0 39 0;
#X connect 26 0 60 2;
#X connect 27 0 60 3;
#X connect 28 0 60 4;
#X connect 29 0 60 5;
#X connect 30 0 25 0;
#X connect 31 0 26 0;
#X connect 32 0 27 0;
#X connect 33 0 28 0;
#X connect 34 0 29 0;
#X connect 35 0 1 1;
#X connect 36 0 40 0;
#X connect 37 0 73 2;
#X connect 38 0 37 0;
#X connect 39 0 60 1;
#X connect 40 0 41 0;
#X connect 41 0 42 0;
#X connect 42 0 47 0;
#X connect 43 0 36 0;
#X connect 44 0 45 0;
#X connect 44 0 45 1;
#X connect 45 0 73 1;
#X connect 46 0 47 1;
#X connect 47 0 44 0;
#X connect 47 0 44 1;
#X connect 51 0 70 0;
#X connect 52 0 55 0;
#X connect 56 0 55 0;
#X connect 57 0 55 0;
#X connect 58 0 59 0;
#X connect 59 0 57 0;
#X connect 60 0 46 0;
#X connect 62 0 2 0;
#X connect 63 0 52 0;
#X connect 66 0 63 0;
#X connect 68 0 67 0;
#X connect 69 0 68 0;
#X connect 70 0 68 0;
#X connect 73 0 49 0;
