blob: 6e9febb50446044c2dc93f227c53ea5f35788a7f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
#N canvas 166 252 718 504 12;
#X floatatom 239 98 4 0 0 0 - - adc-gain;
#X text 317 17 latency measurement;
#N canvas 31 48 928 842 guts 0;
#X obj 292 35 adc~ 1 2 3 4 5 6 7 8;
#X obj 318 102 == 1;
#X obj 293 126 *~ 0;
#X obj 355 128 *~ 0;
#X obj 418 129 *~ 0;
#X obj 480 131 *~ 0;
#X obj 541 134 *~ 0;
#X obj 603 136 *~ 0;
#X obj 666 137 *~ 0;
#X obj 728 139 *~ 0;
#X obj 380 104 == 2;
#X obj 443 105 == 3;
#X obj 505 107 == 4;
#X obj 566 110 == 5;
#X obj 628 112 == 6;
#X obj 691 113 == 7;
#X obj 753 115 == 8;
#X obj 46 34 loadbang;
#X obj 59 153 r inchannel;
#X msg 59 177 set \$1;
#X obj 59 201 s inchannel-set;
#N canvas 0 22 450 300 (subpatch) 0;
#X array pulse 120 float 3;
#A 0 0 0 0 0 0 0 0 0 0 0 -0 -6.19458e-05 -0.000494103 -0.00165937 -0.00390618
-0.00756153 -0.0129244 -0.0202596 -0.0297923 -0.0417031 -0.0561239
-0.0731343 -0.0927595 -0.114969 -0.139674 -0.166732 -0.195943 -0.227055
-0.259767 -0.293732 -0.328561 -0.363831 -0.39909 -0.433862 -0.467657
-0.499977 -0.530324 -0.558209 -0.583156 -0.604713 -0.622461 -0.636015
-0.645036 -0.649234 -0.648374 -0.642282 -0.630843 -0.614012 -0.591808
-0.564318 -0.531698 -0.494168 -0.452014 -0.405579 -0.355267 -0.301528
-0.244862 -0.185805 -0.124926 -0.0628189 -9.26574e-05 0.0626345 0.124745
0.185628 0.244691 0.301365 0.355113 0.405437 0.451883 0.494051 0.531595
0.56423 0.591735 0.613955 0.630802 0.642256 0.648364 0.649239 0.645055
0.636048 0.622507 0.604771 0.583224 0.558287 0.53041 0.500069 0.467754
0.433963 0.399193 0.363935 0.328665 0.293834 0.259866 0.22715 0.196032
0.166815 0.139751 0.115038 0.0928211 0.0731882 0.0561701 0.0417419
0.0298239 0.0202844 0.012943 0.00757468 0.00391473 0.00166424 0.000496283
6.24961e-05 0 0 0 0 0 0 0 0 0 0;
#X coords 0 1 119 -1 200 140 1;
#X restore 25 399 graph;
#X obj 52 587 t b b;
#X obj 123 648 f;
#X obj 161 648 + 1;
#X obj 52 616 until;
#X obj 123 676 t f f;
#X obj 46 780 tabwrite pulse;
#X obj 50 563 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 143 570 \; pulse const 0;
#X msg 140 620 0;
#X obj 44 676 sel 100;
#X obj 157 780 + 10;
#X obj 67 712 * 0.06283;
#X obj 615 264 metro 1000;
#X obj 615 218 r metro-on;
#X obj 614 243 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 628 326 vline~;
#X obj 627 357 tabread4~ pulse;
#X obj 687 31 r inchannel;
#X obj 291 186 hip~ 20;
#X obj 411 516 *~ 1e+10;
#X obj 411 543 clip~ 0 1;
#X obj 411 567 *~ 1e+10;
#X obj 412 603 lop~ 3;
#X obj 413 627 clip~ 0 1;
#X msg 355 574 clear;
#X msg 629 295 0 \, 12000 10;
#X obj 744 359 osc~ 220;
#X obj 744 386 *~ 0.03;
#X obj 649 526 +~;
#X obj 650 581 dac~ 1 2 3 4 5 6 7 8;
#X obj 431 268 bp~ 220 0.7;
#X obj 693 622 env~ 65536;
#X floatatom 693 649 4 0 0 0 - - -;
#X floatatom 749 329 5 0 0 0 - - -;
#X obj 704 414 +~;
#X obj 430 292 rzero~ -1;
#X obj 431 317 rzero~ -1;
#X obj 431 343 *~ 0.15;
#X obj 287 316 rzero~ 1;
#X obj 288 341 rzero~ 1;
#X obj 45 747 expr -0.5 * (1-cos($f1)) * sin($f1);
#X obj 288 292 bp~ 2000 0.7;
#X obj 413 465 *~ 20;
#X obj 629 382 *~ 0.1;
#X obj 332 220 + 100;
#X obj 332 245 dbtorms;
#X obj 290 246 *~ 1;
#X obj 160 281 env~ 65536;
#X floatatom 160 308 4 0 0 0 - - -;
#X obj 431 370 bonk~;
#X obj 431 395 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 412 489 -~ 0.1;
#X obj 414 656 -~ 1;
#X obj 414 683 *~ -1;
#X obj 565 747 phasor~;
#X msg 616 714 0;
#X obj 664 703 del 800;
#X obj 665 728 snapshot~;
#X floatatom 665 779 6 0 0 0 - - -;
#X obj 666 756 * 1000;
#X obj 87 328 s adc-db;
#X obj 733 646 s dac-db;
#X obj 728 774 s latency;
#X obj 354 196 r adc-gain;
#X msg 47 61 \; inchannel 1 \; metro-on 1 \; pd dsp 1;
#X obj 474 397 s discontinuity;
#X obj 496 514 *~ 1e+10;
#X obj 496 541 clip~ 0 1;
#X obj 496 565 *~ 1e+10;
#X obj 497 601 lop~ 3;
#X obj 498 625 clip~ 0 1;
#X obj 497 487 -~ 0.1;
#X obj 497 463 *~ 20;
#X obj 514 709 *~;
#X connect 0 0 2 0;
#X connect 0 1 3 0;
#X connect 0 2 4 0;
#X connect 0 3 5 0;
#X connect 0 4 6 0;
#X connect 0 5 7 0;
#X connect 0 6 8 0;
#X connect 0 7 9 0;
#X connect 1 0 2 1;
#X connect 2 0 40 0;
#X connect 3 0 40 0;
#X connect 4 0 40 0;
#X connect 5 0 40 0;
#X connect 6 0 40 0;
#X connect 7 0 40 0;
#X connect 8 0 40 0;
#X connect 9 0 40 0;
#X connect 10 0 3 1;
#X connect 11 0 4 1;
#X connect 12 0 5 1;
#X connect 13 0 6 1;
#X connect 14 0 7 1;
#X connect 15 0 8 1;
#X connect 16 0 9 1;
#X connect 17 0 86 0;
#X connect 18 0 19 0;
#X connect 19 0 20 0;
#X connect 22 0 25 0;
#X connect 22 1 30 0;
#X connect 22 1 29 0;
#X connect 23 0 24 0;
#X connect 23 0 26 0;
#X connect 23 0 31 0;
#X connect 24 0 23 1;
#X connect 25 0 23 0;
#X connect 26 0 33 0;
#X connect 26 1 32 0;
#X connect 28 0 22 0;
#X connect 30 0 23 1;
#X connect 31 0 25 1;
#X connect 32 0 27 1;
#X connect 33 0 62 0;
#X connect 34 0 47 0;
#X connect 34 0 46 0;
#X connect 34 0 77 0;
#X connect 34 0 78 0;
#X connect 35 0 36 0;
#X connect 36 0 34 0;
#X connect 37 0 38 0;
#X connect 38 0 65 0;
#X connect 39 0 1 0;
#X connect 39 0 10 0;
#X connect 39 0 11 0;
#X connect 39 0 12 0;
#X connect 39 0 13 0;
#X connect 39 0 14 0;
#X connect 39 0 15 0;
#X connect 39 0 16 0;
#X connect 40 0 68 0;
#X connect 41 0 42 0;
#X connect 42 0 43 0;
#X connect 43 0 44 0;
#X connect 44 0 45 0;
#X connect 45 0 74 0;
#X connect 46 0 44 0;
#X connect 47 0 37 0;
#X connect 48 0 49 0;
#X connect 49 0 56 1;
#X connect 50 0 51 0;
#X connect 50 0 51 1;
#X connect 50 0 51 2;
#X connect 50 0 51 3;
#X connect 50 0 51 4;
#X connect 50 0 51 5;
#X connect 50 0 51 6;
#X connect 50 0 51 7;
#X connect 50 0 53 0;
#X connect 52 0 57 0;
#X connect 53 0 54 0;
#X connect 53 0 83 0;
#X connect 55 0 48 0;
#X connect 56 0 50 0;
#X connect 57 0 58 0;
#X connect 58 0 59 0;
#X connect 59 0 71 0;
#X connect 60 0 61 0;
#X connect 61 0 64 0;
#X connect 62 0 27 0;
#X connect 63 0 60 0;
#X connect 64 0 73 0;
#X connect 65 0 56 0;
#X connect 65 0 94 0;
#X connect 66 0 67 0;
#X connect 67 0 68 1;
#X connect 68 0 69 0;
#X connect 68 0 63 0;
#X connect 68 0 52 0;
#X connect 69 0 70 0;
#X connect 69 0 82 0;
#X connect 71 0 72 0;
#X connect 71 0 87 0;
#X connect 73 0 41 0;
#X connect 74 0 75 0;
#X connect 75 0 95 0;
#X connect 76 0 79 0;
#X connect 77 0 76 1;
#X connect 78 0 79 0;
#X connect 79 0 81 0;
#X connect 81 0 80 0;
#X connect 81 0 84 0;
#X connect 85 0 66 0;
#X connect 88 0 89 0;
#X connect 89 0 90 0;
#X connect 90 0 91 0;
#X connect 91 0 92 0;
#X connect 92 0 95 1;
#X connect 93 0 88 0;
#X connect 94 0 93 0;
#X connect 95 0 76 0;
#X restore 595 387 pd guts;
#X floatatom 242 50 4 1 8 0 inchannel inchannel-set inchannel;
#X floatatom 626 267 6 0 0 0 - latency -;
#X text 108 96 adjust gain here:;
#X text 457 267 latency in milliseconds;
#X text 571 245 THE ANSWER IS:;
#X floatatom 528 143 4 0 0 0 - adc-db -;
#X floatatom 527 92 4 0 0 0 - dac-db -;
#X text 562 145 RMS amplitude in;
#X text 564 93 RMS amplitude out;
#X text 106 142 so that RMS amplitude in is between 60 and 70;
#X text 108 121 (typically between -20 and 20);
#X text 497 466 updated for Pd version 0.43;
#X obj 228 259 bng 25 250 50 0 empty discontinuity empty 17 7 0 10
-262144 -1 -1;
#X text 40 235 discontinuity: this flashes if there are audio errors
;
#X text 67 343 To use this patch \, connect your audio output back
to the audio input (any input and output channel from 1 to 8 \, but
the input channel should agree wih the "inchannel" control at top).
Then adjust gain so that "RMS amplitude in" is about 65 (anywhere from
60 to 70 will do.) The latency is measured once per second. If there
are interruptions in the audio the button above should flash (whether
or not the audio system reports the error).;
|