Csound Csound-dev Csound-tekno Search About

[Csnd] python csound api question

Date2014-09-26 05:34
Fromforrest curo
Subject[Csnd] python csound api question
I've been dizzying myself with documentation re the python csnd6 module, looking for whatever might be done with that -- & found:

"CreateGlobalVariable(self, *args)"

Is that merely a global csound variable? Or could we get float variables that python and a csound instance both recognize as equivalent?

Would that be a way to get and set csound variable values without going through 'channels'? Or an example of wistful thinking on my part?

Forrest Curo
San Diego, US

Date2014-09-29 05:16
FromSteven Yi
SubjectRe: [Csnd] python csound api question
If I remember correctly, I think CreateGlobalVariable is really meant
for use by plugins to keep track of application-wide data that's bound
to a Csound instance.  I don't think using it would be good for users
and doesn't have to do with a global var in Csound orchestra code.

You can export global vars from csound to a channel using
chnexport.[1]  This allows you use global var within your csound code,
but gives access to the var from a host language via channels.

[1] - http://csound.github.io/docs/manual/chnexport.html

On Thu, Sep 25, 2014 at 9:34 PM, forrest curo  wrote:
> I've been dizzying myself with documentation re the python csnd6 module,
> looking for whatever might be done with that -- & found:
>
> "CreateGlobalVariable(self, *args)"
>
> Is that merely a global csound variable? Or could we get float variables
> that python and a csound instance both recognize as equivalent?
>
> Would that be a way to get and set csound variable values without going
> through 'channels'? Or an example of wistful thinking on my part?
>
> Forrest Curo
> San Diego, US

Date2014-09-29 06:25
Fromforrest curo
SubjectRe: [Csnd] python csound api question
yeah, I'd been thinking of using a host language to generate notes from outside csound and send them in for csound to crank out audio from them.

But the purpose is served just fine if I generate the notes (via python opcodes for example) directly from inside csound. It looks like the same division of labor between composing & executing, except that turning the system inside out this way eliminates the problem of synchronizing messages to/from python with k-rate processes in csound.

I was surprized & excited to see how python code could run & controll csound via the api; but the inside stuff just looks simpler to coordinate... [Csound itself could keep me learning a very long time!]

On Sun, Sep 28, 2014 at 9:16 PM, Steven Yi <stevenyi@gmail.com> wrote:
If I remember correctly, I think CreateGlobalVariable is really meant
for use by plugins to keep track of application-wide data that's bound
to a Csound instance.  I don't think using it would be good for users
and doesn't have to do with a global var in Csound orchestra code.

You can export global vars from csound to a channel using
chnexport.[1]  This allows you use global var within your csound code,
but gives access to the var from a host language via channels.

[1] - http://csound.github.io/docs/manual/chnexport.html

On Thu, Sep 25, 2014 at 9:34 PM, forrest curo <treegestalt@gmail.com> wrote:
> I've been dizzying myself with documentation re the python csnd6 module,
> looking for whatever might be done with that -- & found:
>
> "CreateGlobalVariable(self, *args)"
>
> Is that merely a global csound variable? Or could we get float variables
> that python and a csound instance both recognize as equivalent?
>
> Would that be a way to get and set csound variable values without going
> through 'channels'? Or an example of wistful thinking on my part?
>
> Forrest Curo
> San Diego, US


Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"