comparison examples/08-PureData/envelopeTrigger/_main.pd @ 531:ddb86944e138 prerelease

cleaned up all pd examples (and removed some). added polysynth and vangelisiser to instruments examples
author chnrx <chris.heinrichs@gmail.com>
date Thu, 23 Jun 2016 20:40:05 +0100
parents 8fcfbfb32aa0
children
comparison
equal deleted inserted replaced
525:1ca196e35105 531:ddb86944e138
1 #N canvas 646 209 359 287 10; 1 #N canvas 646 209 853 1174 10;
2 #X obj 28 207 dac~; 2 #X text 29 17 SAMPLE-ACCURATE ENVELOPE TRIGGER;
3 #N canvas 324 380 556 621 env 0; 3 #X text 29 27 ================================;
4 #N canvas 886 1001 131 207 >~ 0; 4 #X obj 33 543 /~ 44100;
5 #X obj 19 -37 -~; 5 #X obj 78 523 samplerate~;
6 #X obj 19 -58 min~; 6 #X obj 78 503 loadbang;
7 #X obj 19 26 *~ 1e+37; 7 #X obj 33 619 rpole~;
8 #X obj 19 5 +~ 1e-37; 8 #X obj 33 477 sig~ 1;
9 #X obj 19 -16 clip~ -1e-37 0; 9 #X obj 438 571 sig~ 0.5;
10 #X obj 19 -83 inlet~; 10 #X obj 33 937 *~;
11 #X obj 62 -83 inlet~; 11 #X obj 399 550 *~ -1;
12 #X obj 19 48 outlet~; 12 #X obj 33 801 *~ 512;
13 #X connect 0 0 4 0; 13 #X obj 33 639 clip~ 0 1;
14 #X connect 1 0 0 0; 14 #X obj 33 822 tabread4~ env1;
15 #X connect 2 0 7 0; 15 #X obj 33 780 *~;
16 #X connect 3 0 2 0; 16 #X obj 399 424 abs~;
17 #X connect 4 0 3 0; 17 #X obj 48 736 sig~ 1;
18 #X connect 5 0 1 0; 18 #X obj 48 759 /~;
19 #X connect 6 0 0 1; 19 #X obj 48 915 osc~ 220;
20 #X connect 6 0 1 1; 20 #X obj 48 895 +~ 50;
21 #X restore 199 106 pd >~; 21 #X obj 48 855 *~;
22 #X obj 23 173 /~ 44100; 22 #X obj 112 736 clip~ 1e-05 100000;
23 #X obj 68 153 samplerate~;
24 #X obj 68 133 loadbang;
25 #X obj 199 128 biquad~ 0 0 -1 1 0;
26 #X obj 23 209 rpole~;
27 #X obj 23 153 sig~ 1;
28 #X obj 226 171 sig~ 0.5;
29 #N canvas 0 22 110 231 <~ 0;
30 #X obj 11 -41 -~;
31 #X obj 11 29 +~ 1e-37;
32 #X obj 11 8 clip~ -1e-37 0;
33 #X obj 11 -86 inlet~;
34 #X obj 55 -85 inlet~;
35 #X obj 11 -62 max~;
36 #X obj 11 -17 *~ -1;
37 #X obj 11 81 outlet~;
38 #X obj 11 50 *~ 1e+37;
39 #X connect 0 0 6 0;
40 #X connect 1 0 8 0;
41 #X connect 2 0 1 0;
42 #X connect 3 0 5 0;
43 #X connect 4 0 0 1;
44 #X connect 4 0 5 1;
45 #X connect 5 0 0 0;
46 #X connect 6 0 2 0;
47 #X connect 8 0 7 0;
48 #X restore 199 192 pd <~;
49 #X text 237 193 (x != x);
50 #X obj 23 467 *~;
51 #X obj 199 150 *~ -1;
52 #X obj 23 331 *~ 512;
53 #X obj 23 229 clip~ 0 1;
54 #X obj 23 352 tabread4~ env1;
55 #X obj 23 310 *~;
56 #X obj 199 64 abs~;
57 #X obj 199 43 hip~ 1;
58 #X obj 199 22 inlet~ excitationSignal;
59 #X obj 218 269 sig~ 1;
60 #X obj 218 292 /~;
61 #X obj 226 86 inlet~ threshold;
62 #X obj 262 229 inlet~ envDuration;
63 #X obj 38 445 osc~ 220;
64 #X obj 38 425 +~ 50;
65 #X obj 38 385 *~;
66 #X obj 38 405 *~ 1000;
67 #X obj 262 269 clip~ 1e-05 100000;
68 #X obj 23 487 outlet~;
69 #N canvas 0 22 450 278 (subpatch) 0; 23 #N canvas 0 22 450 278 (subpatch) 0;
70 #X array env1 512 float 3; 24 #X array env1 512 float 3;
71 #A 0 0 0.0625 0.0883883 0.108253 0.125 0.139754 0.153093 0.165359 0.176777 25 #A 0 0 0.0625 0.0883883 0.108253 0.125 0.139754 0.153093 0.165359 0.176777
72 0.1875 0.197642 0.207289 0.216506 0.225347 0.233854 0.242061 0.25 0.257694 26 0.1875 0.197642 0.207289 0.216506 0.225347 0.233854 0.242061 0.25 0.257694
73 0.265165 0.272431 0.279509 0.286411 0.293151 0.299739 0.306186 0.3125 27 0.265165 0.272431 0.279509 0.286411 0.293151 0.299739 0.306186 0.3125
132 0.00961169 0.00885813 0.00813533 0.00744329 0.00678201 0.00615148 0.00555171 86 0.00961169 0.00885813 0.00813533 0.00744329 0.00678201 0.00615148 0.00555171
133 0.0049827 0.00444444 0.00393695 0.00346021 0.00301423 0.002599 0.00221453 87 0.0049827 0.00444444 0.00393695 0.00346021 0.00301423 0.002599 0.00221453
134 0.00186082 0.00153787 0.00124567 0.000984237 0.000753556 0.000553633 88 0.00186082 0.00153787 0.00124567 0.000984237 0.000753556 0.000553633
135 0.000384467 0.000246059 0.000138408 6.15148e-05 1.53787e-05 0; 89 0.000384467 0.000246059 0.000138408 6.15148e-05 1.53787e-05 0;
136 #X coords 0 1 512 0 512 64 1 0 0; 90 #X coords 0 1 512 0 512 64 1 0 0;
137 #X restore 24 536 graph; 91 #X restore 34 1026 graph;
138 #X text 244 55 centre signal around zero and take abs value; 92 #X text 475 477 if greater than threshold output 1;
139 #X text 243 107 if greater than threshold output 1; 93 #X text 513 521 differentiator;
140 #X text 313 129 differentiator; 94 #X text 512 539 (generates impulse on positive trigger (0->1);
141 #X text 238 150 (generates impulse on positive trigger (0->1); 95 #X text 107 620 signal-rate counter;
142 #X text 67 210 signal-rate counter; 96 #X text 497 618 rpole~ coeff to 0;
143 #X text 296 193 -> resets counter by briefly setting; 97 #X text 410 1004 pre-generated envelope;
144 #X text 314 204 rpole~ coeff to 0; 98 #X obj 112 692 *~;
145 #X text 96 416 kickdrum 101 :P; 99 #X obj 399 476 hv_gte~;
146 #X text 400 514 pre-generated envelope; 100 #X obj 399 592 hv_lte~;
147 #X obj 262 249 *~; 101 #X text 116 891 kickdrum 101 :);
148 #X text 127 352 << use envelope value for volume and frequency; 102 #X obj 399 392 receive~ excitationSignal;
149 #X connect 0 0 4 0; 103 #X obj 438 456 receive~ threshold;
150 #X connect 1 0 5 0; 104 #X obj 112 672 receive~ envDuration;
151 #X connect 2 0 1 1; 105 #X obj 38 311 send~ excitationSignal;
152 #X connect 3 0 2 0; 106 #X obj 198 311 send~ threshold;
153 #X connect 4 0 11 0; 107 #X obj 318 311 send~ envDuration;
154 #X connect 5 0 13 0; 108 #X obj 33 967 dac~;
155 #X connect 6 0 1 0; 109 #X text 29 57 Sample-accurate signal processing can often be hard to
156 #X connect 7 0 8 1; 110 ;
157 #X connect 8 0 5 1; 111 #X text 29 71 do in puredata \, which generally works on a per-block
158 #X connect 10 0 28 0; 112 ;
159 #X connect 11 0 8 0; 113 #X text 29 85 basis. In this example we use a combination of;
160 #X connect 12 0 14 0; 114 #X text 95 102 and;
161 #X connect 13 0 15 0; 115 #X obj 125 102 rpole~;
162 #X connect 14 0 10 0; 116 #X obj 48 875 *~ 1000;
163 #X connect 14 0 25 0; 117 #X obj 112 714 *~ 0.25;
164 #X connect 14 0 25 1; 118 #X obj 444 507 sig~ 1;
165 #X connect 15 0 12 0; 119 #X obj 399 528 rzero~ 1;
166 #X connect 16 0 0 0; 120 #X text 187 102 objects to perform;
167 #X connect 17 0 16 0; 121 #X text 29 120 sample-accurate envelope triggering based on the;
122 #X text 29 134 signal fed into the first audio channel.;
123 #X obj 38 210 adc~ 1;
124 #X obj 198 240 adc~ 3;
125 #X obj 318 280 adc~ 4;
126 #X text 252 240 use a potentiometer on first analog in to set;
127 #X text 252 253 triggering threshold...;
128 #X text 382 280 ...second analog in sets envelope duration;
129 #X obj 32 102 rzero~;
130 #X text 605 12 ............................;
131 #X text 605 22 . ____ ._____ _ .......___ .;
132 #X text 605 32 .| __ )| ____| |....../ _ |.;
133 #X text 605 52 .| |_) | |___| |___ / ___ |.;
134 #X text 605 62 .|____/|_____|_____/_/..._|.io;
135 #X text 605 72 ............................;
136 #X text 605 42 .| __ || __|.| |...../ _| |.;
137 #X text 475 424 take absolute value of signal;
138 #X text 497 630 (coefficient of 1 causes rpole~ to;
139 #X text 497 643 accumulate input samples);
140 #X text 108 542 setting input to (1/sampleRate) means;
141 #X text 108 555 rpole~ counts seconds when its coefficient;
142 #X text 108 569 is set to 1 (resets when 0);
143 #X text 147 822 use envelope value for volume and frequency;
144 #X text 479 594 -> boolean (x != x);
145 #X text 92 210 Left audio input for excitation (a piezo disk works
146 well);
147 #X text 111 767 multiplies counter output allowing to alter;
148 #X text 111 781 playback speed of envelope;
149 #X text 497 607 resets counter by briefly setting;
150 #X connect 2 0 5 0;
151 #X connect 3 0 2 1;
152 #X connect 4 0 3 0;
153 #X connect 5 0 11 0;
154 #X connect 6 0 2 0;
155 #X connect 7 0 30 1;
156 #X connect 8 0 38 0;
157 #X connect 8 0 38 1;
158 #X connect 9 0 30 0;
159 #X connect 10 0 12 0;
160 #X connect 11 0 13 0;
161 #X connect 12 0 8 0;
162 #X connect 12 0 19 0;
163 #X connect 12 0 19 1;
164 #X connect 13 0 10 0;
165 #X connect 14 0 29 0;
166 #X connect 15 0 16 0;
167 #X connect 16 0 13 1;
168 #X connect 17 0 8 1;
168 #X connect 18 0 17 0; 169 #X connect 18 0 17 0;
169 #X connect 19 0 20 0; 170 #X connect 19 0 44 0;
170 #X connect 20 0 15 1; 171 #X connect 20 0 16 1;
171 #X connect 21 0 0 1; 172 #X connect 28 0 45 0;
172 #X connect 22 0 39 0; 173 #X connect 29 0 47 0;
173 #X connect 22 0 39 1; 174 #X connect 30 0 5 1;
174 #X connect 23 0 10 1; 175 #X connect 32 0 14 0;
175 #X connect 24 0 23 0; 176 #X connect 33 0 29 1;
176 #X connect 25 0 26 0; 177 #X connect 34 0 28 0;
177 #X connect 26 0 24 0; 178 #X connect 34 0 28 1;
178 #X connect 27 0 20 1; 179 #X connect 44 0 18 0;
179 #X connect 39 0 27 0; 180 #X connect 45 0 20 0;
180 #X restore 28 174 pd env; 181 #X connect 46 0 47 1;
181 #X obj 79 110 adc~ 9; 182 #X connect 47 0 9 0;
182 #X obj 129 130 adc~ 10; 183 #X connect 51 0 35 0;
183 #X text 72 90 piezo input for excitation; 184 #X connect 52 0 36 0;
184 #X text 123 110 fader 1 sets threshold; 185 #X connect 53 0 37 0;
185 #X text 183 130 fader 2 sets duration;
186 #X text 29 17 SAMPLE-ACCURATE ENVELOPE TRIGGER;
187 #X text 29 27 ================================;
188 #X obj 28 90 adc~ 8;
189 #X text 141 236 ---------------------------------;
190 #X text 141 226 @krighxz / BELA / heavy / 12/2015;
191 #X text 165 245 beaglert.cc / enzienaudio.com;
192 #X connect 1 0 0 0;
193 #X connect 1 0 0 1;
194 #X connect 2 0 1 1;
195 #X connect 3 0 1 2;
196 #X connect 9 0 1 0;