#N canvas 650 64 602 577 12;
#X declare -stdpath ./;
#N canvas 564 152 562 441 delay-writer 0;
#X obj 91 254 inlet~;
#X obj 91 370 outlet~;
#X obj 353 255 block~ 1;
#X obj 168 301 *~ 0.99;
#X obj 91 306 +~;
#X obj 168 252 inlet;
#X text 70 29 Because of the feedback \, the delwrite~ has to be computed
after the delread~. So we set the blocksize to 1 to minimize the resulting
delay.;
#X text 351 284 this object sets the;
#X text 350 301 block size for audio;
#X text 349 320 computations in this;
#X obj 168 275 delread~ G04-del;
#X obj 102 336 delwrite~ G04-del 1000;
#X text 84 217 incoming;
#X text 86 232 pulses;
#X text 168 213 delay;
#X text 169 228 time;
#X text 349 338 window. Must be a;
#X text 349 357 power of two.;
#X text 70 82 The smaller the blocksize the more expensive the computations
are \, so don't reduce it lower than you have to. Also \, it's a good
idea to isolate the portion of the patch that requires the smaller
block size \, and only run that portion that way. Here \, the pulses
that excite the delay line are computed outside this window \, and
the output level control as well.;
#X connect 0 0 4 0;
#X connect 3 0 4 1;
#X connect 4 0 1 0;
#X connect 4 0 11 0;
#X connect 5 0 10 0;
#X connect 10 0 3 0;
#X restore 136 417 pd delay-writer;
#X obj 238 381 expr 1000/$f1;
#X obj 238 355 mtof;
#X obj 136 258 metro 500;
#X obj 238 301 random 60;
#X obj 136 232 loadbang;
#X obj 238 327 + 30;
#X text 86 9 CONTROLLING DELAY WITH BLOCK~;
#X text 63 43 In situations where a delay read feeds back to a delay
write \, the minimum possible delay you can achieve is one block \,
which by default is 64 samples \, or 1.45 msec at 44100 Hz. You can
shorten the minimum delay by changing the block size. Do this in a
subpatch (open it to see how).;
#X obj 136 466 output~;
#X obj 136 384 vline~;
#X text 300 499 updated for Pd version 0.37-1;
#X text 61 124 Here we use this principle to make a harpsichord-like
sound by sending pulses into a recirculating delay line (which imitates
the travel of the wave up and down the harpsichord string.) This is
related to Karplus-Strong synthesis \, but the idea is probably much
older than their paper.;
#X text 42 388 long., f 12;
#X text 341 373 length of delay line is;
#X text 342 391 1000/(frequency);
#X text 42 373 pulse 1 msec;
#X text 255 417 <= here is the delay loop;
#X text 42 358 rectangular, f 12;
#X text 42 344 this makes a;
#X msg 136 342 1 \, 0 0 1;
#X obj 423 16 declare -stdpath ./;
#X connect 0 0 9 0;
#X connect 0 0 9 1;
#X connect 1 0 0 1;
#X connect 2 0 1 0;
#X connect 3 0 20 0;
#X connect 3 0 4 0;
#X connect 4 0 6 0;
#X connect 5 0 3 0;
#X connect 6 0 2 0;
#X connect 10 0 0 0;
#X connect 20 0 10 0;
