| You could try turning off Python garbage collection while you are peforming. I don't think this will cause any real memory problems on a reasonably modern personal computer. Memory will build up and get paged out, but you won't run out of memory. If the performance thread has a high enough priority I don't think the paging will cause a problem either.
Regards,
Mike
-----Original Message-----
From: Oeyvind Brandtsegg
Sent: Oct 13, 2005 12:24 PM
To: csound@lists.bath.ac.uk
Subject: Re: [Csnd] varga csound5 python opcodes
Thanks.
I'm wondering about the best place to put a clock for generating precise rhythms, when woring with Python and Csound in realtime.
I started implementing the clock in python, as some of my algorithms in python will generate rhythm data. But then I realized that python does not seem to have rock solid timing (understatement), maybe it's better with the pygame timer but I certainly could not use Python's time module.
Now, I've implemented a clock and rhythmic trigger in csound, calling python for data (data that e.g. determines the delta time until the next rhythm trigger should happen).
Since csound maybe will wait for python to return the value, I wonder if this is a bad way to design a stable clock for rhythm generation. Also, if the python process is complicated (takes a long time to compute), will this create discontinuities in Csound's audio output ?
If my current approach does not work well, the next thing I'd try is to just send a query (via OSC or otherwise) from the csound clock to a python function, asking for the next timing value. The return value would then be a "timestamp", hopefully returning to csound before it's activation time (or the event would have to be discarded).
If anyone has ideas on how to implement a stable clock for realtime algorithmic composition, or views on my approach as described above, I'm most grateful for input on this.
Oeyvind
> From: Michael Gogins [gogins@pipeline.com]
>
> Same thread.
>
>
> -----Original Message-----
> From: Oeyvind Brandtsegg
>
> While I'm at it:
> When I call a python function from csound, does csound wait for python to return from this function, or are the python function executed sort of in it's own thread.
>
|