Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Python Bindings Question

Date2008-02-26 13:15
FromMichael Gogins
Subject[Csnd] Re: Python Bindings Question
Did you look at and try the scripts in the Csound installation examples directory?

csnd.setPythonMessageCallback(), as I recall, answers your first question.

I haven't tried the MIDI interface, but I have used the native Csound message input interface in Python. If you can't get the MIDI interface to work, you could use a Python MIDI library, parse out data, and use the Csound message input interface.

Hope this helps,
Mike

-----Original Message-----
>From: Greg Thompson 
>Sent: Feb 26, 2008 1:47 AM
>To: Michael Gogins , Developer discussions 
>Subject: Python Bindings Question
>
>For a few days now, I've been asking around.  I'm wondering how to do  
>the following using the python interface to Csound.  So far, I  
>haven't been able to find anyone who knows the answer.  Is it even  
>possible?  Maybe I should be asking that instead.
>
>1 - how to capture stdout/stderr messages from the Csound instance
>
>	C API method
>   PUBLIC void csoundSetMessageCallback(CSOUND *,
>                             void (*csoundMessageCallback_)(CSOUND *,
>                                                            int attr,
>                                                            const  
>char *format,
>                                                            va_list  
>valist));
>
>2 - send midi events
>
>	C API method
>   PUBLIC void csoundSetExternalMidiReadCallback(CSOUND *,
>             int (*func)(CSOUND *, void *userData,
>                                   unsigned char *buf, int nBytes));
>
>
>3 - Is there a detailed manual on the python interface?
>
>thanks
>greg