Csound Csound-dev Csound-tekno Search About

[Csnd] python csound callback

Date2009-10-23 21:43
Fromfrancibal
Subject[Csnd] python csound callback
Hi All,
i would send more value from python to csound in real time. I have try
callback example from example folder of csound, but i am not able to
understand how can i pass more variables. I have also try shapes examples,
but my knowledge don't allow me to understand completly the mechanism.
Could someone please tell me if there are other doc that i can study, or,
maybe, show me some simple example ?

Thanks to all,

ciao,
fran.

Date2009-10-23 21:57
FromIain Duncan
Subject[Csnd] Re: python csound callback
On Fri, 2009-10-23 at 13:43 -0700, francibal wrote:
> Hi All,
> i would send more value from python to csound in real time. I have try
> callback example from example folder of csound, but i am not able to
> understand how can i pass more variables. I have also try shapes examples,
> but my knowledge don't allow me to understand completly the mechanism.
> Could someone please tell me if there are other doc that i can study, or,
> maybe, show me some simple example ?
> 
> Thanks to all,

You might want to consider using tables as a patch bay and writing to
tables from the api, I found this a lot easier to keep track of myself.
My python part just hooks controllers up to patch points, and writes to
the table, and the instruments read their patch values from the table.
They can even write back if you want to do something like see the
current value from a python gui.

Iain




Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-10-23 22:13
FromVictor Lazzarini
Subject[Csnd] Re: Re: python csound callback
Sounds complicated to me. What I suggest is just use the
Csound.SetChannel() method and the chn opcodes.

To retrieve values use Csound.GetChannel(). You can see these used
in shapes.py.

Victor


On 23 Oct 2009, at 21:57, Iain Duncan wrote:

> On Fri, 2009-10-23 at 13:43 -0700, francibal wrote:
>> Hi All,
>> i would send more value from python to csound in real time. I have  
>> try
>> callback example from example folder of csound, but i am not able to
>> understand how can i pass more variables. I have also try shapes  
>> examples,
>> but my knowledge don't allow me to understand completly the  
>> mechanism.
>> Could someone please tell me if there are other doc that i can  
>> study, or,
>> maybe, show me some simple example ?
>>
>> Thanks to all,
>
> You might want to consider using tables as a patch bay and writing to
> tables from the api, I found this a lot easier to keep track of  
> myself.
> My python part just hooks controllers up to patch points, and writes  
> to
> the table, and the instruments read their patch values from the table.
> They can even write back if you want to do something like see the
> current value from a python gui.
>
> Iain
>
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-10-23 22:30
FromIain Duncan
Subject[Csnd] Re: Re: Re: python csound callback
On Fri, 2009-10-23 at 22:13 +0100, Victor Lazzarini wrote:
> Sounds complicated to me. What I suggest is just use the
> Csound.SetChannel() method and the chn opcodes.
> 
> To retrieve values use Csound.GetChannel(). You can see these used
> in shapes.py.

You mean the tables method sounded complicated? In practise it turned
out to be really simple because the tables are totally use agnostic
patchbays. Anyone can write to them, anyone can read from them, at any
rate, in any context. All you need to do is make yourself a little chart
of your patchbay, which is exactly what anyone using a hardware patchbay
has to do. YMMV but I found it a very simple way to handle routing, and
bigger than that it's portable across applications. If your gui is
always a grid of controls writing to a grid of points, it's simplicity
to change which patch bay those controls are wired to. And it's easy to
dump or load your tables.

Then again, I think I think those pin based modular synths are pretty
nifty...so maybe I'm just an anachronism there. ;-)

Iain

> 
> Victor
> 
> 
> On 23 Oct 2009, at 21:57, Iain Duncan wrote:
> 
> > On Fri, 2009-10-23 at 13:43 -0700, francibal wrote:
> >> Hi All,
> >> i would send more value from python to csound in real time. I have  
> >> try
> >> callback example from example folder of csound, but i am not able to
> >> understand how can i pass more variables. I have also try shapes  
> >> examples,
> >> but my knowledge don't allow me to understand completly the  
> >> mechanism.
> >> Could someone please tell me if there are other doc that i can  
> >> study, or,
> >> maybe, show me some simple example ?
> >>
> >> Thanks to all,
> >
> > You might want to consider using tables as a patch bay and writing to
> > tables from the api, I found this a lot easier to keep track of  
> > myself.
> > My python part just hooks controllers up to patch points, and writes  
> > to
> > the table, and the instruments read their patch values from the table.
> > They can even write back if you want to do something like see the
> > current value from a python gui.
> >
> > Iain
> >
> >
> >
> >
> > Send bugs reports to this list.
> > To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> > "unsubscribe csound"
> 
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-10-23 22:48
FromVictor Lazzarini
Subject[Csnd] Re: python csound callback
Attachmentscsex.csd  csex.py  
Well, here's an example using the software bus, which I prefer to
use.


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Victor


