Sorry, last patch was missing the tabread!!!!!
Use this one!
d.
Derek Holzer wrote:
Test patch attached... see the [wraparound~] subpatch for the part which doesn't work yet!
d.
Derek Holzer wrote:
I tried this already, and it's not appropriate in this case. The idea is to change the start of the loop to any place in the sample. If the length of the loop is longer than what's left of the sample in the table, currently I get silence. If I use [wrap~] the way you describe it, the loop I select always starts at the beginning of the table, because [wrap~] returns the percentage of the table I have "overshot".
I need a solution where, if the table is 100 places long, I can loop from 95 back around to 25 if need be. Which is what my theoretical [mod~] would do. But I simply can't "wrap" my head around how to construct it. Your [wrap~] solution seems to return a loop starting at 0 which is 30 units long instead.
best, d.
IOhannes m zmoelnig wrote:
Derek Holzer wrote:
end of the table)? [wrap~] doesn't do the trick, BTW.
i am sure it does. try scaling the signal before sending it to [wrap~] and afterwards undo the scaling.
[/~ 100] | [wrap~] | [*~ 100]
mfa.sdr IOhannes
#N canvas 315 27 885 778 10; #X text 240 13 0 - 127; #X text 574 6 0 - 255; #X text 581 45 127 = normal; #X text 580 31 255 = lowest; #X text 584 61 0 = highest; #X obj 91 516 phasor~; #X obj 91 553 *~; #X obj 91 302 / 44.1; #X obj 91 329 expr 1 / ($f1 * 1 / 1000); #X obj 61 247 t f f; #X obj 91 422 sig~; #X obj 91 450 *~; #X text 142 302 time in ms (use 48 if sample rate is 48KHz); #X text 103 245 number of samples in glitch; #X obj 268 116 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X text 241 39 127 = whole sample; #X text 244 60 0 = smallest fraction; #X obj 251 146 / 127; #X obj 61 219 *; #X obj 91 583 +~; #X obj 452 124 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X floatatom 458 193 5 0 0 0 - - -; #X obj 385 234 *; #X obj 581 229 / 127; #X obj 622 134 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -262144 -1 -1 0 1; #X floatatom 595 272 5 0 0 0 - - -; #X obj 598 196 abs; #X obj 599 172 - 255; #X obj 250 175 t b f; #X obj 400 188 t b f; #X floatatom 324 163 5 0 0 0 - - -; #X text 416 14 0 - 127; #X obj 434 153 / 255; #N canvas 0 22 406 310 wraparound~ 0; #X obj 87 29 inlet~; #X obj 87 149 outlet~; #X obj 87 83 wrap~; #X obj 87 55 /~; #X obj 87 113 *~; #X obj 144 28 inlet total num of samples in table; #X connect 0 0 3 0; #X connect 2 0 4 0; #X connect 3 0 2 0; #X connect 4 0 1 0; #X connect 5 0 3 1; #X connect 5 0 4 1; #X restore 91 631 pd wraparound~; #X obj 551 383 table test_zample; #X obj 29 21 openpanel; #X obj 30 -8 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X msg 29 49 read -resize $1 test_zample; #X obj 28 76 soundfiler; #X obj 240 85 inlet loop length; #X obj 393 86 inlet loop offset; #X obj 552 85 inlet loop pitch; #X text 419 33 127 = table start; #X text 420 60 0 = table end; #X obj 91 682 dac~; #X text 121 585 offset loop from start of table; #X text 126 555 multiply phasor~ by loop length; #X text 277 329 convert ms to frequency in Hz; #X text 209 630 <------this needs help!!!!!! without this subpatch , loop offset works , but can go beyond bounds of table. with this subpatch , loop offset does not work , so table bounds cannot be reached.; #X connect 5 0 6 0; #X connect 6 0 19 0; #X connect 7 0 8 0; #X connect 8 0 10 0; #X connect 9 0 6 1; #X connect 9 0 33 1; #X connect 9 1 7 0; #X connect 10 0 11 0; #X connect 11 0 5 0; #X connect 14 0 17 0; #X connect 14 0 30 0; #X connect 17 0 28 0; #X connect 18 0 9 0; #X connect 19 0 33 0; #X connect 20 0 32 0; #X connect 22 0 19 1; #X connect 23 0 25 0; #X connect 23 0 11 1; #X connect 24 0 27 0; #X connect 26 0 23 0; #X connect 27 0 26 0; #X connect 28 0 18 0; #X connect 28 1 18 1; #X connect 29 0 22 0; #X connect 29 1 22 1; #X connect 32 0 21 0; #X connect 32 0 29 0; #X connect 33 0 44 0; #X connect 33 0 44 1; #X connect 35 0 37 0; #X connect 36 0 35 0; #X connect 37 0 38 0; #X connect 38 0 18 0; #X connect 38 0 22 0; #X connect 39 0 17 0; #X connect 40 0 32 0; #X connect 41 0 27 0;