| Iain Duncan wrote:
> Let's assume that there is a controller function that handles all user
> input and output aside from audio. It will use api calls, and some
> queues to send data to and from other threads so that user input and
> output can be spread out over time. Ideally it will execute every kpass
> if csound has time, and update an output bus of data values that may be
> used by display threads. The question I have is how can I do the following.
>
>
> while( csound running )
>
> performksmps( csound );
>
> while ( messages on queue )
> if ( csound does not need the cpu )
> run a pass of controller function;
> else ( surrender to csound again )
>
> So I want to keep getting messages off the queue and dealing with them
> one by one ONLY if this will not run into the time needed for next kpass
> of csound. On the other hand, I definitely want to be able to deal with
> more than one message off the queue per kpass if I can, and ideally none
> if can't. Any suggestions?
This may not be trivial to implement, but as an alternative you could
try minimizing the CPU usage of processing the messages by limiting
it to simple things like reading or writing values, and maybe sometimes
triggering a score event. It is expected that much of the time no
messages are received anyway, and value changes are more common than
note events.
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |