'ncase anyone is interested. ongoing work with this external. basically, I use pd for various things and need a similar interface to different filetypes.
an almost beta version is at:
http://aug.ment.org/software/readanysf~0.05.tar.gz
the only known bug at the moment is that if you try and remove one of the readanysf~ objects from the canvas, something is likely to explode.
this has something to do with how flext handles threading, i think, but am not sure.
is there something like a pthreads_join in flext? i think that would help.
ShouldExit() and StopThreads() simply doesnt do it for me.
features:
pcm and time seeking
looping (internally and should be sample accurate)
plays aiff, wav, nextstep (same code as readsf~ with 16,24
and 32bit float support) plus vorbis and mp3 (using madlib)
near future: add flac support (anyone have a good simple flac code?) conifigure and make scripts
distant future: http streaming (perhaps) convert to pure c++ without flext if i cant get flext to work with the threading. would be a shame.
any suggestions? -tsugua.
Hallo, august hat gesagt: // august wrote:
an almost beta version is at:
http://aug.ment.org/software/readanysf~0.05.tar.gz
features:
pcm and time seeking looping (internally and should be sample accurate) plays aiff, wav, nextstep (same code as readsf~ with 16,24 and 32bit float support) plus vorbis and mp3 (using madlib)
Cool, just what I'm looking for. What about adding modplug and sidplay ;)
BTW: Do you use the cool libsndfile for loading wav/aiff?
Frank Barknecht _ ______footils.org__
Cool, just what I'm looking for. What about adding modplug and sidplay ;)
ok, know any good libs? preferabley a lib that works under windows and mac too.
BTW: Do you use the cool libsndfile for loading wav/aiff?
no, I started with my own code and then switched to the readsf code, mixed with some functions from sndlib.
actually, if there are going to be lots of audio codecs, maybe it would be good to migrate to a plugin model similar to alsaplayer or mplayer.
-august.
Hallo, august hat gesagt: // august wrote:
Cool, just what I'm looking for. What about adding modplug and sidplay ;)
ok, know any good libs? preferabley a lib that works under windows and mac too.
Mikmod seems to be used quite often: http://www.mikmod.org
A sidplayer was more a joke because sids are not really soundfiles, but it would be a cool standalone external
Frank Barknecht _ ______footils.org__
Hi August, i don't know what your specific problem is with flext threading, so i tried to compile your package. It's a but difficult for me since it's apparently linux only, but i'll give it a try nonetheless.
However, there's one interesting thing and i'm really surprised that it works for you at all....
void readanysf::m_signal(int n, float *const *in, float *const *out) { float *outs1 = out[0]; float *outs2 = out[1];
mutex.Lock(); if (state == STATE_STREAM) {
float buf[n*2]; // always multiply by the number of audio signal outlets
n is not constant since it's a function argument, and you try to reserve an array of float with that. Amazing that your compiler digests that (mine doesn't) ... it's definitely not C++ as i know it. It may be better (or more portable at least) to use the flext m_dsp virtual function which is called on every dsp on/off to reserve your buffer with new.
Please note that you can use flext without its threading functionality and build your own stuff with pthreads as usual. Anyway, i'll have a look at it.
greetings, Thomas
----- Original Message ----- From: "august" august@alien.mur.at To: pd-list@iem.kug.ac.at Sent: Monday, April 14, 2003 5:17 PM Subject: [PD] readanysf~ almost beta
'ncase anyone is interested. ongoing work with this external. basically, I use pd for various things and need a similar interface to different filetypes.
an almost beta version is at:
http://aug.ment.org/software/readanysf~0.05.tar.gz
the only known bug at the moment is that if you try and remove one of the readanysf~ objects from the canvas, something is likely to explode.
this has something to do with how flext handles threading, i think, but am not sure.
is there something like a pthreads_join in flext? i think that would help.
ShouldExit() and StopThreads() simply doesnt do it for me.
features:
pcm and time seeking looping (internally and should be sample accurate) plays aiff, wav, nextstep (same code as readsf~ with 16,24 and 32bit float support) plus vorbis and mp3 (using madlib)
near future: add flac support (anyone have a good simple flac code?) conifigure and make scripts
distant future: http streaming (perhaps) convert to pure c++ without flext if i cant get flext to work with the threading. would be a shame.
any suggestions? -tsugua.
PD-list mailing list PD-list@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
It's a but difficult for me since it's apparently linux only, but i'll give it a try nonetheless.
yeah, sorry. never compiled anything under windows. if you do get it to compile, can you send me patches and a makefile?
However, there's one interesting thing and i'm really surprised that it works for you at all....
...
float buf[n*2]; // always multiply by the number of audio signal outlets
n is not constant since it's a function argument, and you try to reserve an array of float with that. Amazing that your compiler digests that (mine doesn't) ... it's definitely not C++ as i know it.
im not sure, but i think it treats the float[] kindof like a new() call.
but, as you can see, I learned to program from a Sams "teach yourself C++ in 21days". it took a bit longer than 21 days and i skipped alot of chapters.
It may be better (or more portable at least) to use the flext m_dsp virtual function which is called on every dsp on/off to reserve your buffer with new.
ok, looking at fftease now to see how you use it. should make it a bit faster too.
Please note that you can use flext without its threading functionality and build your own stuff with pthreads as usual. Anyway, i'll have a look at it.
I would hate to do that, cause that would make it *nix specific and sort of defeat the purpose of having the flext lib in between.
thanks for the support - august.
hi August,
It's a but difficult for me since it's apparently linux only, but i'll
give
it a try nonetheless.
yeah, sorry. never compiled anything under windows. if you do get it to compile, can you send me patches and a makefile?
There are only a few changes necessary (i guess only replacing unistd.h and all sys/* by io.h), and i had to uncomment the code for mad which i currently don't have.
However, there's one interesting thing and i'm really surprised that it works for you at all....
...
float buf[n*2]; // always multiply by the number of audio signal
outlets
n is not constant since it's a function argument, and you try to reserve
an
array of float with that. Amazing that your compiler digests that (mine doesn't) ... it's
definitely
not C++ as i know it.
im not sure, but i think it treats the float[] kindof like a new() call.
that's really not a bad feature, but a bit inefficient in a dsp function.
Oh i now remember a problem with readanysf~. When stopping a file which could not be read (format not recognized) your external crashes.
best greetings, Thomas
There are only a few changes necessary (i guess only replacing unistd.h and all sys/* by io.h), and i had to uncomment the code for mad which i currently don't have.
ok.
im not sure, but i think it treats the float[] kindof like a new() call.
that's really not a bad feature, but a bit inefficient in a dsp function.
yeah. switching it over now to use the m_dsp.
Oh i now remember a problem with readanysf~. When stopping a file which could not be read (format not recognized) your external crashes.
if you mean it crashed when you click "stop" or "pause" than I got that one just now. otherwise, it could be because of the lack of madlib.
looking into it. -gust.
On Mon, 14 Apr 2003, august wrote:
float buf[n*2]; // always multiply by the number of audio signal outlets n is not constant since it's a function argument, and you try to reserve an array of float with that. Amazing that your compiler digests that (mine doesn't) ... it's definitely not C++ as i know it.
im not sure, but i think it treats the float[] kindof like a new() call.
This is a GCC-specific extension to C/C++; it's a shortcut for alloca(), which does its allocation on the stack, while new and malloc() do their allocation on the heap; alloca() blocks disappear automatically upon returning from a function. new/malloc() blocks need to be deallocated.
What compiler are you using?
(note: I'm using quite a bit of GCC-specific features in my code, which is usually OK on Linux and MacOSX and Cygwin, but not good elsewhere)
Mathieu Bouchard http://artengine.ca/matju
Hi.
Can your code read markers too when available?
Regards,
Maurizio Umberto Puxeddu.
Hi August, the main problem of your code is that the function m_child is stuck with waiting for the conditional (cond.Wait() ) when you want to delete object. On the other hand, there _was_ a flext bug when terminating such incooperative threads. (which is in cvs tomorrow morning)
There a two ways to make your code cleaner:
iteratives once in a while. Then you can also use ShouldExit()
just before StopThreads() in your destructor
best greetings, Thomas
----- Original Message ----- From: "august" august@alien.mur.at To: pd-list@iem.kug.ac.at Sent: Monday, April 14, 2003 5:17 PM Subject: [PD] readanysf~ almost beta
'ncase anyone is interested. ongoing work with this external. basically, I use pd for various things and need a similar interface to different filetypes.
an almost beta version is at:
http://aug.ment.org/software/readanysf~0.05.tar.gz
the only known bug at the moment is that if you try and remove one of the readanysf~ objects from the canvas, something is likely to explode.
this has something to do with how flext handles threading, i think, but am not sure.
is there something like a pthreads_join in flext? i think that would help.
ShouldExit() and StopThreads() simply doesnt do it for me.
features:
pcm and time seeking looping (internally and should be sample accurate) plays aiff, wav, nextstep (same code as readsf~ with 16,24 and 32bit float support) plus vorbis and mp3 (using madlib)
near future: add flac support (anyone have a good simple flac code?) conifigure and make scripts
distant future: http streaming (perhaps) convert to pure c++ without flext if i cant get flext to work with the threading. would be a shame.
any suggestions? -tsugua.
PD-list mailing list PD-list@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
Hi August, the main problem of your code is that the function m_child is stuck with waiting for the conditional (cond.Wait() ) when you want to delete object. On the other hand, there _was_ a flext bug when terminating such incooperative threads. (which is in cvs tomorrow morning)
There a two ways to make your code cleaner:
- in m_child use cond.TimedWait() with 100 ms or so, so that your loop
iteratives once in a while. Then you can also use ShouldExit()
- when you want to stick with your quit, you can also signal the conditional
just before StopThreads() in your destructor
thats it! your a mfg. mother fucking genious!
works beautifully now.
well, at least unter linux.
if your in vienna, i can treat you fro a beer tonight (if you are free)