I am trying to read a row from a 2-dimensional array,
reading at k-rate from an i-rate array.
It seems it is not allowed (parser throws an error about argument types)
‘’’
Unable to find opcode entry for ‘getrow’ with matching argument types:
Found: k[] getrow i[]k
kRow getrow iArr …
‘’‘’
Am I doing something wrong?
Simplified example below
all best
Øyvind
instr 1
iArr[] init 3,3
iArr genarray 1,9
kRow[] init 3
ktrig metro 1
kindex = 0
while kindex < 3 do
kRow getrow iArr, kindex
printarray kRow
kindex += 1
od
endin
Ah, got it.
Just so I can remember later, why do I need to copy from iArr to kArr here?
kArr = iArr ; in the 3rd line of instrument 1
all best
Øyvind
instr 1
iArr init 3,3
iArr genarray 1,9
kArr = iArr
kRow init 3
ktrig metro 1
kindex = 0
while kindex < 3 do
kRow getrow kArr, kindex
printarray kRow
kindex += 1
od
endin
i1 0 1
lør. 22. okt. 2022 kl. 12:27 skrev Oeyvind Brandtsegg <obrandts@gmail.com>:
Hi
I am trying to read a row from a 2-dimensional array,
reading at k-rate from an i-rate array.
It seems it is not allowed (parser throws an error about argument types)
‘’’
Unable to find opcode entry for ‘getrow’ with matching argument types:
Found: k getrow ik
kRow getrow iArr …
‘’‘’
Am I doing something wrong?
Simplified example below
all best
Øyvind
instr 1
iArr init 3,3
iArr genarray 1,9
kRow init 3
ktrig metro 1
kindex = 0
while kindex < 3 do
kRow getrow iArr, kindex
printarray kRow
kindex += 1
od
endin
Thanks for your reply, it makes sense, but when I try it I get an error
‘’’
Unable to find opcode entry for ‘=’ with matching argument types:
Found: k = @
kRow = getrow …
‘’’
instr 1
iArr init 3,3
iArr genarray 1,9
kRow init 3
ktrig metro 1
kindex = 0
while kindex < 3 do
kRow = getrow:k(iArr, kindex)
printarray kRow
kindex += 1
od
Perhaps you need to use the form “getrow:k(…)”, might make the copy unnecessary.
Ah, got it.
Just so I can remember later, why do I need to copy from iArr to kArr here?
kArr = iArr ; in the 3rd line of instrument 1
all best
Øyvind
instr 1
iArr init 3,3
iArr genarray 1,9
kArr = iArr
kRow init 3
ktrig metro 1
kindex = 0
while kindex < 3 do
kRow getrow kArr, kindex
printarray kRow
kindex += 1
od
endin
i1 0 1
lør. 22. okt. 2022 kl. 12:27 skrev Oeyvind Brandtsegg <obrandts@gmail.com>:
Hi
I am trying to read a row from a 2-dimensional array,
reading at k-rate from an i-rate array.
It seems it is not allowed (parser throws an error about argument types)
‘’’
Unable to find opcode entry for ‘getrow’ with matching argument types:
Found: k getrow ik
kRow getrow iArr …
‘’‘’
Am I doing something wrong?
Simplified example below
all best
Øyvind
instr 1
iArr init 3,3
iArr genarray 1,9
kRow init 3
ktrig metro 1
kindex = 0
while kindex < 3 do
kRow getrow iArr, kindex
printarray kRow
kindex += 1
od
endin
Ok. Thanks.
I assumed that it might be slightly more expensive in terms of CPU usage, since it enables interpolation.
Does it fully disable interpolation if the index is an int, or is it so that it just gives the same result?
(still interpolating, but giving the current index full weight, so that the result will be an exact copy)?
Before looping over the items in the row it checks if the index is an integer and in that case it skips any interpolation. This is the main loop after checking bounds:
Before looping over the items in the row it checks if the index is an integer and in that case it skips any interpolation. This is the main loop after checking bounds:
Ok. Thanks.
I assumed that it might be slightly more expensive in terms of CPU usage, since it enables interpolation.
Does it fully disable interpolation if the index is an int, or is it so that it just gives the same result?
(still interpolating, but giving the current index full weight, so that the result will be an exact copy)?
getrowlin used to be included in csound but now needs to be installed as
an external plugin:
risset install beosc
cheers, Eduardo
Hi
I am trying to read a row from a 2-dimensional array,
reading at k-rate from an i-rate array.
It seems it is not allowed (parser throws an error about argument types)
‘’’
Unable to find opcode entry for ‘getrow’ with matching argument types:
Found: k getrow ik
kRow getrow iArr …
‘’‘’
Am I doing something wrong?
Simplified example below
all best
Øyvind
instr 1
iArr init 3,3
iArr genarray 1,9
kRow init 3
ktrig metro 1
kindex = 0
while kindex < 3 do
kRow getrow iArr, kindex
printarray kRow
kindex += 1
od
endin