| Hi Chet.
Thanks everyone for all the suggestions on this. I'm coming down the
homestretch, and just about flipped over my handlebars, so to speak,
when I realized how this limitation would affect my OSC
implementation.
My solution was to do all the strings in Python except for the instrument name.
For each OSC output the user requests, I create an instrument with a
unique name based on the instrument number in my program. That way
the user can also tell the program how many pfields that instrument
should have.
The obvious limitation is that the user can only send numbers through
OSC, since the instrument name is a string, but there isn't much
opportunity to send strings with my program anyway. Any user who
needs to send strings could code a separate Csound instrument, my
program allows that too.
-Chuckk
On Mon, Feb 9, 2009 at 5:03 PM, Chester Udell wrote:
> If you find a solution, please send your method to the list. Handling
> multiple parameters in OSC-python/Csound is not straightforward and I would
> be interested to see a good solution or structure. Some good suggestions
> have already been proposed.
> Best,
> -Chet
> On Feb 9, 2009, at 9:56 AM, Michael Gogins wrote:
>
>> Have you tried passing a single string containing all parameters
>> divided by some delimiting character, then parsing out the parameters
>> in your instrument?
>>
>> Hope this helps,
>> Mike
>>
>> On Mon, Feb 9, 2009 at 9:50 AM, victor wrote:
>>>
>>> Well, there is a possible hack: use an instrument
>>> just to set string channels
>>>
>>> instr 1
>>>
>>> S1 = p4
>>> if p5 == 0 then
>>> chnset S1, "hostname"
>>> elseif p5 == 1 then
>>> chnset S1, "path"
>>> endif
>>> turnoff
>>>
>>> endin
>>>
>>>
>>> i1 0 1 "blobs.here.there.everywhere" 0
>>> i1 0 1 "/data/path" 1
>>>
>>> etc, etc
>>>
>>> Absolutely not tested.
>>>
>>> Victor
>>>
>>> ----- Original Message ----- From: "Chuckk Hubbard"
>>>
>>> To: "Csound List"
>>> Sent: Monday, February 09, 2009 2:35 PM
>>> Subject: [Csnd] OSC and string p-fields
>>>
>>>
>>>> Hi, I'd appreciate any help, I really need a solution. I'm almost
>>>> ready to share my sequencer, after 15 months, but I want to provide
>>>> the option of OSC output for those who prefer another environment than
>>>> Csound or Soundfonts.
>>>>
>>>> The problem is that Csound, according to i.html from the manual, can
>>>> only have one string per score line. OSC requires a hostname and
>>>> path, as well as, for my purposes, a named instrument. I'm using the
>>>> Python Csound API, btw.
>>>>
>>>> All of the OSC manual examples have hostnames and paths hardcoded. Is
>>>> it then impossible to use it with p-fields?
>>>>
>>>> I originally intended to use liblo, which would make this a snap,
>>>> except that it would be almost impossible to synchronize it with
>>>> Csound, in case someone wanted to use some Csound instruments and some
>>>> Pd instruments, for instance.
>>>> Perhaps the only way is to create a separate OSC instrument for each
>>>> host/path pair the user inputs?
>>>>
>>>> -Chuckk
>>>>
>>>> --
>>>> http://www.badmuthahubbard.com
>>>>
>>>>
>>>> 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"
>>>
>>
>>
>>
>> --
>> Michael Gogins
>> Irreducible Productions
>> Michael dot Gogins at gmail dot com
>>
>>
>> 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"
>
--
http://www.badmuthahubbard.com
|