tarmo
(Tarmo Johannes)
1
Hi!
Is there a good way to define a 2-mentional array like in python/:
myArray = [ [1,2,3], [4,5,6] ]
I tried:
giInputChannels[][] init 4, 3 ; define left, right and inputs
giArr[] fillarray 1, 2,3
giInputChannels setrow 0, giArr;
also
giInputChannels[0] = giArr
and
giInputChannels[0] fillarray 1,2,3
But none of them work, giving and error error like
unable to find opcode entry for … with matching argument types
anks!
tarmo
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Oeyvind
(Øyvind Brandtsegg)
2
Hi Tarmo,
You have just switched the order of arguments for setrow
This works
giInputChannels setrow giArr, 0
try this:
giInputChannels init 4, 3
printarray(giInputChannels)
giArr fillarray 1, 2,3
giInputChannels setrow giArr, 0
printarray(giInputChannels)
all best
Øyvind
man. 24. okt. 2022 kl. 11:48 skrev Tarmo Johannes <trmjhnns@gmail.com>:
Hi!
Is there a good way to define a 2-mentional array like in python/:
myArray = [ [1,2,3], [4,5,6] ]
I tried:
giInputChannels init 4, 3 ; define left, right and inputs
giArr fillarray 1, 2,3
giInputChannels setrow 0, giArr;
also
giInputChannels[0] = giArr
and
giInputChannels[0] fillarray 1,2,3
But none of them work, giving and error error like
unable to find opcode entry for … with matching argument types
anks!
tarmo
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
tarmo
(Tarmo Johannes)
3
Thanks, Øyvind!
True, I was reading manual too quickly and go confused, which is which:
i/kout setrow i/kin,i/krow
Best!
Tarmo
Kontakt Oeyvind Brandtsegg (<obrandts@gmail.com>) kirjutas kuupäeval E, 24. oktoober 2022 kell 12:57:
Hi Tarmo,
You have just switched the order of arguments for setrow
This works
giInputChannels setrow giArr, 0
try this:
giInputChannels init 4, 3
printarray(giInputChannels)
giArr fillarray 1, 2,3
giInputChannels setrow giArr, 0
printarray(giInputChannels)
all best
Øyvind
man. 24. okt. 2022 kl. 11:48 skrev Tarmo Johannes <trmjhnns@gmail.com>:
Hi!
Is there a good way to define a 2-mentional array like in python/:
myArray = [ [1,2,3], [4,5,6] ]
I tried:
giInputChannels init 4, 3 ; define left, right and inputs
giArr fillarray 1, 2,3
giInputChannels setrow 0, giArr;
also
giInputChannels[0] = giArr
and
giInputChannels[0] fillarray 1,2,3
But none of them work, giving and error error like
unable to find opcode entry for … with matching argument types
anks!
tarmo
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Fillarray is oblivious to the shape of the array so the way to define a 2D array is:
ixs[][] init 4, 3
ixs fillarray 0, 1, 2, \
3, 4, 5, \
6, 7, 8, \
9, 10, 11
joachim
(joachim heintz)
5
yes; this is also mentioned in
stevenyi
(Steven Yi)
6
I think there's array literal syntax in cs7 branch, but I'm unsure if
it works for multidimensional arrays.
btw, 7.0 is in the develop branch, just to be clear. There's a cs7 branch but that's stale.
Prof. Victor Lazzarini
Maynooth University
Ireland