[Cs-dev] message callback and python
Date | 2014-05-15 18:51 |
From | Andres Cabrera |
Subject | [Cs-dev] message callback and python |
Attachments | None None |
Hi, The csoundSetMessageCallback takes a va_list:Is there a way to set the message callback using the python API? http://csound.github.io/docs/api/group__MESSAGES.html#ga45c8cd03e278274966232a12a0297313 How can this be used in python? I'm trying to route the output from Csound ot the ipython notebook, and I've tried the std output facilities there, but they are not routing csound output... Cheers, Andrés |
Date | 2014-05-15 19:03 |
From | Steven Yi |
Subject | Re: [Cs-dev] message callback and python |
I think you can subclass CsoundCallbackWrapper and use that with the Csound object. I do this in Java and it works fine, and assume this will work in Python too. On Thu, May 15, 2014 at 1:51 PM, Andres Cabrera |
Date | 2014-05-15 19:05 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] message callback and python |
yes, it’s specially wrapped in the python_interface.i file, so you should be able to supply a python function: cs=csnd6.Csound() def mess(str): print "message: " + str cs.SetMessageCallback(mess) ======================== Dr Victor Lazzarini Senior Lecturer NUI Maynooth, Ireland victor dot lazzarini at nuim dot ie On 15 May 2014, at 18:51, Andres Cabrera |
Date | 2014-05-15 19:06 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] message callback and python |
no, in Python, it’s specially wrapped. See my example. ======================== Dr Victor Lazzarini Senior Lecturer NUI Maynooth, Ireland victor dot lazzarini at nuim dot ie On 15 May 2014, at 19:03, Steven Yi |
Date | 2014-05-15 19:17 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] message callback and python |
Attachments | None None |
Works perfectly, thanks for the quick answer. Cheers, Andrés On Thu, May 15, 2014 at 11:06 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: no, in Python, it’s specially wrapped. See my example. |