Re: [LAD] prototyping callback based architecture in python?

From: Iain Duncan <iainduncanlists@email-addr-hidden>
Date: Fri Nov 04 2011 - 19:43:33 EET

On Fri, Nov 4, 2011 at 10:36 AM, Emanuel Rumpf <xbran@email-addr-hidden> wrote:

> 2011/11/2 Iain Duncan <iainduncanlists@email-addr-hidden>:
> > Hi, I'm working on an a project that I intend to do using the STK in a
> > callback style, but am hoping I can prototype the architecture in python
> > ... ... ...
> > until I've figured out the various components and their responsibilities
> and
> > dependencies. Does anyone know of any kind of python library ( or
> method? )
> > that would let me simulate the way callback based STK apps using RTAudio
> > work? IE
>
> You could implement the callbacks (and link it to STK) with Cython.
> (not CPython)
> This would require you to write a Cython-Header file for the called
> STK functions.
> Cython works very well for this, although you have to learn it, because
> it's neither real C nor real Python, but it's close.
>
> With some attentiveness, you could write rt- functions in Cython,
> because they compile to pure C / binary.
>

I was wondering about that, has anyone here had real success with Cython?

> I want to have a python master callable that gets called once per
> audio sample

> No, Once per audio buffer, consisting of many (e.g. 128) samples.
> That's a better choice, usually, even if you do sample-by-sample
> processing within the function/callback.
>

oops, yeah, I realizes I was mistaken there after sending it. That's what
I'm doing, thanks

>
> > and has a way of sending out it's results to the audio
> > subsystem.
> >
> > I've found a bunch of python audio libs but it doesn't seem like they
> work
> > that way,
>
> Note:
> Don't use python threads (as implemented in CPython), they do not
> work for this.
> You might have more luck with the more recent multiprocessing module,
> ( http://docs.python.org/library/multiprocessing.html )
> It was introduced to circumvent some of PythonThreads limitations.
>
>
thanks for the tips!

iain

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Fri Nov 4 20:15:02 2011

This archive was generated by hypermail 2.1.8 : Fri Nov 04 2011 - 20:15:02 EET