Csound Csound-dev Csound-tekno Search About

[Csnd-dev] Problems with OSC+arrays

Date2015-10-21 20:36
Fromjpff
Subject[Csnd-dev] Problems with OSC+arrays
I have draft code for this but I have problems

1: There is no code I can find for arbitrary number of ikSi[]k[]S[]
arguments which OSCsend and OSClisten would need

2: ?I do not know how to decode the array type information.  I can
cheat as in reality there are only numbers and strings and I can code
these separately but I worry about future developments

3:  The code to take an ARRAYDAT into a blob is horrid!

Date2015-10-21 20:50
FromSteven Yi
SubjectRe: [Csnd-dev] Problems with OSC+arrays
I think for 1, you could do use a "*" to take any number of arguments,
then check the argument types at runtime. If a runtime error vs. a
syntax error is okay, then that should work. csoundGetTypeForArg()
should work on the MYFLT pointer that is given for the argument to get
the CS_TYPE, and you can use a switch or if-else ladder to check the
type against the built-in types (with a sub-switch for if
CS_ARRAY_TYPE is found, conditionally checking the array sub type).

I'm not sure I understand #2. Could you post code to look at or email offlist?

On Wed, Oct 21, 2015 at 3:36 PM, jpff  wrote:
> I have draft code for this but I have problems
>
> 1: There is no code I can find for arbitrary number of ikSi[]k[]S[]
> arguments which OSCsend and OSClisten would need
>
> 2: ?I do not know how to decode the array type information.  I can
> cheat as in reality there are only numbers and strings and I can code
> these separately but I worry about future developments
>
> 3:  The code to take an ARRAYDAT into a blob is horrid!
>