Well, if you use a delay, you'll need a delay that has a big size to avoid
discontinuities (in that case, loss of data due to small buffer), so i
don't see how this would be better than having a second array.

the only other way i think is if you do some "in place" calculation every
block, but you can only stretch down the table, having a "speeding up" feel
for the writing process. (Note: after writing this e-mail, i think that
there is a way to speed down too, but you will lose what tabwrite put in
the array, I will try this too).

When you send a bang to tabwrite~, it starts overriding the array every
block, so, you can replace each block in that array with a smaller one.
you'll need to keep track of in which block tabwrite is at and if the
writing is over to stop, i'll try this approach since i'm curious how this
could be done.

Anyway, i've done a patch demonstrating the control approach with 2 tables
that i said in the previous e-mail, don't know if is useful, but is here
anyway

2018-07-17 9:55 GMT-03:00 Liam Goodacre <liamg...@hotmail.com>:

> Thanks José, I hadn't thought of that. I'd like to avoid using a second
> array if possible, as it doubles the memory usage, but I'll do it if there
> are no better options.
>
> I've also found an object in the ggee library called [tabread4~] which
> sounds promising, but it doesn't have a help patch. Does anyone know how it
> works?
> ------------------------------
> *From:* José de Abreu <abreubace...@gmail.com>
> *Sent:* 17 July 2018 13:25
> *To:* Liam Goodacre
> *Cc:* PD list
> *Subject:* Re: [PD] write to audio array at different speeds
>
> you can use 2 tables, write to one and then phasor~ + tabread4~ to another
> tabwrite~, and if you need the process to occur faster than real time (just
> to stretch the wave after recording the first table) you can use some until
> + switch~ magic.
>
> you can do the same process of 2 tables above in the control domain, using
> tabread4 to tabwrite for the second table (without tilde). This will need
> more math to build the until loop for picking the numbers that phasor~
> would provide, but won't need switch~ magic for "faster than real time".
>
> or use delread4~ with variable delay, but to calculate the right positions
> could be tricky, I don't know
>
>
> Em Ter, 17 de jul de 2018 08:49, Liam Goodacre <liamg...@hotmail.com>
> escreveu:
>
> It seems that [tabwrite~] writes only at one speed (presumably determined
> by the sample rate). But I want to use it to write audio to an array at a
> different speed. In other words, given an array of a set size, I want to
> determine that the recording will reach the end of the array at a different
> point in time than the default one.
>
> How could this be done? Is there any way to trick [tabwrite~] into writing
> at a different speed, ie. by sending it a different sample rate? Or can we
> do something clever with [delread4~]?
> _______________________________________________
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/
> listinfo/pd-list
>
>
> _______________________________________________
> Pd-list@lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/
> listinfo/pd-list
>
>
#N canvas 388 106 900 608 10;
#N canvas 374 446 450 300 someRandomWave 0;
#X obj 62 94 osc~;
#X obj 62 44 *~ 440;
#X obj 62 66 +~ 220;
#X obj 63 145 +~;
#X obj 62 22 phasor~ 1;
#X obj 155 36 noise~;
#X obj 155 58 samphold~;
#X obj 63 167 hip~ 20;
#X obj 63 189 /~ 2;
#X obj 228 28 phasor~ 500;
#X obj 155 80 lop~ 200;
#X obj 63 217 outlet~;
#X obj 62 116 /~ 4;
#X obj 155 102 *~ 1.2;
#X connect 0 0 12 0;
#X connect 1 0 2 0;
#X connect 2 0 0 0;
#X connect 3 0 7 0;
#X connect 4 0 1 0;
#X connect 5 0 6 0;
#X connect 6 0 10 0;
#X connect 7 0 8 0;
#X connect 8 0 11 0;
#X connect 9 0 6 1;
#X connect 10 0 13 0;
#X connect 12 0 3 0;
#X connect 13 0 3 1;
#X restore 45 105 pd someRandomWave;
#N canvas 0 50 450 250 (subpatch) 0;
#X array array1 44100 float 2;
#X coords 0 1 44100 -1 400 140 1 0 0;
#X restore 446 105 graph;
#N canvas 0 50 450 250 (subpatch) 0;
#X array array2 132300 float 2;
#X coords 0 1 132300 -1 400 140 1 0 0;
#X restore 446 265 graph;
#X obj 67 126 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X obj 44 172 tabwrite~ array1;
#X obj 48 361 until;
#X obj 48 386 f;
#X obj 78 386 + 1;
#X msg 98 362 0;
#X text 177 519 must go from 1 to size-2 of array1;
#X obj 48 541 tabwrite array2;
#X obj 48 339 t f b f;
#X text 85 287 stretch Table Factor;
#N canvas 1 80 450 300 resizeAndGo 0;
#X obj 48 9 inlet;
#X obj 80 64 array size array1;
#X obj 48 31 t f b;
#X obj 48 117 *;
#X obj 48 139 t f f;
#X msg 80 170 \; array2 resize \$1;
#X obj 48 214 outlet;
#X obj 112 217 outlet;
#X obj 80 86 t f f;
#X connect 0 0 2 0;
#X connect 1 0 8 0;
#X connect 2 0 3 0;
#X connect 2 1 1 0;
#X connect 3 0 4 0;
#X connect 4 0 6 0;
#X connect 4 1 5 0;
#X connect 8 0 3 1;
#X connect 8 1 7 0;
#X restore 48 319 pd resizeAndGo;
#X obj 48 518 tabread4 array1;
#X obj 48 443 /;
#X obj 48 471 *;
#X obj 143 424 - 3;
#X obj 48 493 + 1;
#X obj 48 408 t f f;
#X obj 48 286 f;
#X floatatom 71 260 5 0 0 0 - - -, f 5;
#X obj 119 237 loadbang;
#X msg 119 259 3;
#X text 456 435 look to the size of the tables;
#X obj 547 462 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 547 482 t b b;
#X obj 547 517 array size array1;
#X floatatom 547 539 0 0 0 0 - - -;
#X floatatom 677 539 0 0 0 0 - - -;
#X obj 677 517 array size array2;
#N canvas 1 80 450 300 delayTheSecondProcess 0;
#X obj 60 28 inlet;
#X obj 60 72 array size array1;
#X obj 60 50 t b b;
#X obj 111 98 samplerate~;
#X obj 111 160 /;
#X obj 60 193 *;
#X msg 111 130 1000 \$1;
#X text 112 198 time in milliseconds;
#X obj 60 215 delay;
#X obj 60 237 outlet;
#X connect 0 0 2 0;
#X connect 1 0 5 0;
#X connect 2 0 1 0;
#X connect 2 1 3 0;
#X connect 3 0 6 0;
#X connect 4 0 5 1;
#X connect 5 0 8 0;
#X connect 6 0 4 0;
#X connect 8 0 9 0;
#X restore 66 195 pd delayTheSecondProcess;
#X obj 67 146 t b b;
#X obj 192 103 loadbang;
#X obj 192 125 t b b;
#X msg 227 153 \; pd dsp 1;
#X text 37 11 press this bang to record to the first table. Exactly
after writing \, you'll get the second array filled with the "different
speed". if you want 2 times faster \, put 0.5 on the stretch factor
\, 2 times slower \, put 2 on the factor and so on.;
#X obj 687 433 loadbang;
#X obj 687 455 del 2000;
#X connect 0 0 4 0;
#X connect 3 0 32 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 6 0 19 0;
#X connect 7 0 6 1;
#X connect 8 0 6 1;
#X connect 11 0 5 0;
#X connect 11 1 8 0;
#X connect 11 2 15 1;
#X connect 13 0 11 0;
#X connect 13 1 17 0;
#X connect 14 0 10 0;
#X connect 15 0 16 0;
#X connect 16 0 18 0;
#X connect 17 0 16 1;
#X connect 18 0 14 0;
#X connect 19 0 15 0;
#X connect 19 1 10 1;
#X connect 20 0 13 0;
#X connect 21 0 20 1;
#X connect 22 0 23 0;
#X connect 23 0 21 0;
#X connect 25 0 26 0;
#X connect 26 0 27 0;
#X connect 26 1 30 0;
#X connect 27 0 28 0;
#X connect 30 0 29 0;
#X connect 31 0 20 0;
#X connect 32 0 31 0;
#X connect 32 1 4 0;
#X connect 33 0 34 0;
#X connect 34 0 3 0;
#X connect 34 1 35 0;
#X connect 37 0 38 0;
#X connect 38 0 25 0;
_______________________________________________
Pd-list@lists.iem.at mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to