[PD] readanysf~ v0.30

august august at alien.mur.at
Mon May 25 21:45:10 CEST 2009



> Yo august - I'm working on a variant of the anysndfiler patch you
> included that can function as a drop-in replacement for soundfiler.
> I'm experiencing some weirdness though - it seems to work ~50% of the
> time but the other times it hard-locks my system and spits out
> "couldn't get a frame" messages to the console (with syslogd taking up
> most of my CPU).
> 
> I'm generally opening MP3 files from my collection.  Printing the
> "time so far" message, it seems to hang at some period and just stick
> there (e.g. 40s).
> 
> Let me know if I can provide any other info - I'll see what else I can
> figure out in the meantime.
> 
> Patches attached...
> I'm super excited to be so close to having this : )  Thanks again for
> your work on it thus far!

cool.  I'm really glad if it is useful for some people.   

I was just messing around with that anysndfiler patch one night to see
what might be needed for such a thing.   So, it is hardly complete.

I looked at your patch briefly and one thing that comes to attention
immediately is the resampling switch~ statement.   Because readanysf~
reads from unpredictable things like your hard disk or the internet, it
can never really know for sure if it will receive the intended amount of
audio samples every dsp block.   So, what I do is, instead of blocking
the dsp call and hearing a click, I fill the missing audio samples with
zeros.

When you apply the switch~ statement that runs that subpatch at a higher
frequency than the main pd patch, it could happen that you attempt read
faster than what your computer can read and decode from your harddrive.
And, this is what is happening when you see a "couldn't get a frame"
message.   It means readanysf~'s internal buffer is empty and needs time
to fill the buffer.  Every time you see that message, you can be sure
that your audio has been "corrupted" with zeros.

If you get rid of the loadbang to the switch statement in the patch,
what happens then?   It should work much better.

I'm not sure, but I think what is needed here is a blocking,
non-threading readanysf~  to make it work properly.   I might be able to
look more into this later. 

best -august.




More information about the Pd-list mailing list