[Csnd] chngetk
Date | 2020-02-28 15:33 |
From | James Hearon |
Subject | [Csnd] chngetk |
I belive I understand better what's confusing me about the opcode. The "empty" message returned comes from trying to init the string array at k-rate. It seems to only work at i-time.
I read someplace the new channel opcodes should help realtime etc. I looked at bus.c and bus.h and realized iname is all over all the channel opcodes, not just chngetk.
I-time, at least in my mind, means you already know what you want to do before you do it. Seems like being able to load your channel names at control rate would be a plus for realtime?
Thanks,
Jim
instr 1
SChan[] init 4
SChar = "."
SChan[0] = SChar
;itime init string values
iCounter = 0
until (iCounter == 4) do
SChan[iCounter] = SChar
printf_i "SChan[%d ] = %s \n", iCounter+1, iCounter, SChan[iCounter]
iCounter += 1
od
kVals[] chngetk SChan
kArr[] init 4
kcounter = 0
until (kcounter == 4) do
kArr[kcounter] = kcounter ^ 2 + 1
printf " SChan[%d] = %s, kArr[%d] = %f\n", kcounter+1, kcounter, SChan[kcounter], kcounter, kArr[kcounter]
kcounter += 1
od
turnoff
turnoff
endin |
Date | 2020-02-28 18:39 |
From | Rory Walsh |
Subject | Re: [Csnd] chngetk |
You can do this. Just use the regular chnget/set opcodes which have also been updated. But note that it might cause some performance issues. On Fri 28 Feb 2020, 15:33 James Hearon, <j_hearon@hotmail.com> wrote:
|