#N canvas 568 23 543 603 12;
#X obj 83 101 osc~ 440;
#X obj 71 320 dac~;
#X msg 230 21 \; pd dsp 1;
#X msg 313 21 \; pd dsp 0;
#X text 255 59 ON;
#X text 333 57 OFF;
#X text 54 30 CONTROLLING AMPLITUDE;
#X obj 83 238 *~ 0;
#X floatatom 108 201 8 0 0 0 - - - 0;
#X obj 108 168 dbtorms;
#X floatatom 108 136 8 0 80 0 - - - 0;
#X text 86 492 Pd assumes you have a two channel audio system unless
you tell it otherwise., f 55;
#X text 293 551 updated for Pd version 0.33;
#X text 148 102 <= 440 Hz. sine wave at full blast;
#X text 172 135 <= set amplitude here in dB;
#X text 172 167 <= this converts dB to linear units;
#X text 172 200 <= this shows the linear gain;
#X text 110 321 <= and out. We're sending to both channels now.;
#X text 125 237 <= multiply the sine wave by the gain \, reducing its
amplitude. You can also use the [*~] object to multiply two signals.
The "0" argument here instructs it that we'll just send it messages
(not audio) to set the multiplier., f 48;
#X text 86 365 Amplitudes of audio signals can have any reasonable
range \, but when you output a signal via the [dac~] object \, the
samples should range between -1 and +1. Values out of that range will
be "clipped.", f 55;
#X text 86 429 Here we calculate a gain for the multiplier [*~] using
a [dbtorms] object (acronym for "dB to RMS"). 100 dB is normalized
to one \, and zero dB artificially outputs a true 0 amplitude., f
55;
#X connect 0 0 7 0;
#X connect 7 0 1 0;
#X connect 7 0 1 1;
#X connect 8 0 7 1;
#X connect 9 0 8 0;
#X connect 10 0 9 0;
