aboutsummaryrefslogtreecommitdiff
path: root/pd/doc/3.audio.examples/05.output.subpatch.pd
blob: ab0dc7241b36fc72131699e162e54400b81e0c8e (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
#N canvas 68 39 635 486 12;
#X floatatom 70 181 0 0 100;
#N canvas 331 136 786 621 output 0;
#X obj 455 510 t b;
#X obj 455 450 f;
#X obj 455 390 inlet;
#X obj 455 540 f;
#X msg 566 532 0;
#X msg 455 420 bang;
#X obj 455 480 moses 1;
#X obj 566 502 t b f;
#X obj 535 460 moses 1;
#X obj 107 121 dbtorms;
#X obj 535 430 r master-lvl;
#X obj 107 28 r master-lvl;
#X obj 455 570 s master-lvl;
#X obj 36 228 inlet~;
#X obj 250 258 inlet;
#X obj 268 283 s master-lvl;
#X msg 119 57 set \$1;
#X obj 119 87 outlet;
#X msg 250 309 \; pd dsp 1;
#X obj 107 181 line~;
#X obj 36 258 *~;
#X obj 36 288 dac~;
#X obj 107 151 pack 0 50;
#X text 23 205 audio in;
#X text 2 313 out both channels;
#X text 273 182 Level input. Send to master-lvl and start DSP (we infer
that if you're changing the level you want to hear the network.) If
you start DSP when it's already running there's no effect.;
#X text 59 542 here is the previous nonzero master-lvl -->;
#X text 98 451 recall previous value of master-lvl -->;
#X text 239 482 test if less than 1 -->;
#X text 203 510 if true convert to bang -->;
#X text 218 351 Mute control. If the master level is zero \, restore
to the last nonzero one \, otherwise zero it.;
#X text 182 86 <-- update the number box to show new level;
#X text 178 120 <-- convert from dB to linear units;
#X text 196 150 <-- make a smooth ramp to avoid clicks or zipper noise
;
#X text 333 318 <-- automatically start DSP;
#X connect 0 0 3 0;
#X connect 1 0 6 0;
#X connect 2 0 5 0;
#X connect 3 0 12 0;
#X connect 4 0 12 0;
#X connect 5 0 1 0;
#X connect 6 0 0 0;
#X connect 6 1 7 0;
#X connect 7 0 4 0;
#X connect 8 1 3 1;
#X connect 9 0 22 0;
#X connect 10 0 1 1;
#X connect 10 0 8 0;
#X connect 11 0 9 0;
#X connect 11 0 16 0;
#X connect 13 0 20 0;
#X connect 14 0 15 0;
#X connect 14 0 18 0;
#X connect 16 0 17 0;
#X connect 19 0 20 1;
#X connect 20 0 21 0;
#X connect 20 0 21 1;
#X connect 22 0 19 0;
#X restore 32 214 pd output;
#X msg 108 182 MUTE;
#X obj 32 27 osc~ 440;
#X obj 54 55 osc~ 550;
#X obj 54 116 osc~ 660;
#X obj 32 88 +~;
#X obj 32 142 +~;
#X text 122 216 <-- this is a subwindow--click on it to see inside.
;
#X text 158 182 <-- output amplitude and mute control;
#X text 383 463 updated for Pd version 0.34;
#X text 24 408 The output control automatically starts DSP whenever
you touch the level control. "MUTE" toggles between the current level
and zero.;
#X text 157 115 <-- Here we make a simple triad as a test signal.;
#X text 261 20 CONTROLLING OUTPUT AMPLITUDE;
#X text 25 263 In this and subsequent patches \, we'll use a subwindow
\, "output" \, to control overall amplitude. The amplitudes are in
decibels \, with 100 being full blast. In this example \, you can't
actually push the output amplitude past 90 or so without clipping.
You'll know you're clipping if \, instead of an A major chord \, you
hear a single \, distorted tone two octaves down. The clipping happens
at Pd's last stage of audio output. All audio signals internal to Pd
have essentially no level limit.;
#X connect 0 0 1 1;
#X connect 1 0 0 0;
#X connect 2 0 1 2;
#X connect 3 0 6 0;
#X connect 4 0 6 1;
#X connect 5 0 7 1;
#X connect 6 0 7 0;
#X connect 7 0 1 0;