On 23 Oct 2009, at 22:30, Iain Duncan wrote:

> On Fri, 2009-10-23 at 22:13 +0100, Victor Lazzarini wrote:
>> Sounds complicated to me. What I suggest is just use the
>> Csound.SetChannel() method and the chn opcodes.
>>
>> To retrieve values use Csound.GetChannel(). You can see these used
>> in shapes.py.
>
> You mean the tables method sounded complicated? In practise it turned
> out to be really simple because the tables are totally use agnostic
> patchbays. Anyone can write to them, anyone can read from them, at any
> rate, in any context. All you need to do is make yourself a little  
> chart
> of your patchbay, which is exactly what anyone using a hardware  
> patchbay
> has to do. YMMV but I found it a very simple way to handle routing,  
> and
> bigger than that it's portable across applications. If your gui is
> always a grid of controls writing to a grid of points, it's simplicity
> to change which patch bay those controls are wired to. And it's easy  
> to
> dump or load your tables.
>
> Then again, I think I think those pin based modular synths are pretty
> nifty...so maybe I'm just an anachronism there. ;-)
>
> Iain
>
>>
>> Victor
>>
>>
>> On 23 Oct 2009, at 21:57, Iain Duncan wrote:
>>
>>> On Fri, 2009-10-23 at 13:43 -0700, francibal wrote:
>>>> Hi All,
>>>> i would send more value from python to csound in real time. I have
>>>> try
>>>> callback example from example folder of csound, but i am not able  
>>>> to
>>>> understand how can i pass more variables. I have also try shapes
>>>> examples,
>>>> but my knowledge don't allow me to understand completly the
>>>> mechanism.
>>>> Could someone please tell me if there are other doc that i can
>>>> study, or,
>>>> maybe, show me some simple example ?
>>>>
>>>> Thanks to all,
>>>
>>> You might want to consider using tables as a patch bay and writing  
>>> to
>>> tables from the api, I found this a lot easier to keep track of
>>> myself.
>>> My python part just hooks controllers up to patch points, and writes
>>> to
>>> the table, and the instruments read their patch values from the  
>>> table.
>>> They can even write back if you want to do something like see the
>>> current value from a python gui.
>>>
>>> Iain
>>>
>>>
>>>
>>>
>>> Send bugs reports to this list.
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> "unsubscribe csound"
>>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe csound"
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"


Date2009-10-23 22:58
FromIain Duncan
Subject[Csnd] Re: Re: python csound callback
On Fri, 2009-10-23 at 22:48 +0100, Victor Lazzarini wrote:
> Well, here's an example using the software bus, which I prefer to
> use.

Thanks Victor. How do you save the software bus state to file? from the
host or from csound?

thank
Iain

> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> Victor On 23 Oct 2009, at 22:30, Iain Duncan wrote: > On Fri, 2009-10-23 at 22:13 +0100, Victor Lazzarini wrote: >> Sounds complicated to me. What I suggest is just use the >> Csound.SetChannel() method and the chn opcodes. >> >> To retrieve values use Csound.GetChannel(). You can see these used >> in shapes.py. > > You mean the tables method sounded complicated? In practise it turned > out to be really simple because the tables are totally use agnostic > patchbays. Anyone can write to them, anyone can read from them, at any > rate, in any context. All you need to do is make yourself a little > chart > of your patchbay, which is exactly what anyone using a hardware > patchbay > has to do. YMMV but I found it a very simple way to handle routing, > and > bigger than that it's portable across applications. If your gui is > always a grid of controls writing to a grid of points, it's simplicity > to change which patch bay those controls are wired to. And it's easy > to > dump or load your tables. > > Then again, I think I think those pin based modular synths are pretty > nifty...so maybe I'm just an anachronism there. ;-) > > Iain > >> >> Victor >> >> >> On 23 Oct 2009, at 21:57, Iain Duncan wrote: >> >>> On Fri, 2009-10-23 at 13:43 -0700, francibal wrote: >>>> Hi All, >>>> i would send more value from python to csound in real time. I have >>>> try >>>> callback example from example folder of csound, but i am not able >>>> to >>>> understand how can i pass more variables. I have also try shapes >>>> examples, >>>> but my knowledge don't allow me to understand completly the >>>> mechanism. >>>> Could someone please tell me if there are other doc that i can >>>> study, or, >>>> maybe, show me some simple example ? >>>> >>>> Thanks to all, >>> >>> You might want to consider using tables as a patch bay and writing >>> to >>> tables from the api, I found this a lot easier to keep track of >>> myself. >>> My python part just hooks controllers up to patch points, and writes >>> to >>> the table, and the instruments read their patch values from the >>> table. >>> They can even write back if you want to do something like see the >>> current value from a python gui. >>> >>> Iain >>> >>> >>> >>> >>> Send bugs reports to this list. >>> To unsubscribe, send email sympa@lists.bath.ac.uk with body >>> "unsubscribe csound" >> >> >> >> Send bugs reports to this list. >> To unsubscribe, send email sympa@lists.bath.ac.uk with body >> "unsubscribe csound" > > > > Send bugs reports to this list. > To unsubscribe, send email sympa@lists.bath.ac.uk with body > "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-10-24 07:21
FromVictor Lazzarini
Subject[Csnd] Re: Re: Re: python csound callback
I suppose you can do either way, but it might be easier to do it host- 
side.
On 23 Oct 2009, at 22:58, Iain Duncan wrote:

> On Fri, 2009-10-23 at 22:48 +0100, Victor Lazzarini wrote:
>> Well, here's an example using the software bus, which I prefer to
>> use.
>
> Thanks Victor. How do you save the software bus state to file? from  
> the
> host or from csound?
>
> thank
> Iain
>
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> "unsubscribe csound"
>> Victor On 23 Oct 2009, at 22:30, Iain Duncan wrote: > On Fri,  
>> 2009-10-23 at 22:13 +0100, Victor Lazzarini wrote: >> Sounds  
>> complicated to me. What I suggest is just use the >>  
>> Csound.SetChannel() method and the chn opcodes. >> >> To retrieve  
>> values use Csound.GetChannel(). You can see these used >> in  
>> shapes.py. > > You mean the tables method sounded complicated? In  
>> practise it turned > out to be really simple because the tables are  
>> totally use agnostic > patchbays. Anyone can write to them, anyone  
>> can read from them, at any > rate, in any context. All you need to  
>> do is make yourself a little > chart > of your patchbay, which is  
>> exactly what anyone using a hardware > patchbay > has to do. YMMV  
>> but I found it a very simple way to handle routing, > and > bigger  
>> than that it's portable across applications. If your gui is >  
>> always a grid of controls writing to a grid of points, it's  
>> simplicity > to change which patch bay those controls are wired to.  
>> And it's easy > to > dump or load your tables. > > Then again, I  
>> think I think those pin based modular synths are pretty >  
>> nifty...so maybe I'm just an anachronism there. ;-) > > Iain > >>  
>> >> Victor >> >> >> On 23 Oct 2009, at 21:57, Iain Duncan wrote: >>  
>> >>> On Fri, 2009-10-23 at 13:43 -0700, francibal wrote: >>>> Hi  
>> All, >>>> i would send more value from python to csound in real  
>> time. I have >>>> try >>>> callback example from example folder of  
>> csound, but i am not able >>>> to >>>> understand how can i pass  
>> more variables. I have also try shapes >>>> examples, >>>> but my  
>> knowledge don't allow me to understand completly the >>>>  
>> mechanism. >>>> Could someone please tell me if there are other doc  
>> that i can >>>> study, or, >>>> maybe, show me some simple  
>> example ? >>>> >>>> Thanks to all, >>> >>> You might want to  
>> consider using tables as a patch bay and writing >>> to >>> tables  
>> from the api, I found this a lot easier to keep track of >>>  
>> myself. >>> My python part just hooks controllers up to patch  
>> points, and writes >>> to >>> the table, and the instruments read  
>> their patch values from the >>> table. >>> They can even write back  
>> if you want to do something like see the >>> current value from a  
>> python gui. >>> >>> Iain >>> >>> >>> >>> >>> Send bugs reports to  
>> this list. >>> To unsubscribe, send email sympa@lists.bath.ac.uk  
>> with body >>> "unsubscribe csound" >> >> >> >> Send bugs reports to  
>> this list. >> To unsubscribe, send email sympa@lists.bath.ac.uk  
>> with body >> "unsubscribe csound" > > > > Send bugs reports to this  
>> list. > To unsubscribe, send email sympa@lists.bath.ac.uk with body  
>> > "unsubscribe csound"
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body  
> "unsubscribe csound"



Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"