[Csnd] recompile statement with global array
Date | 2014-01-16 09:57 |
From | Tarmo Johannes |
Subject | [Csnd] recompile statement with global array |
Hi,
I wonder if there is something to do:
If I try to recompile orchestra code that includes global arrays, for example
ires compilestr "gkVolume[0] = 1"
even if the array was declared before (gkVolume[] init 3), i get an error: error: unable to find array operator for types kc line 12 error: Unable to find opcode entry for '=' with matching argument types: Found: @ = c
if I declare the array again in the compilestring, it works
ires compilestr "gkVolume[] init 3 \ngkVolume[0] = 1"
but then I lose info from other fields of the array that was previously there.
It would be really nice to be able to insert new values into an array via API calls, especially, if it is a string array (string arrays and string operations can be handled in other languages much better so far...)
thanks! tarmo
|
Date | 2014-01-16 12:57 |
From | Victor Lazzarini |
Subject | Re: [Csnd] recompile statement with global array |
Looks like a bug to me with global arrays (works with ordinary variables). Can you file a ticket? But note that such an assigment would not work in instr 0, because “=“ with k variables is evaluated at perf-time and there is no perf-time in instr 0. (for assignment to work on instr 0, you need i variables) Victor On 16 Jan 2014, at 09:57, Tarmo Johannes |
Date | 2014-01-16 14:09 |
From | Tarmo Johannes |
Subject | Re: [Csnd] recompile statement with global array |
Thanks, filed a ticket, yes, it should be giArr for such and example, but the error is the same. best! tarmo On Thursday 16 January 2014 12:57:01 Victor Lazzarini wrote: > Looks like a bug to me with global arrays (works with ordinary variables). > Can you file a ticket? > > But note that such an assigment would not work in instr 0, because > “=“ with k variables is evaluated at perf-time and there is no perf-time in > instr 0. (for assignment to work on instr 0, you need i variables) > > Victor > > On 16 Jan 2014, at 09:57, Tarmo Johannes |
Date | 2014-01-16 20:16 |
From | Tarmo Johannes |
Subject | Re: [Csnd] recompile statement with global array |
Yes, it works! I tried with gi and gS arrays. Tomorrow will test in real context but looks it is really helpful in some situations! Thanks a lot! tarmo On Thursday 16 January 2014 12:57:01 Victor Lazzarini wrote: > Looks like a bug to me with global arrays (works with ordinary variables). > Can you file a ticket? > > But note that such an assigment would not work in instr 0, because > “=“ with k variables is evaluated at perf-time and there is no perf-time in > instr 0. (for assignment to work on instr 0, you need i variables) > > Victor > > On 16 Jan 2014, at 09:57, Tarmo Johannes |
Date | 2014-01-17 10:50 |
From | Victor Lazzarini |
Subject | Re: [Csnd] recompile statement with global array |
Good to hear. It was a funny bug because other global types worked fine. I think we will need to refactor that bit of code because it is not looking very elegant at the moment (but it’s working). On 16 Jan 2014, at 20:16, Tarmo Johannes |