Hi list,
I'm having the following problem: if i start pd with -rt flag and try to load a soundfile using [sndfiler] I get huge xruns. jackd is started with -R
I noticed the same with a flext external I wrote, the second thread has a lower priority but it still too high if the main thread is started with -rt and if its CPU usatge is too high it can crash jackd
what is the correct procedure to load a soundfile in a threaded xruns-free way?
ciao, davide.
hi davide,
there's 2 externals in cvs called: tb/sndfiler grh/threadlib
but i am not sure if it's working in pd.0.40.
patrick
there's 2 externals in cvs called: tb/sndfiler grh/threadlib
yeah, I use them, but I'm still having xruns problems, and I wonder if it is normal or not..
do you get xruns loading a "normally" large soundfile (let' say a 16 seconds stereo wav file) while playing?
I suspect that the sndfiler thread is still too high (i start pd with the -rt flag).. i didn't mess with priorities or NICE levels, I only installed the ccrma rdt kernel and start jackd with -R and pd with -rt
ciao, davide.
Is there anyway of creating arrays using functions?
id like to create a graphical bandpass filter, controlled by a midi
fader....
here's a list of the different ways of writing tables i know: table1 sinesum 512 0.5 0.5 0.5 0.5; table2 cosinesum 512 0 1 table read file.txr table normalize table resize table 0 -1 1 -1 1 -1 1 -1 1 -1 table bounds 0 -2 10 2
this is a cite from another email, i wrote today. feel free to adjust it to yours:
PS: for some reason, your email appears to be a part of the thread "pd *is* a programming language". if this is by chance, ignore the following: it is considered bad style to randomly pick an email from the pd-list (or - in general - any mailing list) and "reply" to it with changing the subject and the body. read http://puredata.info/community/lists/netiquette (search for "threads") for more information on this.
Miguel Cardoso wrote:
Is there anyway of creating arrays using functions? id like to create a graphical bandpass filter, controlled by a midi fader....
[tabwrite] will do what you want. you have to manually walk through the x-axis though (unlike e.g. "sinesum").
you could plot either (or both) the idealized function or a measured one. (though the latter takes more time, so you probably won't want it)
mfg.asdr IOhannes
On Mon, 2006-10-02 at 17:53 +0200, Davide Morelli wrote:
there's 2 externals in cvs called: tb/sndfiler grh/threadlib
yeah, I use them, but I'm still having xruns problems, and I wonder if it is normal or not..
do you get xruns loading a "normally" large soundfile (let' say a 16 seconds stereo wav file) while playing?
I suspect that the sndfiler thread is still too high (i start pd with the -rt flag).. i didn't mess with priorities or NICE levels, I only installed the ccrma rdt kernel and start jackd with -R and pd with -rt
i doubt, it's related to the soundfiler thread ... but rather to pd's need to recompile the dsp chain, when the location of an array in memory changes ... so, when loading a soundfile, it will be read to memory in the helper thread, but the recompilation of the dsp chain still needs to be synchronous ... so there you have the dropouts ... so either "you don't want to load soundfiles during the performance" or "you don't want to use soundfiles in your performance, use synthesis instead" or "use miller's upsampling hack" ...
the only advantage of the sndfiler is, that it's able to read more file formats, since it's using libsndfile ...
for the dropouts, blame pd, not sndfiler ...
cheers ... tim
-- tim@klingt.org ICQ: 96771783 http://www.mokabar.tk
Nothing exists until or unless it is observed. An artist is making something exist by observing it. And his hope for other people is that they will also make it exist by observing it. I call it 'creative observation.' Creative viewing. William S. Burroughs
Isn't the way to solve this problem to preallocate some space and have sndfiler read into that, then swap the pointer?
On Mon, 02 Oct 2006 18:19:36 +0200 Tim Blechmann tim@klingt.org wrote:
On Mon, 2006-10-02 at 17:53 +0200, Davide Morelli wrote:
there's 2 externals in cvs called: tb/sndfiler grh/threadlib
yeah, I use them, but I'm still having xruns problems, and I wonder if it is normal or not..
do you get xruns loading a "normally" large soundfile (let' say a 16 seconds stereo wav file) while playing?
I suspect that the sndfiler thread is still too high (i start pd with the -rt flag).. i didn't mess with priorities or NICE levels, I only installed the ccrma rdt kernel and start jackd with -R and pd with -rt
i doubt, it's related to the soundfiler thread ... but rather to pd's need to recompile the dsp chain, when the location of an array in memory changes ... so, when loading a soundfile, it will be read to memory in the helper thread, but the recompilation of the dsp chain still needs to be synchronous ... so there you have the dropouts ... so either "you don't want to load soundfiles during the performance" or "you don't want to use soundfiles in your performance, use synthesis instead" or "use miller's upsampling hack" ...
the only advantage of the sndfiler is, that it's able to read more file formats, since it's using libsndfile ...
for the dropouts, blame pd, not sndfiler ...
cheers ... tim
-- tim@klingt.org ICQ: 96771783 http://www.mokabar.tk
Nothing exists until or unless it is observed. An artist is making something exist by observing it. And his hope for other people is that they will also make it exist by observing it. I call it 'creative observation.' Creative viewing. William S. Burroughs
On Tue, 2006-10-03 at 08:34 +0100, padawan12 wrote:
Isn't the way to solve this problem to preallocate some space and have sndfiler read into that, then swap the pointer?
sndfiler preallocates the buffer, and loads the sound into this memory region ... it's not only swapping one pointer to this memory region ... the whole dsp chain contains pointers to this region and has thus has to be updated ... the bottleneck is the pd kernel itself, not the external
i suggested two changes:
maybe one of these solutions will make it into the pd kernel before 2015 ...
so, blame pd, not sndfiler ...
cheers ... tim
-- tim@klingt.org ICQ: 96771783 http://www.mokabar.tk
Nothing exists until or unless it is observed. An artist is making something exist by observing it. And his hope for other people is that they will also make it exist by observing it. I call it 'creative observation.' Creative viewing. William S. Burroughs
On Mon, 2 Oct 2006, Tim Blechmann wrote:
i suggested two changes:
- observer objects to track these pointers
- add one more memory dereference to the dsp functions
maybe one of these solutions will make it into the pd kernel before 2015 ... so, blame pd, not sndfiler ...
I believe that Miller said that one ought to load sounds using [readsf~] together with [tabwrite~] in a high-sampling-rate subpatch if they want to load sounds in a realtime way. (really)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
I did. It's still the right way to do it...
cheers M
On Mon, Oct 02, 2006 at 11:30:07PM -0400, Mathieu Bouchard wrote:
On Mon, 2 Oct 2006, Tim Blechmann wrote:
i suggested two changes:
- observer objects to track these pointers
- add one more memory dereference to the dsp functions
maybe one of these solutions will make it into the pd kernel before 2015 ... so, blame pd, not sndfiler ...
I believe that Miller said that one ought to load sounds using [readsf~] together with [tabwrite~] in a high-sampling-rate subpatch if they want to load sounds in a realtime way. (really)
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - t?l:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montr?al QC Canada
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
On Mon, 2 Oct 2006, Miller Puckette wrote:
On Mon, Oct 02, 2006 at 11:30:07PM -0400, Mathieu Bouchard wrote:
I believe that Miller said that one ought to load sounds using [readsf~] together with [tabwrite~] in a high-sampling-rate subpatch if they want to load sounds in a realtime way. (really)
I did. It's still the right way to do it...
Ok, so please someone make an abstraction that does this so that users don't have to think that they might be doing this.
I might suggest calling it [soundfiler] but the name is already taken and not overridable -- except by deleting code.
I might suggest not calling it [soundfiler] because of this and because "filer" doesn't mean the same in [soundfiler] and in English. (who knows, maybe it's in UCSD's house style?)
So, everyone, what should [soundfiler] be renamed to?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
I did. It's still the right way to do it...
So, everyone, what should [soundfiler] be renamed to?
I'd suggest to call it [the_right_way_to_load_soundfiles] so that noone uses it accidentally. Too bad that " can't easily be used in abstraction names.
greetings, Thomas
On Tue, 2006-10-03 at 01:27 -0400, Mathieu Bouchard wrote:
On Mon, 2 Oct 2006, Miller Puckette wrote:
On Mon, Oct 02, 2006 at 11:30:07PM -0400, Mathieu Bouchard wrote:
I believe that Miller said that one ought to load sounds using [readsf~] together with [tabwrite~] in a high-sampling-rate subpatch if they want to load sounds in a realtime way. (really)
I did. It's still the right way to do it...
Ok, so please someone make an abstraction that does this so that users don't have to think that they might be doing this.
writing an abstraction doing this has two problems:
one due to performance reasons. if the upsampling is too high, you'll still have problems ... the upsampling factor will depend on cpu speed, hd speed, hd load, physical position of the wave file if memory ...
so it might win the prize for the 'least scalable hack' in pd history ... unless someone tries to implement bogosort for sorting lists
(i really don't want to sound rude, but i guess, if no one talks about the problems, this will be considered as solution by the pd community and there will never be a really scalable solution)
tim
-- tim@klingt.org ICQ: 96771783 http://www.mokabar.tk
Cheat your landlord if you can and must, but do not try to shortchange the Muse. It cannot be done. You can't fake quality any more than you can fake a good meal. William S. Burroughs
On Tue, 2006-10-03 at 11:55 +0200, Tim Blechmann wrote:
writing an abstraction doing this has two problems:
- forget about the -resize option ... it won't work
btw: it'd be nice, if [readsf~] would print out the number of samples like [sndfiler]. since the number is in the header (afaik), it shouldn't cause to much troubles to implement this.
roman
___________________________________________________________ Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
I didn't mean to blame sndfiler, I was just asking for the right way to do load a soundfile.. ...I thought it had something to do with threads priority because I had a similar problem with a flext external I wrote: if I start pd with -rt and run the second thread and this thread is very cpu expansive it gives droputs and can even crash jack! i and I took care to set a low thread priority which seems to stay higher than normal anyway..
anyway, back to the original problem: I will try Derek's samplemapper and Miller's workaround...
ciao, davide.
Hallo, padawan12 hat gesagt: // padawan12 wrote:
Isn't the way to solve this problem to preallocate some space and have sndfiler read into that, then swap the pointer?
When I was in Graz recently Peter Plessas told me about a little trick he got from Thomas Musil: You can preload the start of a long file into a table in advance, play this with tabplay~ etc. and then seemlessly switch over to [readsf~] on the go, but start reasf~-playing with an offset matching the table-size.
This idea is illustrated in attached abstraction "gigaplay~.pd" (because GigaSampler uses a similar idea and even has a patent on it, duh.)
It's good to be in Graz from time to time not only for things like this. ;)
Frank Barknecht _ ______footils.org_ __goto10.org__
Nice workaround Frank, thanks for sharing!
~Kyle
On 10/3/06, Frank Barknecht fbar@footils.org wrote:
Hallo, padawan12 hat gesagt: // padawan12 wrote:
Isn't the way to solve this problem to preallocate some space and have sndfiler read into that, then swap the pointer?
When I was in Graz recently Peter Plessas told me about a little trick he got from Thomas Musil: You can preload the start of a long file into a table in advance, play this with tabplay~ etc. and then seemlessly switch over to [readsf~] on the go, but start reasf~-playing with an offset matching the table-size.
This idea is illustrated in attached abstraction "gigaplay~.pd" (because GigaSampler uses a similar idea and even has a patent on it, duh.)
It's good to be in Graz from time to time not only for things like this. ;)
Ciao
Frank Barknecht _ ______footils.org_ __goto10.org__
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Hi Davide,
this issue with sound interruptions from soundfiler has been known for years, it' still one of PD's big shortcomings. My workaround has always been to preload my sounds.
Have a look at my samplemapper abstractions for one one to deal with that a bit more elegantly:
https://puredata.info/Members/derek/samplemapper.zip/view
best, d.
Davide Morelli wrote:
there's 2 externals in cvs called: tb/sndfiler grh/threadlib
yeah, I use them, but I'm still having xruns problems, and I wonder if it is normal or not..
do you get xruns loading a "normally" large soundfile (let' say a 16 seconds stereo wav file) while playing?
I suspect that the sndfiler thread is still too high (i start pd with the -rt flag).. i didn't mess with priorities or NICE levels, I only installed the ccrma rdt kernel and start jackd with -R and pd with -rt
ciao, davide.
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list