#N canvas 476 23 543 603 12;
#X obj 83 111 osc~ 440;
#X obj 71 330 dac~;
#X text 75 36 CONTROLLING AMPLITUDE;
#X obj 83 248 *~ 0;
#X floatatom 108 211 8 0 0 0 - - - 0;
#X obj 108 178 dbtorms;
#X floatatom 108 146 8 0 80 0 - - - 0;
#X text 86 502 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 112 <= 440 Hz. sine wave at full blast;
#X text 172 145 <= set amplitude here in dB;
#X text 172 177 <= this converts dB to linear units;
#X text 172 210 <= this shows the linear gain;
#X text 110 331 <= and out. We're sending to both channels now.;
#X text 125 247 <= 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 375 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 439 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 obj 325 17 ../5.reference/set-dsp-tgl;
#X text 356 20 DSP on/off;
#X msg 325 54 \; pd dsp \$1;
#X connect 0 0 3 0;
#X connect 3 0 1 0;
#X connect 3 0 1 1;
#X connect 4 0 3 1;
#X connect 5 0 4 0;
#X connect 6 0 5 0;
#X connect 17 0 19 0;
