Trying to create Variable speed delay, but buffer clears when read index is same as write index. I have done some additional patching to try and avoid this, in the "pd equal-block" subpatch, however it still seems to be happening. All the echoes stop when the indexes pass each other.Can anyone give me any guidance? Patch is pasted below.
#N canvas 678 88 1242 928 12;
#X obj 269 89 samplerate~;
#X msg 170 138 resize $1;
#X obj 401 60 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
#fcfcfc #000000 #000000 1 256 0 0 1 0;
#X obj 277 111 * 1;
#X msg 401 26 1;
#X obj 95 165 array define sampler1;
#X msg 517 139 set sampler1;
#X obj 901 732 dac~;
#X obj 519 387 *~ 44100;
#X obj 518 353 phasor~ 1;
#X obj 915 289 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
#fcfcfc #000000 #000000 1 256 0 0 1 0;
#X text 462 55 buffer size (s);
#X text 937 141 playback speed;
#X obj 1005 456 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 #fcfcfc
#000000 #000000 0 1 0 1;
#X obj 1005 626 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0
10 #fcfcfc #000000 #000000 0 256 0 0 1 0;
#X obj 1005 606 / 127;
#X obj 1005 674 line~;
#X obj 900 693 *~;
#X obj 921 66 vsl 15 128 0 512 0 0 empty empty empty 0 -9 0 10 #fcfcfc
#000000 #000000 9525 1 0 1;
#X obj 918 242 * 4;
#X obj 919 263 - 2;
#X obj 920 223 / 512;
#X msg 920 27 384;
#X obj 107 217 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 #fcfcfc
#000000 #000000 0 1 0 1;
#X obj 114 355 / 127;
#X obj 612 322 line~;
#X msg 923 319 $1 100;
#X obj 115 378 * 4410;
#X obj 686 464 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 #fcfcfc
#000000 #000000 0 1 0 1;
#X obj 686 620 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
#fcfcfc #000000 #000000 0 256 0 0 1 0;
#X obj 686 600 / 127;
#X obj 686 668 line~;
#X obj 670 695 *~;
#X text 1024 539 volume;
#X text 131 282 osc freq;
#X text 705 522 feedback;
#X msg 867 263 set $1;
#X obj 50 400 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
#fcfcfc #000000 #000000 0 256 0 0 1 0;
#X msg 23 373 set $1;
#X obj 48 438 line~;
#X msg 48 418 $1 100;
#X msg 686 638 $1 100;
#X msg 1008 644 $1 100;
#X text 939 69 2x;
#X text 939 196 -2x;
#X obj 517 160 s smplr;
#X obj 420 809 r smplr;
#X obj 839 457 r smplr;
#X obj 475 694 +~, f 4;
#X obj 49 470 osc~ 441;
#X obj 498 830 poke~;
#X obj 316 9 loadbang;
#X obj 315 30 t b b b;
#X obj 289 12 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc #000000
#000000 1;
#X obj 58 720 adc~;
#X obj 111 593 vsl 8 128 0 127 0 0 empty empty empty 0 -9 0 10 #fcfcfc
#000000 #000000 0 1 0 1;
#X obj 111 763 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
#fcfcfc #000000 #000000 0 256 0 0 1 0;
#X obj 111 743 / 127;
#X obj 111 811 line~;
#X obj 94 835 *~;
#X msg 114 781 $1 100;
#X text 130 676 dry sgnl;
#X obj 180 306 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 #fcfcfc
#000000 #000000 0 1 0 1;
#X obj 180 476 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10
#fcfcfc #000000 #000000 0 256 0 0 1 0;
#X obj 180 456 / 127;
#X obj 180 524 line~;
#X obj 75 543 *~;
#X text 199 389 volume;
#X msg 183 494 $1 100;
#X obj 621 387 *~ 44100;
#X obj 620 353 phasor~ 1;
#X obj 292 145 t b f f;
#X obj 901 484 tabread4~;
#X obj 371 487 edge~;
#X obj 371 518 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000 1;
#X obj 484 110 t b b;
#X obj 845 297 t f b;
#X obj 371 455 expr~ \$v1 == \$v2;
#N canvas 160 562 509 371 equal-block 0;
#X obj 231 34 inlet~;
#X obj 365 32 inlet~;
#X obj 240 306 outlet~;
#X obj 183 250 *~;
#X obj 316 250 *~ -1;
#X obj 135 175 edge~;
#X obj 135 201 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000 1;
#X obj 327 165 edge~;
#X obj 327 191 bng 15 250 50 0 empty empty empty 17 7 0 10 #fcfcfc
#000000 #000000 1;
#X obj 178 88 -~;
#X obj 178 112 abs~;
#X obj 178 139 expr~ \$v1 >= \$v2;
#X obj 311 139 expr~ \$v1 < \$v2;
#X floatatom 383 72 5 0 0 0 - - - 0 0 1, f 5;
#X obj 383 99 sig~ 4;
#X obj 443 21 inlet;
#X msg 443 54 1;
#X connect 0 0 9 0;
#X connect 1 0 9 1;
#X connect 1 0 3 1;
#X connect 3 0 2 0;
#X connect 4 0 2 0;
#X connect 5 0 6 0;
#X connect 7 0 8 0;
#X connect 9 0 10 0;
#X connect 10 0 11 0;
#X connect 10 0 12 0;
#X connect 11 0 5 0;
#X connect 11 0 3 0;
#X connect 12 0 4 0;
#X connect 12 0 7 0;
#X connect 13 0 14 0;
#X connect 14 0 11 1;
#X connect 14 0 12 1;
#X connect 15 0 16 0;
#X connect 16 0 13 0;
#X restore 584 419 pd equal-block;
#X connect 0 0 3 0;
#X connect 1 0 5 0;
#X connect 2 0 3 1;
#X connect 3 0 71 0;
#X connect 4 0 2 0;
#X connect 6 0 45 0;
#X connect 8 0 78 0;
#X connect 8 0 50 1;
#X connect 8 0 77 0;
#X connect 9 0 8 0;
#X connect 10 0 26 0;
#X connect 10 0 76 0;
#X connect 13 0 15 0;
#X connect 14 0 42 0;
#X connect 15 0 14 0;
#X connect 16 0 17 1;
#X connect 17 0 7 0;
#X connect 17 0 7 1;
#X connect 18 0 21 0;
#X connect 19 0 20 0;
#X connect 20 0 36 0;
#X connect 20 0 26 0;
#X connect 20 0 76 0;
#X connect 21 0 19 0;
#X connect 22 0 18 0;
#X connect 23 0 24 0;
#X connect 24 0 27 0;
#X connect 25 0 70 0;
#X connect 26 0 25 0;
#X connect 27 0 38 0;
#X connect 27 0 40 0;
#X connect 28 0 30 0;
#X connect 29 0 41 0;
#X connect 30 0 29 0;
#X connect 31 0 32 1;
#X connect 32 0 48 1;
#X connect 36 0 10 0;
#X connect 37 0 40 0;
#X connect 38 0 37 0;
#X connect 39 0 49 0;
#X connect 40 0 39 0;
#X connect 41 0 31 0;
#X connect 42 0 16 0;
#X connect 46 0 50 0;
#X connect 47 0 72 0;
#X connect 48 0 50 0;
#X connect 49 0 66 0;
#X connect 51 0 52 0;
#X connect 52 0 75 0;
#X connect 52 1 0 0;
#X connect 52 2 4 0;
#X connect 52 2 78 2;
#X connect 53 0 52 0;
#X connect 54 0 48 0;
#X connect 54 0 59 0;
#X connect 55 0 57 0;
#X connect 56 0 60 0;
#X connect 57 0 56 0;
#X connect 58 0 59 1;
#X connect 59 0 17 0;
#X connect 60 0 58 0;
#X connect 62 0 64 0;
#X connect 63 0 68 0;
#X connect 64 0 63 0;
#X connect 65 0 66 1;
#X connect 66 0 59 0;
#X connect 66 0 48 0;
#X connect 68 0 65 0;
#X connect 69 0 78 1;
#X connect 70 0 69 0;
#X connect 71 1 1 0;
#X connect 71 2 8 1;
#X connect 71 2 69 1;
#X connect 71 2 70 1;
#X connect 72 0 17 0;
#X connect 72 0 32 0;
#X connect 73 0 74 0;
#X connect 75 0 22 0;
#X connect 75 1 6 0;
#X connect 77 0 73 0;
#X connect 78 0 72 0;
#X connect 78 0 77 1;