#N canvas 534 53 505 427 12;
#X obj 19 16 samplerate~;
#X text 298 394 updated for Pd version 0.47;
#X obj 222 297 samplerate~;
#X floatatom 222 324 7 0 0 0 - - - 0;
#X obj 222 271 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 222 244 receive pd-dsp-started;
#N canvas 771 223 443 248 resampling 0;
#X obj 90 140 block~ 64 1 0.5;
#X obj 231 130 samplerate~;
#X floatatom 231 165 6 0 0 0 - - - 0;
#X text 53 30 This window is downsampled by a factor of 2 \, so the samplerate must be half of the parent patch., f 44;
#X obj 231 98 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X text 255 96 <-- click;
#X obj 231 195 print downsampled;
#X connect 1 0 2 0;
#X connect 2 0 6 0;
#X connect 4 0 1 0;
#X restore 358 316 pd resampling;
#X text 10 395 see also:;
#X obj 141 395 receive;
#X msg 74 297 \; pd dsp \$1;
#X obj 74 270 tgl 19 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000 0 1;
#X obj 85 395 block~;
#X text 110 15 - get sample rate;
#X text 99 269 DSP On/Off;
#X obj 201 395 pd-messages;
#N canvas 695 169 585 201 reference 0;
#X obj 18 49 cnv 5 550 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 18 93 cnv 2 550 2 empty empty OUTLET: 8 12 0 13 #202020 #000000 0;
#X obj 18 130 cnv 2 550 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 17 167 cnv 5 550 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X text 133 63 bang -;
#X obj 39 16 samplerate~;
#X text 130 15 - get sample rate;
#X text 183 63 output current sample rate., f 46;
#X text 126 103 float - sample rate value in Hz., f 54;
#X text 166 141 NONE, f 9;
#X restore 321 16 pd reference;
#X text 419 15 <= click;
#X obj 2 49 cnv 1 490 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 10 381 cnv 1 490 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 41 137 Here we listen to "pd-dsp-started" to receive a bang (automatically sent when DSP is started in Pd) to get the sample rate when DSP starts. This also works whenever the sample rate may change when the audio is running. This is useful when designing filters whose coefficients usually have to be updated when the sample rate changes., f 56;
#X text 41 61 When sent a "bang" message \, [samplerate~] outputs the current audio sample rate. If called within a subwindow that is up- or down-sampled \, the sample rate of signals within that subwindow are reported (see [pd resampling] subpatch below)., f 56;
#X obj 222 350 print;
#X connect 2 0 3 0;
#X connect 3 0 21 0;
#X connect 4 0 2 0;
#X connect 5 0 4 0;
#X connect 10 0 9 0;
