#N canvas 534 53 505 440 12;
#X obj 19 16 samplerate~;
#X text 298 404 updated for Pd version 0.47;
#X obj 224 297 samplerate~;
#X floatatom 224 324 7 0 0 0 - - - 0;
#X obj 224 271 bng 19 250 50 0 empty empty empty 17 7 0 10 #dfdfdf #000000 #000000;
#X obj 224 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 372 322 pd resampling;
#X text 10 405 see also:;
#X obj 85 405 block~;
#X text 110 15 - get sample rate;
#X obj 141 405 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 391 cnv 1 490 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X obj 224 350 print;
#X msg 58 306 \; pd dsp \$1;
#X obj 58 271 set-dsp-tgl;
#X text 89 275 DSP on/off;
#X text 15 128 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. For more on this and other messages sent to and from Pd \, see [pd-messages]., f 67;
#X text 15 60 When sent a "bang" message \, [samplerate~] outputs the current audio sample rate. If called within a subwindow that is up/down-sampled \, the sample rate of signals within that subwindow are reported (see [pd resampling] subpatch below)., f 67;
#X connect 2 0 3 0;
#X connect 3 0 15 0;
#X connect 4 0 2 0;
#X connect 5 0 4 0;
#X connect 17 0 16 0;
