Re: [PD] write to audio array at different speeds

2018-07-17 Thread José de Abreu
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 :

> 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 
> *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 
> 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;

Re: [PD] write to audio array at different speeds

2018-07-17 Thread Liam Goodacre
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 
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 
mailto: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<mailto: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


Re: [PD] write to audio array at different speeds

2018-07-17 Thread José de Abreu
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 
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


[PD] write to audio array at different speeds

2018-07-17 Thread Liam Goodacre
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