Hi Roman,
and thanks. I implemented it in my patch, but it doesn't seem to work
right. The looping isn't seamless, in fact there's a "hiccup" at the
point where the loop wraps around. In my previous version, I had another
function to calculate the offset and start point, so what would work
better for me is the the original concept, of an audio [mod~] which
would only wrap around the end point of the table.
Try for yourself and see with the attached patch.
d.
Roman Haefeli wrote:
hi derek
i attached a patch, that should do what you want. it is a modified
version of IOhannes approach, but it is still only a [wrap~] with
scaling functionality.
--
derek holzer :::
http://www.umatic.nl
---Oblique Strategy # 61:
"Don't be frightened of cliches"
#N canvas 39 22 889 782 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 obj 268 116 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 7400 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 452 124 hsl 128 15 0 255 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 12000 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 6400 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 obj 434 153 / 255;
#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 420 60 0 = table end;
#X obj 91 712 dac~;
#X text 126 555 multiply phasor~ by loop length;
#X text 277 329 convert ms to frequency in Hz;
#X text 103 245 number of samples in loop;
#X text 416 16 0 - 255;
#X text 419 32 255 = table start;
#X obj 91 688 tabread4~ test_zample;
#N canvas 582 348 512 453 wraparound~ 0;
#X obj 22 42 inlet~;
#X obj 22 296 outlet~;
#X obj 22 182 /~;
#X obj 22 232 *~;
#X obj 22 209 wrap~;
#X obj 22 98 -~;
#X obj 101 65 f;
#X obj 101 121 -;
#X obj 101 96 t b f;
#X obj 22 254 +~;
#X obj 100 41 inlet start point;
#X obj 233 41 inlet end point;
#X text 86 266 thanks to Roman Haefeli for helping with this part;
#X connect 0 0 5 0;
#X connect 2 0 4 0;
#X connect 3 0 9 0;
#X connect 4 0 3 0;
#X connect 5 0 2 0;
#X connect 6 0 8 0;
#X connect 6 0 5 1;
#X connect 6 0 9 1;
#X connect 7 0 2 1;
#X connect 7 0 3 1;
#X connect 8 0 7 0;
#X connect 8 1 7 1;
#X connect 9 0 1 0;
#X connect 10 0 6 0;
#X connect 11 0 7 0;
#X restore 91 605 pd wraparound~;
#X obj 184 466 mod;
#X obj 184 442 +;
#X obj 184 408 t b f;
#X text 221 606 <---Roman's [wrap~] implementation , but the wraparound
point "hiccups" and I can't figure out why!;
#X connect 5 0 6 0;
#X connect 6 0 46 0;
#X connect 7 0 8 0;
#X connect 8 0 10 0;
#X connect 9 0 6 1;
#X connect 9 1 7 0;
#X connect 10 0 11 0;
#X connect 11 0 5 0;
#X connect 13 0 16 0;
#X connect 13 0 28 0;
#X connect 16 0 26 0;
#X connect 17 0 9 0;
#X connect 17 0 48 0;
#X connect 18 0 29 0;
#X connect 20 0 46 1;
#X connect 20 0 49 0;
#X connect 21 0 23 0;
#X connect 21 0 11 1;
#X connect 22 0 25 0;
#X connect 24 0 21 0;
#X connect 25 0 24 0;
#X connect 26 0 17 0;
#X connect 26 1 17 1;
#X connect 27 0 20 0;
#X connect 27 1 20 1;
#X connect 29 0 19 0;
#X connect 29 0 27 0;
#X connect 31 0 33 0;
#X connect 32 0 31 0;
#X connect 33 0 34 0;
#X connect 34 0 17 0;
#X connect 34 0 20 0;
#X connect 34 0 47 1;
#X connect 35 0 16 0;
#X connect 36 0 29 0;
#X connect 37 0 25 0;
#X connect 45 0 39 0;
#X connect 46 0 45 0;
#X connect 47 0 46 2;
#X connect 48 0 47 0;
#X connect 49 0 48 0;
#X connect 49 1 48 1;