On Fri, Nov 4, 2011 at 10:36 AM, Emanuel Rumpf <span dir="ltr"><<a href="mailto:xbran@web.de">xbran@web.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/11/2 Iain Duncan <<a href="mailto:iainduncanlists@gmail.com">iainduncanlists@gmail.com</a>>:<br>
<div class="im">> Hi, I'm working on an a project that I intend to do using the STK in a<br>
> callback style, but am hoping I can prototype the architecture in python<br>
</div>> ... ... ...<br>
<div class="im">> until I've figured out the various components and their responsibilities and<br>
> dependencies. Does anyone know of any kind of python library ( or method? )<br>
> that would let me simulate the way callback based STK apps using RTAudio<br>
> work? IE<br>
<br>
</div>You could implement the callbacks (and link it to STK) with Cython.<br>
(not CPython)<br>
This would require you to write a Cython-Header file for the called<br>
STK functions.<br>
Cython works very well for this, although you have to learn it, because<br>
it's neither real C nor real Python, but it's close.<br>
<br>
With some attentiveness, you could write rt- functions in Cython,<br>
because they compile to pure C / binary.<br></blockquote><div><br></div><div>I was wondering about that, has anyone here had real success with Cython?</div><div> <br>
<br>
> I want to have a python master callable that gets called once per<br>
> audio sample<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">No, Once per audio buffer, consisting of many (e.g. 128) samples.<br>
That's a better choice, usually, even if you do sample-by-sample<br>
processing within the function/callback.<br></blockquote><div><br></div><div>oops, yeah, I realizes I was mistaken there after sending it. That's what I'm doing, thanks</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

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