Hi
I am searching for a PD object (external/native) that can play samples from an array in both loop and "single shot" mode while being able to change playback speed.
So far I have been using a phasor~ (modified to create 1 or unlimited ramps) + tabread4~ but I am experiencing a very small click when the sound loops. The click is only noticable when the sample is a pure looping tone. The problem exists with both wav and aiff files so I don't thing it is a "header" problem.
I have attached the sampler (without modified phasor~) I have been using so far. It should run on any newer PD version.
Any ideas are welcome.
TIA
Soeren
#N canvas 317 18 863 708 10; #N canvas 0 0 450 300 graph1 0; #X array array1 176206 float 0; #X coords 0 1 176205 -1 200 150 1; #X restore 587 408 graph; #X obj 408 162 r totsamps; #X obj 408 237 /; #X obj 408 285 *~ 0; #X obj 408 261 phasor~ 0; #X msg 408 212 44100; #X obj 408 186 t b f; #X obj 447 285 r totsamps; #X text 278 273 sample loop for; #X text 280 285 test signal; #X obj 459 463 dac~; #X obj 568 156 r spd; #X obj 569 192 - 340; #X obj 569 220 / 340; #X obj 572 246 * -1; #X obj 570 274 * 44100; #X obj 408 333 tabread4~ array1; #X obj 55 191 soundfiler; #X obj 55 215 s totsamps1; #X msg 54 151 read -resize $1 array1 ; pd dsp 1; #X obj 52 116 openpanel; #X obj 53 70 bng 25 250 50 0 empty empty empty 20 8 0 8 -225280 -1 -1; #X text 189 400 Left right levels goes here; #X text 549 130 Sound speed comes with spd for doppler; #X text 30 42 Click to load a sound; #X obj 326 159 r totsamps1; #X obj 304 191 f; #X obj 304 219 s totsamps; #X obj 392 401 *~ 0.03; #X obj 456 404 *~ 0.03; #X obj 261 71 tgl 30 0 empty empty empty 0 -6 0 8 -258699 -1 -1 0 1 ; #X obj 262 132 moses 1; #X msg 292 158 bang; #X text 253 46 start & stop; #X connect 1 0 6 0; #X connect 2 0 4 0; #X connect 3 0 16 0; #X connect 4 0 3 0; #X connect 5 0 2 0; #X connect 6 0 5 0; #X connect 6 1 2 1; #X connect 7 0 3 1; #X connect 11 0 12 0; #X connect 12 0 13 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 15 0 2 0; #X connect 16 0 28 0; #X connect 16 0 29 0; #X connect 17 0 18 0; #X connect 19 0 17 0; #X connect 20 0 19 0; #X connect 21 0 20 0; #X connect 25 0 26 1; #X connect 26 0 27 0; #X connect 28 0 10 0; #X connect 29 0 10 1; #X connect 30 0 31 0; #X connect 31 0 27 0; #X connect 31 0 4 1; #X connect 31 1 32 0; #X connect 32 0 26 0;
more than likely it's your sample data.
try a sample that is completely silent. if the click goes away, it is likely your data.
also, try filling your array using the "sinesum" message from 2.control.examples/15.arrays.pd if this doesn't click, it is definitely your data.
note on the tabread4~ help page that tabread4~ requires guard points (although it doesn't say that explicitly). valid reads are from 1 to size-2. you are reading from 0 to (size-1) if you are just multiplying a phasor.
not thinking too hard about it (eg, i could easily be wrong), i think the guard points situation is that the sample at 0 should be a copy of the sample at size-2 and the sample at size-1 should be a copy of the sample at 1.
i guess to build a table like this from a normal non-guard-pointed sample, you could grow (suing a resize message) the given table by 2 samples, then set the sample at newsize-2 to the sample at 0, and the sample at newsize-1 to the sample at 1.
now if you index the table using (phasor*newsize-2)+1 you should get a clean loop, but unfortunately the sample will be offset by one sample. you could wither fix this in the indexing ( something like ((phasor*newsize-2)-1 mod (newsize-2))+1 ) or copy all of the samples over by one when you are fixing the table.
making some things to do this guard point generation and indexing would be a nice pair of abstractions to make available.
okay.. i think i just thought about that way too much.
you will be able to explain any huge errors in my reasoning, by knowing that i didn't test any of this. i've never noticed clicking when just using tabread4~ without doing all of this jiggery-pokery, as my samples are normally kind of noisy... but i always new i was being lazy.
by the way, instead of using a modified phasor~ to do one-shot, you could send a line~ object a "0, 1 <period>" message.
pix.
On Fri, 08 Aug 2003 10:05:17 +0200 Søren Bovbjerg sb@cvmt.dk wrote:
Hi
I am searching for a PD object (external/native) that can play samples from an array in both loop and "single shot" mode while being able to change playback speed.
So far I have been using a phasor~ (modified to create 1 or unlimited ramps) + tabread4~ but I am experiencing a very small click when the sound loops. The click is only noticable when the sample is a pure looping tone. The problem exists with both wav and aiff files so I don't
thing it is a "header" problem.
I have attached the sampler (without modified phasor~) I have been using
so far. It should run on any newer PD version.
Any ideas are welcome.
TIA
Soeren
pix wrote:
more than likely it's your sample data.
try a sample that is completely silent. if the click goes away, it is likely your data.
also, try filling your array using the "sinesum" message from 2.control.examples/15.arrays.pd if this doesn't click, it is definitely your data.
note on the tabread4~ help page that tabread4~ requires guard points (although it doesn't say that explicitly). valid reads are from 1 to size-2. you are reading from 0 to (size-1) if you are just multiplying a phasor.
not thinking too hard about it (eg, i could easily be wrong), i think the guard points situation is that the sample at 0 should be a copy of the sample at size-2 and the sample at size-1 should be a copy of the sample at 1.
i guess to build a table like this from a normal non-guard-pointed sample, you could grow (suing a resize message) the given table by 2 samples, then set the sample at newsize-2 to the sample at 0, and the sample at newsize-1 to the sample at 1.
now if you index the table using (phasor*newsize-2)+1 you should get a clean loop, but unfortunately the sample will be offset by one sample. you could wither fix this in the indexing ( something like ((phasor*newsize-2)-1 mod (newsize-2))+1 ) or copy all of the samples over by one when you are fixing the table.
making some things to do this guard point generation and indexing would be a nice pair of abstractions to make available.
okay.. i think i just thought about that way too much.
you will be able to explain any huge errors in my reasoning, by knowing that i didn't test any of this. i've never noticed clicking when just using tabread4~ without doing all of this jiggery-pokery, as my samples are normally kind of noisy... but i always new i was being lazy.
by the way, instead of using a modified phasor~ to do one-shot, you could send a line~ object a "0, 1 <period>" message.
pix.
On Fri, 08 Aug 2003 10:05:17 +0200 Søren Bovbjerg sb@cvmt.dk wrote:
Hi
I am searching for a PD object (external/native) that can play samples from an array in both loop and "single shot" mode while being able to change playback speed.
So far I have been using a phasor~ (modified to create 1 or unlimited ramps) + tabread4~ but I am experiencing a very small click when the sound loops. The click is only noticable when the sample is a pure looping tone. The problem exists with both wav and aiff files so I don't
thing it is a "header" problem.
I have attached the sampler (without modified phasor~) I have been using
so far. It should run on any newer PD version.
Any ideas are welcome.
TIA
Soeren
pix wrote:
more than likely it's your sample data.
try a sample that is completely silent. if the click goes away, it is likely your data.
Well, the data is fine :-) The loops play perfectly in any soundeditor. The number of samples is also the same (found with soundfiler printout), so the headers should be parsed coorectly.
note on the tabread4~ help page that tabread4~ requires guard points (although it doesn't say that explicitly). valid reads are from 1 to size-2. you are reading from 0 to (size-1) if you are just multiplying a phasor.
Yes, I though it was related to something like that. The click would (almost) go away if I used tabread~ rather than tabread4~ (no interpolation) but sometimes a metallic sound would occur at the loop point.
I will experiment a little bit with this and Franks suggestion.
Thanks, Soeren
Soeren, There's also susloop~.
Regards,
Chris.
On Fri, Aug 08, 2003 at 02:06:08PM +0200, S?ren Bovbjerg wrote:
pix wrote:
more than likely it's your sample data.
try a sample that is completely silent. if the click goes away, it is likely your data.
Well, the data is fine :-) The loops play perfectly in any soundeditor. The number of samples is also the same (found with soundfiler printout), so the headers should be parsed coorectly.
note on the tabread4~ help page that tabread4~ requires guard points (although it doesn't say that explicitly). valid reads are from 1 to size-2. you are reading from 0 to (size-1) if you are just multiplying a phasor.
Yes, I though it was related to something like that. The click would (almost) go away if I used tabread~ rather than tabread4~ (no interpolation) but sometimes a metallic sound would occur at the loop point.
I will experiment a little bit with this and Franks suggestion.
Thanks, Soeren
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
Hi Chris (and Pix)
Susloop~ is great and easy to usen, thanks!. However, using the supplied help example I get the exact same issue. I tried to copy the first 2 samples of the file to the end and then only play size-2 and the click is gone! So the problem is in tabread4~ :-(
Well, now I at least know how to fix the problem.
Cheers
Soeren
Chris McCormick wrote:
Soeren, There's also susloop~.
this point has been confusing to me, as well. and, like pix, i've been avoiding it because i am lazy :P
what if:
ie:
[phasor~] | | [arraysize] | | | [- 1] | | [*~] | [+~ 1] | [tabread4~]
wouldn't this give you your read from 1 to size-2? or is my math wrong? or do you really need to provide wrap-around points (guard points) for cleanly looping samples?
i'm going to have to look at the docs more when i get the chance.
also, Soeren: if it's small, could you send me a copy of the soundfile that's causing clicks?
--eric
pix wrote:
more than likely it's your sample data.
try a sample that is completely silent. if the click goes away, it is likely your data.
also, try filling your array using the "sinesum" message from 2.control.examples/15.arrays.pd if this doesn't click, it is definitely your data.
note on the tabread4~ help page that tabread4~ requires guard points (although it doesn't say that explicitly). valid reads are from 1 to size-2. you are reading from 0 to (size-1) if you are just multiplying a phasor.
not thinking too hard about it (eg, i could easily be wrong), i think the guard points situation is that the sample at 0 should be a copy of the sample at size-2 and the sample at size-1 should be a copy of the sample at 1.
i guess to build a table like this from a normal non-guard-pointed sample, you could grow (suing a resize message) the given table by 2 samples, then set the sample at newsize-2 to the sample at 0, and the sample at newsize-1 to the sample at 1.
now if you index the table using (phasor*newsize-2)+1 you should get a clean loop, but unfortunately the sample will be offset by one sample. you could wither fix this in the indexing ( something like ((phasor*newsize-2)-1 mod (newsize-2))+1 ) or copy all of the samples over by one when you are fixing the table.
making some things to do this guard point generation and indexing would be a nice pair of abstractions to make available.
okay.. i think i just thought about that way too much.
you will be able to explain any huge errors in my reasoning, by knowing that i didn't test any of this. i've never noticed clicking when just using tabread4~ without doing all of this jiggery-pokery, as my samples are normally kind of noisy... but i always new i was being lazy.
by the way, instead of using a modified phasor~ to do one-shot, you could send a line~ object a "0, 1 <period>" message.
pix.
On Fri, 08 Aug 2003 10:05:17 +0200 Søren Bovbjerg sb@cvmt.dk wrote:
Hi
I am searching for a PD object (external/native) that can play samples from an array in both loop and "single shot" mode while being able to change playback speed.
So far I have been using a phasor~ (modified to create 1 or unlimited ramps) + tabread4~ but I am experiencing a very small click when the sound loops. The click is only noticable when the sample is a pure looping tone. The problem exists with both wav and aiff files so I don't
thing it is a "header" problem.
I have attached the sampler (without modified phasor~) I have been using
so far. It should run on any newer PD version.
Any ideas are welcome.
TIA
Soeren
(ascii pseudo-patch)!!! yazaaahhh!!
------ http://USFamily.Net/info - Unlimited Internet - From $8.99/mo! ------
nope your maths is wrong(!) I'm pretty sure no guard points are needed, more so if the original pitch is not changed. multiply by [arraysize-3] then add one. by the way, it looks like phasor~ accepts non-signal data connected to its left inlet, but I seem to remember it not working when I used to do this. has it changed in v37? then why use sig~ (as it does in the help file) ever??? cheers,
matt
-=-=-=-=-=-=-=-=-=-=-=-=- http://www.loopit.org/ -=-=-=-=-=-=-=-=-=-=-=-=- ----- Original Message ----- From: "e skogen" eskogen@usfamily.net To: "pix" pix@test.at Cc: pd-list@iem.at Sent: Friday, August 08, 2003 2:37 PM Subject: Re: [PD] Play/loop and pitch change
this point has been confusing to me, as well. and, like pix, i've been avoiding it because i am lazy :P
what if:
- the phasor~ is going from 0 to 1
- the phasor~ is multiplied by ((the array size) - 1)
- this value is added to by one
ie:
[phasor~] | | [arraysize] | | | [- 1] | | [*~] | [+~ 1] | [tabread4~]
wouldn't this give you your read from 1 to size-2? or is my math wrong? or do you really need to provide wrap-around points (guard points) for cleanly looping samples?
i'm going to have to look at the docs more when i get the chance.
also, Soeren: if it's small, could you send me a copy of the soundfile that's causing clicks?
--eric
pix wrote:
more than likely it's your sample data.
try a sample that is completely silent. if the click goes away, it is likely your data.
also, try filling your array using the "sinesum" message from 2.control.examples/15.arrays.pd if this doesn't click, it is definitely your data.
note on the tabread4~ help page that tabread4~ requires guard points (although it doesn't say that explicitly). valid reads are from 1 to size-2. you are reading from 0 to (size-1) if you are just multiplying a phasor.
not thinking too hard about it (eg, i could easily be wrong), i think
the
guard points situation is that the sample at 0 should be a copy of the sample at size-2 and the sample at size-1 should be a copy of the sample at 1.
i guess to build a table like this from a normal non-guard-pointed
sample,
you could grow (suing a resize message) the given table by 2 samples,
then
set the sample at newsize-2 to the sample at 0, and the sample at newsize-1 to the sample at 1.
now if you index the table using (phasor*newsize-2)+1 you should get a clean loop, but unfortunately the sample will be offset by one sample.
you
could wither fix this in the indexing ( something like ((phasor*newsize-2)-1 mod (newsize-2))+1 ) or copy all of the samples
over
by one when you are fixing the table.
making some things to do this guard point generation and indexing would
be
a nice pair of abstractions to make available.
okay.. i think i just thought about that way too much.
you will be able to explain any huge errors in my reasoning, by knowing that i didn't test any of this. i've never noticed clicking when just using tabread4~ without doing all of this jiggery-pokery, as my samples are normally kind of noisy... but i always new i was being lazy.
by the way, instead of using a modified phasor~ to do one-shot, you
could
send a line~ object a "0, 1 <period>" message.
pix.
On Fri, 08 Aug 2003 10:05:17 +0200 Søren Bovbjerg sb@cvmt.dk wrote:
Hi
I am searching for a PD object (external/native) that can play samples from an array in both loop and "single shot" mode while being able to change playback speed.
So far I have been using a phasor~ (modified to create 1 or unlimited ramps) + tabread4~ but I am experiencing a very small click when the sound loops. The click is only noticable when the sample is a pure looping tone. The problem exists with both wav and aiff files so I don't
thing it is a "header" problem.
I have attached the sampler (without modified phasor~) I have been using
so far. It should run on any newer PD version.
Any ideas are welcome.
TIA
Soeren
(ascii pseudo-patch)!!! yazaaahhh!!
------ http://USFamily.Net/info - Unlimited Internet - From
$8.99/mo! ------
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
Hallo, SÞren Bovbjerg hat gesagt: // SÞren Bovbjerg wrote:
I am searching for a PD object (external/native) that can play samples from an array in both loop and "single shot" mode while being able to change playback speed.
Thomas Grill's xgroove from the xsample collection is fine for this. It's also available in the CVS on pure-data.sf.net
Frank Barknecht _ ______footils.org__
have you tried cooled~
-----Original Message----- From: pd-list-admin@iem.at [mailto:pd-list-admin@iem.at]On Behalf Of Soren Bovbjerg Sent: Friday, August 08, 2003 4:05 AM To: 'pd-list ' Subject: [PD] Play/loop and pitch change
Hi
I am searching for a PD object (external/native) that can play samples from an array in both loop and "single shot" mode while being able to change playback speed.
So far I have been using a phasor~ (modified to create 1 or unlimited ramps) + tabread4~ but I am experiencing a very small click when the sound loops. The click is only noticable when the sample is a pure looping tone. The problem exists with both wav and aiff files so I don't thing it is a "header" problem.
I have attached the sampler (without modified phasor~) I have been using so far. It should run on any newer PD version.
Any ideas are welcome.
TIA
Soeren
No, I have some requirements.
- It should be able to run on Irix
I would be very interested whether flext and/or xsample compile on irix.
I think it is quite possible to compile it. The major problem will be running it as an external, since n32 externals (which are prefered) will cause PD to crash when the _setup function is called. (I have been hacking/integrating externals directly into the PD code on Irix)
Perhaps I should see if I can locate the source of the crash.
Cheers Soeren
Hi Soren,
I would be very interested whether flext and/or xsample compile on irix.
I think it is quite possible to compile it. The major problem will be running it as an external, since n32 externals (which are prefered) will cause PD to crash when the _setup function is called. (I have been hacking/integrating externals directly into the PD code on Irix)
are there other binary formats (than n32) that work for pd externals? (why are n32 preferred?). Sorry, but my irix experience is very limited and lies far in the past....
best greetings, Thomas
are there other binary formats (than n32) that work for pd externals? (why are n32 preferred?). Sorry, but my irix experience is very limited and lies far in the past....
There are n32 and o32 formats. o32 is 'old' 32bit code and n32 is 'new' 32bit code. What the exact difference is I do not know, but the performance impact is big. In general n32 is just faster.
o32 external work on Irix, but they require that PD is compiled as o32 binary aswell :-(
/Soeren
Hi again,
Well, I did a raid on the PD source code and extracted the tabread4~ code. I added some start/end checking and managed to remove the clicking sound. I have created an external (Windows for now, until I get to work on monday and make the X port and some documentation aswell.... well, it works just like tabread4~). It is called lptabread4~ and can be downloaded at: http://www.vrmedialab.dk/~sb/pd
I tested the CPU usage (with 48 lptabread4~s and a phasor~at one time). It uses just about the same as normal tabread4~. Sometimes a bit less sometimes a bit more (around 1%, so who cares?). I have removed some of the original code that seemed to be handling the start and end situations. I think this is somewhat redundant now, but if anybody feels otherwise please drop me a note.
I hope this is usefull to somebody and comments are welcome :-)
Also if someone can think of a more clever name I am all ears!
Take care
Soeren