Csound Csound-dev Csound-tekno Search About

[Cs-dev] message callback and python

Date2014-05-15 18:51
FromAndres Cabrera
Subject[Cs-dev] message callback and python
AttachmentsNone  None  
Hi,

Is there a way to set the message callback using the python API?

The csoundSetMessageCallback takes a va_list:
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

Date2014-05-15 19:03
FromSteven Yi
SubjectRe: [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  wrote:
> Hi,
>
> Is there a way to set the message callback using the python API?
>
> The csoundSetMessageCallback takes a va_list:
> 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
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform
> available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://l

Date2014-05-15 19:05
FromVictor Lazzarini
SubjectRe: [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  wrote:

> Hi,
> 
> Is there a way to set the message callback using the python API?
> 
> The csoundSetMessageCallback takes a va_list:
> 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
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs_______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-05-15 19:06
FromVictor Lazzarini
SubjectRe: [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  wrote:

> 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  wrote:
>> Hi,
>> 
>> Is there a way to set the message callback using the python API?
>> 
>> The csoundSetMessageCallback takes a va_list:
>> 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
>> 
>> ------------------------------------------------------------------------------
>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>> Instantly run your Selenium tests across 300+ browser/OS combos.
>> Get unparalleled scalability from the best Selenium testing platform
>> available
>> Simple to use. Nothing to install. Get started now for free."
>> http://p.sf.net/sfu/SauceLabs
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>> 
> 
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2014-05-15 19:17
FromAndres Cabrera
SubjectRe: [Cs-dev] message callback and python
AttachmentsNone  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.
========================
Dr Victor Lazzarini
Senior Lecturer
NUI Maynooth, Ireland
victor dot lazzarini at nuim dot ie




On 15 May 2014, at 19:03, Steven Yi <stevenyi@gmail.com> wrote:

> 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 <mantaraya36@gmail.com> wrote:
>> Hi,
>>
>> Is there a way to set the message callback using the python API?
>>
>> The csoundSetMessageCallback takes a va_list:
>> 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
>>
>> ------------------------------------------------------------------------------
>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>> Instantly run your Selenium tests across 300+ browser/OS combos.
>> Get unparalleled scalability from the best Selenium testing platform
>> available
>> Simple to use. Nothing to install. Get started now for free."
>> http://p.sf.net/sfu/SauceLabs
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos.
> Get unparalleled scalability from the best Selenium testing platform available
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel


------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel