Can't you have a table of the functions you want to call
in the Python script and then send an index (and possibly parameters)
to look them up?
Victor
----- Original Message -----
From: Oeyvind Brandtsegg <obrandts@gmail.com>
Date: Monday, June 15, 2009 11:44 am
Subject: [Csnd] Re: Re: csound.GetChannel() for string channels
To: csound@lists.bath.ac.uk
> Ok. Thanks for the explanation.
> I'm trying to find a way that lets Csound call the host (e.g. as I've
> done with pycall), in an asynchronous manner so it is possible
> to use
> the performanceThread.
> The idea with using a string channel was to concatenate function calls
> as a string, then parse the string on the python side. Maybe not the
> best approach after all... back to the drawing board.
>
> best
> Oeyvind
>
> 2009/6/14 victor <Victor.Lazzarini@nuim.ie>:
> > Well, if this was C, you would use
> >
> > PUBLIC int csoundGetChannelPtr(CSOUND *,
> > MYFLT **p, const char *name,
> int type);
> >
> > But I don't think this wraps well in Python (hence the common
> > use of Csound::GetChannel()). So I guess this might be hard in
> > Python. I can try to look for a means of wrapping it by hand,
> > but it will be a while until I can get to it.
> >
> >
> > Victor
> >
> > ----- Original Message ----- From: "Oeyvind Brandtsegg"
> <obrandts@gmail.com>> To: "Csound mailing list address"
> <csound@lists.bath.ac.uk>> Sent: Saturday, June 13, 2009
> 11:02 PM
> > Subject: [Csnd] csound.GetChannel() for string channels
> >
> >
> >> By using csound.GetChannel() I can read the value stored in a chn
> >> channel, as long as the value is a float.
> >> Is there a special method to read a string stored in a chn
> channel ?
> >> Say, I want to dynamically manipulate a string in csound, and make
> >> this string readable from the host (e.g. Python),
> >> I tried to do
> >>
> >> (in the global instr)
> >> chn_S "pycallString", 3
> >>
> >> instr 2
> >> Snew sprintf "newitem %i", p4
> >> chnset Snew, "pycallString"
> >> endin
> >>
> >> Then I try to do this in Python:
> >> print "testing", cs.GetChannel("pycallString")
> >>
> >> .. and it prints
> >> "testing" 0.0
> >>
> >> I see that the API docs says
> >> MYFLT* CHNGET::arg
> >> So I should expect a float.
> >> What should I do to read a string from a chn channel via the API?
> >>
> >> all best
> >> Oeyvind
> >>
> >>
> >> 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"
Dr Victor Lazzarini, Senior Lecturer, Dept. of Music,National University of Ireland, Maynooth