Csound Csound-dev Csound-tekno Search About

[Csnd] Multi-dimensional arrays problem

Date2025-04-14 18:42
FromGabriel Borin
Subject[Csnd] Multi-dimensional arrays problem
Hello, everyone

This might be a dumb question, but I am really falling to see what I am doing wrong. This is still preliminary.

When I run this:

instr 1

kCnt init 0

if metro(1) == 1 then

schedulek(2,0,1,kCnt)

kCnt += 1

endif

endin


instr 2

iGate[] = fillarray(0,0,0,1,0,1,0,0)

iChordsArr[][] init 2,4

iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)

iCnt = (p4%2)

print(iNote)

indx init 0

while indx < 4 do

iNote = iChordsArr[iCnt][indx]

indx += 1

od

endin

schedule(1,0,3600)


I get the error: array-variable dimensions do not match


The idea is to use multi-dimensional arrays to play 4-note chords, where each chord will be on a line, and each column will give a note to the a schedule of a different instrument.


Am I missing something?
Thanks for the help.

Respectfully,
Gabriel



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

Date2025-04-14 18:59
Fromjoachim heintz
SubjectRe: [Csnd] Multi-dimensional arrays problem
hi gabriel -

when i run your code with csound 7 develop, i had to move the 
print(iNote) after the line
		iNote = iChordsArr[iCnt][indx]

then it worked; the output is:

new alloc (instance 1) for instr 1:
	   T  0.003 TT  0.003 M:  0.00000  0.00000
new alloc (instance 2) for instr 2:
instr 2:	iNote = 51.000
instr 2:	iNote = 54.000
instr 2:	iNote = 61.000
instr 2:	iNote = 65.000
	   T  1.004 TT  1.004 M:  0.00000  0.00000
instr 2:	iNote = 49.000
instr 2:	iNote = 53.000
instr 2:	iNote = 60.000
instr 2:	iNote = 65.000
	   T  2.006 TT  2.006 M:  0.00000  0.00000
instr 2:	iNote = 51.000
instr 2:	iNote = 54.000
instr 2:	iNote = 61.000
instr 2:	iNote = 65.000
	   T  3.004 TT  3.004 M:  0.00000  0.00000
new alloc (instance 3) for instr 2:
instr 2:	iNote = 49.000
instr 2:	iNote = 53.000
instr 2:	iNote = 60.000
instr 2:	iNote = 65.000

best -
	joachim

On 14/04/2025 19:42, Gabriel Borin wrote:
> Hello, everyone
> 
> This might be a dumb question, but I am really falling to see what I am 
> doing wrong. This is still preliminary.
> 
> When I run this:
> 
> instr 1
> 
> kCnt init 0
> 
> if metro(1) == 1 then
> 
> schedulek(2,0,1,kCnt)
> 
> kCnt += 1
> 
> endif
> 
> endin
> 
> 
> instr 2
> 
> iGate[] = fillarray(0,0,0,1,0,1,0,0)
> 
> iChordsArr[][] init 2,4
> 
> iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)
> 
> iCnt = (p4%2)
> 
> print(iNote)
> 
> indx init 0
> 
> while indx < 4 do
> 
> iNote = iChordsArr[iCnt][indx]
> 
> indx += 1
> 
> od
> 
> endin
> 
> schedule(1,0,3600)
> 
> 
> I get the error: array-variable dimensions do not match
> 
> 
> The idea is to use multi-dimensional arrays to play 4-note chords, where 
> each chord will be on a line, and each column will give a note to the a 
> schedule of a different instrument.
> 
> 
> Am I missing something?
> Thanks for the help.
> 
> Respectfully,
> Gabriel
> 
> 
> 
> 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  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

Date2025-04-14 19:38
FromGabriel Borin
SubjectRe: [Csnd] Multi-dimensional arrays problem
Hi, Mr. Heintz

Even after moving it, it still doesn't work. Do you think it has to do with Csound 6.18?

--Gabriel

On Mon, Apr 14, 2025 at 1:59 PM joachim heintz <jh@joachimheintz.de> wrote:
hi gabriel -

when i run your code with csound 7 develop, i had to move the
print(iNote) after the line
                iNote = iChordsArr[iCnt][indx]

then it worked; the output is:

new alloc (instance 1) for instr 1:
           T  0.003 TT  0.003 M:  0.00000  0.00000
new alloc (instance 2) for instr 2:
instr 2:        iNote = 51.000
instr 2:        iNote = 54.000
instr 2:        iNote = 61.000
instr 2:        iNote = 65.000
           T  1.004 TT  1.004 M:  0.00000  0.00000
instr 2:        iNote = 49.000
instr 2:        iNote = 53.000
instr 2:        iNote = 60.000
instr 2:        iNote = 65.000
           T  2.006 TT  2.006 M:  0.00000  0.00000
instr 2:        iNote = 51.000
instr 2:        iNote = 54.000
instr 2:        iNote = 61.000
instr 2:        iNote = 65.000
           T  3.004 TT  3.004 M:  0.00000  0.00000
new alloc (instance 3) for instr 2:
instr 2:        iNote = 49.000
instr 2:        iNote = 53.000
instr 2:        iNote = 60.000
instr 2:        iNote = 65.000

best -
        joachim

On 14/04/2025 19:42, Gabriel Borin wrote:
> Hello, everyone
>
> This might be a dumb question, but I am really falling to see what I am
> doing wrong. This is still preliminary.
>
> When I run this:
>
> instr 1
>
> kCnt init 0
>
> if metro(1) == 1 then
>
> schedulek(2,0,1,kCnt)
>
> kCnt += 1
>
> endif
>
> endin
>
>
> instr 2
>
> iGate[] = fillarray(0,0,0,1,0,1,0,0)
>
> iChordsArr[][] init 2,4
>
> iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)
>
> iCnt = (p4%2)
>
> print(iNote)
>
> indx init 0
>
> while indx < 4 do
>
> iNote = iChordsArr[iCnt][indx]
>
> indx += 1
>
> od
>
> endin
>
> schedule(1,0,3600)
>
>
> I get the error: array-variable dimensions do not match
>
>
> The idea is to use multi-dimensional arrays to play 4-note chords, where
> each chord will be on a line, and each column will give a note to the a
> schedule of a different instrument.
>
>
> Am I missing something?
> Thanks for the help.
>
> Respectfully,
> Gabriel
>
>
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/cgi-bin/
> wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
> reports to https://github.com/csound/csound/issues <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

Date2025-04-14 19:54
FromParham Izadyar
SubjectRe: [Csnd] Multi-dimensional arrays problem
hey gabriel -
i think the problem is with functional coding in csound 6.18 with two dimensions array, because when i change line 35:

iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65) to:

iChordsArr fillarray 51,54,61,65,49,53,60,65

it works. so i guess with csound 7 you don't have to use traditional way. parham


On Mon, Apr 14, 2025 at 10:09 PM Gabriel Borin <gabriel.s.borin@gmail.com> wrote:
Hi, Mr. Heintz

Even after moving it, it still doesn't work. Do you think it has to do with Csound 6.18?

--Gabriel

On Mon, Apr 14, 2025 at 1:59 PM joachim heintz <jh@joachimheintz.de> wrote:
hi gabriel -

when i run your code with csound 7 develop, i had to move the
print(iNote) after the line
                iNote = iChordsArr[iCnt][indx]

then it worked; the output is:

new alloc (instance 1) for instr 1:
           T  0.003 TT  0.003 M:  0.00000  0.00000
new alloc (instance 2) for instr 2:
instr 2:        iNote = 51.000
instr 2:        iNote = 54.000
instr 2:        iNote = 61.000
instr 2:        iNote = 65.000
           T  1.004 TT  1.004 M:  0.00000  0.00000
instr 2:        iNote = 49.000
instr 2:        iNote = 53.000
instr 2:        iNote = 60.000
instr 2:        iNote = 65.000
           T  2.006 TT  2.006 M:  0.00000  0.00000
instr 2:        iNote = 51.000
instr 2:        iNote = 54.000
instr 2:        iNote = 61.000
instr 2:        iNote = 65.000
           T  3.004 TT  3.004 M:  0.00000  0.00000
new alloc (instance 3) for instr 2:
instr 2:        iNote = 49.000
instr 2:        iNote = 53.000
instr 2:        iNote = 60.000
instr 2:        iNote = 65.000

best -
        joachim

On 14/04/2025 19:42, Gabriel Borin wrote:
> Hello, everyone
>
> This might be a dumb question, but I am really falling to see what I am
> doing wrong. This is still preliminary.
>
> When I run this:
>
> instr 1
>
> kCnt init 0
>
> if metro(1) == 1 then
>
> schedulek(2,0,1,kCnt)
>
> kCnt += 1
>
> endif
>
> endin
>
>
> instr 2
>
> iGate[] = fillarray(0,0,0,1,0,1,0,0)
>
> iChordsArr[][] init 2,4
>
> iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)
>
> iCnt = (p4%2)
>
> print(iNote)
>
> indx init 0
>
> while indx < 4 do
>
> iNote = iChordsArr[iCnt][indx]
>
> indx += 1
>
> od
>
> endin
>
> schedule(1,0,3600)
>
>
> I get the error: array-variable dimensions do not match
>
>
> The idea is to use multi-dimensional arrays to play 4-note chords, where
> each chord will be on a line, and each column will give a note to the a
> schedule of a different instrument.
>
>
> Am I missing something?
> Thanks for the help.
>
> Respectfully,
> Gabriel
>
>
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/cgi-bin/
> wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
> reports to https://github.com/csound/csound/issues <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
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

Date2025-04-14 20:07
FromGabriel Borin
SubjectRe: [Csnd] Multi-dimensional arrays problem
Aha! That did it!

I guess it is the same with other opcodes that take more than one variable (like, pan2). It just didn't occur to me that it would be the case here.

Thanks!

-- Gabriel

On Mon, Apr 14, 2025 at 2:55 PM Parham Izadyar <parhamizadyar93@gmail.com> wrote:
hey gabriel -
i think the problem is with functional coding in csound 6.18 with two dimensions array, because when i change line 35:

iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65) to:

iChordsArr fillarray 51,54,61,65,49,53,60,65

it works. so i guess with csound 7 you don't have to use traditional way. parham


On Mon, Apr 14, 2025 at 10:09 PM Gabriel Borin <gabriel.s.borin@gmail.com> wrote:
Hi, Mr. Heintz

Even after moving it, it still doesn't work. Do you think it has to do with Csound 6.18?

--Gabriel

On Mon, Apr 14, 2025 at 1:59 PM joachim heintz <jh@joachimheintz.de> wrote:
hi gabriel -

when i run your code with csound 7 develop, i had to move the
print(iNote) after the line
                iNote = iChordsArr[iCnt][indx]

then it worked; the output is:

new alloc (instance 1) for instr 1:
           T  0.003 TT  0.003 M:  0.00000  0.00000
new alloc (instance 2) for instr 2:
instr 2:        iNote = 51.000
instr 2:        iNote = 54.000
instr 2:        iNote = 61.000
instr 2:        iNote = 65.000
           T  1.004 TT  1.004 M:  0.00000  0.00000
instr 2:        iNote = 49.000
instr 2:        iNote = 53.000
instr 2:        iNote = 60.000
instr 2:        iNote = 65.000
           T  2.006 TT  2.006 M:  0.00000  0.00000
instr 2:        iNote = 51.000
instr 2:        iNote = 54.000
instr 2:        iNote = 61.000
instr 2:        iNote = 65.000
           T  3.004 TT  3.004 M:  0.00000  0.00000
new alloc (instance 3) for instr 2:
instr 2:        iNote = 49.000
instr 2:        iNote = 53.000
instr 2:        iNote = 60.000
instr 2:        iNote = 65.000

best -
        joachim

On 14/04/2025 19:42, Gabriel Borin wrote:
> Hello, everyone
>
> This might be a dumb question, but I am really falling to see what I am
> doing wrong. This is still preliminary.
>
> When I run this:
>
> instr 1
>
> kCnt init 0
>
> if metro(1) == 1 then
>
> schedulek(2,0,1,kCnt)
>
> kCnt += 1
>
> endif
>
> endin
>
>
> instr 2
>
> iGate[] = fillarray(0,0,0,1,0,1,0,0)
>
> iChordsArr[][] init 2,4
>
> iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)
>
> iCnt = (p4%2)
>
> print(iNote)
>
> indx init 0
>
> while indx < 4 do
>
> iNote = iChordsArr[iCnt][indx]
>
> indx += 1
>
> od
>
> endin
>
> schedule(1,0,3600)
>
>
> I get the error: array-variable dimensions do not match
>
>
> The idea is to use multi-dimensional arrays to play 4-note chords, where
> each chord will be on a line, and each column will give a note to the a
> schedule of a different instrument.
>
>
> Am I missing something?
> Thanks for the help.
>
> Respectfully,
> Gabriel
>
>
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/cgi-bin/
> wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
> reports to https://github.com/csound/csound/issues <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
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

Date2025-04-14 20:48
Fromjoachim heintz
SubjectRe: [Csnd] Multi-dimensional arrays problem
actually here are not more than one output variables.
i think parham pointed to an inconsistency of the code:
in csound you declare the array with brackets only once; then you refer 
to the array without brackets.
does it work when you write
	iChordsArr = fillarray(51,54,61,65,49,53,60,65)
?

On 14/04/2025 21:07, Gabriel Borin wrote:
> Aha! That did it!
> 
> I guess it is the same with other opcodes that take more than one 
> variable (like, pan2). It just didn't occur to me that it would be the 
> case here.
> 
> Thanks!
> 
> -- Gabriel
> 
> On Mon, Apr 14, 2025 at 2:55 PM Parham Izadyar 
> > wrote:
> 
>     hey gabriel -
>     i think the problem is with functional coding in csound 6.18 with
>     two dimensions array, because when i change line 35:
> 
>     iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65) to:
> 
>     iChordsArr fillarray 51,54,61,65,49,53,60,65
> 
>     it works. so i guess with csound 7 you don't have to use traditional
>     way. parham
> 
> 
>     On Mon, Apr 14, 2025 at 10:09 PM Gabriel Borin
>     > wrote:
> 
>         Hi, Mr. Heintz
> 
>         Even after moving it, it still doesn't work. Do you think it has
>         to do with Csound 6.18?
> 
>         --Gabriel
> 
>         On Mon, Apr 14, 2025 at 1:59 PM joachim heintz
>         > wrote:
> 
>             hi gabriel -
> 
>             when i run your code with csound 7 develop, i had to move the
>             print(iNote) after the line
>                              iNote = iChordsArr[iCnt][indx]
> 
>             then it worked; the output is:
> 
>             new alloc (instance 1) for instr 1:
>                         T  0.003 TT  0.003 M:  0.00000  0.00000
>             new alloc (instance 2) for instr 2:
>             instr 2:        iNote = 51.000
>             instr 2:        iNote = 54.000
>             instr 2:        iNote = 61.000
>             instr 2:        iNote = 65.000
>                         T  1.004 TT  1.004 M:  0.00000  0.00000
>             instr 2:        iNote = 49.000
>             instr 2:        iNote = 53.000
>             instr 2:        iNote = 60.000
>             instr 2:        iNote = 65.000
>                         T  2.006 TT  2.006 M:  0.00000  0.00000
>             instr 2:        iNote = 51.000
>             instr 2:        iNote = 54.000
>             instr 2:        iNote = 61.000
>             instr 2:        iNote = 65.000
>                         T  3.004 TT  3.004 M:  0.00000  0.00000
>             new alloc (instance 3) for instr 2:
>             instr 2:        iNote = 49.000
>             instr 2:        iNote = 53.000
>             instr 2:        iNote = 60.000
>             instr 2:        iNote = 65.000
> 
>             best -
>                      joachim
> 
>             On 14/04/2025 19:42, Gabriel Borin wrote:
>              > Hello, everyone
>              >
>              > This might be a dumb question, but I am really falling to
>             see what I am
>              > doing wrong. This is still preliminary.
>              >
>              > When I run this:
>              >
>              > instr 1
>              >
>              > kCnt init 0
>              >
>              > if metro(1) == 1 then
>              >
>              > schedulek(2,0,1,kCnt)
>              >
>              > kCnt += 1
>              >
>              > endif
>              >
>              > endin
>              >
>              >
>              > instr 2
>              >
>              > iGate[] = fillarray(0,0,0,1,0,1,0,0)
>              >
>              > iChordsArr[][] init 2,4
>              >
>              > iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)
>              >
>              > iCnt = (p4%2)
>              >
>              > print(iNote)
>              >
>              > indx init 0
>              >
>              > while indx < 4 do
>              >
>              > iNote = iChordsArr[iCnt][indx]
>              >
>              > indx += 1
>              >
>              > od
>              >
>              > endin
>              >
>              > schedule(1,0,3600)
>              >
>              >
>              > I get the error: array-variable dimensions do not match
>              >
>              >
>              > The idea is to use multi-dimensional arrays to play 4-
>             note chords, where
>              > each chord will be on a line, and each column will give a
>             note to the a
>              > schedule of a different instrument.
>              >
>              >
>              > Am I missing something?
>              > Thanks for the help.
>              >
>              > Respectfully,
>              > Gabriel
>              >
>              >
>              >
>              > Csound mailing list Csound@listserv.heanet.ie
>             
>              >              > https://
>             listserv.heanet.ie/cgi-bin/              bin/>
>              > wa?A0=CSOUND              A0=CSOUND >
>             Send bugs
>              > reports to https://github.com/csound/csound/issues
>                           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              listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>             Send bugs reports to
>             https://github.com/csound/csound/issues              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          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  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

Date2025-04-14 20:52
FromParham Izadyar
SubjectRe: [Csnd] Multi-dimensional arrays problem
yes that's what i tried first but didn't work for me. then i used the traditional way. maybe it would work for gabriel (?) im interested to know

On Mon, Apr 14, 2025 at 11:19 PM joachim heintz <jh@joachimheintz.de> wrote:
actually here are not more than one output variables.
i think parham pointed to an inconsistency of the code:
in csound you declare the array with brackets only once; then you refer
to the array without brackets.
does it work when you write
        iChordsArr = fillarray(51,54,61,65,49,53,60,65)
?

On 14/04/2025 21:07, Gabriel Borin wrote:
> Aha! That did it!
>
> I guess it is the same with other opcodes that take more than one
> variable (like, pan2). It just didn't occur to me that it would be the
> case here.
>
> Thanks!
>
> -- Gabriel
>
> On Mon, Apr 14, 2025 at 2:55 PM Parham Izadyar
> <parhamizadyar93@gmail.com <mailto:parhamizadyar93@gmail.com>> wrote:
>
>     hey gabriel -
>     i think the problem is with functional coding in csound 6.18 with
>     two dimensions array, because when i change line 35:
>
>     iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65) to:
>
>     iChordsArr fillarray 51,54,61,65,49,53,60,65
>
>     it works. so i guess with csound 7 you don't have to use traditional
>     way. parham
>
>
>     On Mon, Apr 14, 2025 at 10:09 PM Gabriel Borin
>     <gabriel.s.borin@gmail.com <mailto:gabriel.s.borin@gmail.com>> wrote:
>
>         Hi, Mr. Heintz
>
>         Even after moving it, it still doesn't work. Do you think it has
>         to do with Csound 6.18?
>
>         --Gabriel
>
>         On Mon, Apr 14, 2025 at 1:59 PM joachim heintz
>         <jh@joachimheintz.de <mailto:jh@joachimheintz.de>> wrote:
>
>             hi gabriel -
>
>             when i run your code with csound 7 develop, i had to move the
>             print(iNote) after the line
>                              iNote = iChordsArr[iCnt][indx]
>
>             then it worked; the output is:
>
>             new alloc (instance 1) for instr 1:
>                         T  0.003 TT  0.003 M:  0.00000  0.00000
>             new alloc (instance 2) for instr 2:
>             instr 2:        iNote = 51.000
>             instr 2:        iNote = 54.000
>             instr 2:        iNote = 61.000
>             instr 2:        iNote = 65.000
>                         T  1.004 TT  1.004 M:  0.00000  0.00000
>             instr 2:        iNote = 49.000
>             instr 2:        iNote = 53.000
>             instr 2:        iNote = 60.000
>             instr 2:        iNote = 65.000
>                         T  2.006 TT  2.006 M:  0.00000  0.00000
>             instr 2:        iNote = 51.000
>             instr 2:        iNote = 54.000
>             instr 2:        iNote = 61.000
>             instr 2:        iNote = 65.000
>                         T  3.004 TT  3.004 M:  0.00000  0.00000
>             new alloc (instance 3) for instr 2:
>             instr 2:        iNote = 49.000
>             instr 2:        iNote = 53.000
>             instr 2:        iNote = 60.000
>             instr 2:        iNote = 65.000
>
>             best -
>                      joachim
>
>             On 14/04/2025 19:42, Gabriel Borin wrote:
>              > Hello, everyone
>              >
>              > This might be a dumb question, but I am really falling to
>             see what I am
>              > doing wrong. This is still preliminary.
>              >
>              > When I run this:
>              >
>              > instr 1
>              >
>              > kCnt init 0
>              >
>              > if metro(1) == 1 then
>              >
>              > schedulek(2,0,1,kCnt)
>              >
>              > kCnt += 1
>              >
>              > endif
>              >
>              > endin
>              >
>              >
>              > instr 2
>              >
>              > iGate[] = fillarray(0,0,0,1,0,1,0,0)
>              >
>              > iChordsArr[][] init 2,4
>              >
>              > iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)
>              >
>              > iCnt = (p4%2)
>              >
>              > print(iNote)
>              >
>              > indx init 0
>              >
>              > while indx < 4 do
>              >
>              > iNote = iChordsArr[iCnt][indx]
>              >
>              > indx += 1
>              >
>              > od
>              >
>              > endin
>              >
>              > schedule(1,0,3600)
>              >
>              >
>              > I get the error: array-variable dimensions do not match
>              >
>              >
>              > The idea is to use multi-dimensional arrays to play 4-
>             note chords, where
>              > each chord will be on a line, and each column will give a
>             note to the a
>              > schedule of a different instrument.
>              >
>              >
>              > Am I missing something?
>              > Thanks for the help.
>              >
>              > Respectfully,
>              > Gabriel
>              >
>              >
>              >
>              > Csound mailing list Csound@listserv.heanet.ie
>             <mailto:Csound@listserv.heanet.ie>
>              > <mailto:Csound@listserv.heanet.ie
>             <mailto:Csound@listserv.heanet.ie>> https://
>             listserv.heanet.ie/cgi-bin/ <https://listserv.heanet.ie/cgi-
>             bin/>
>              > wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?
>             A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>>
>             Send bugs
>              > reports to https://github.com/csound/csound/issues
>             <https://github.com/csound/csound/issues> <https://
>             github.com/ <https://github.com/>
>              > csound/csound/issues> Discussions of bugs and features
>             can be posted here
>
>             Csound mailing list
>             Csound@listserv.heanet.ie <mailto:Csound@listserv.heanet.ie>
>             https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND <https://
>             listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>             Send bugs reports to
>             https://github.com/csound/csound/issues <https://github.com/
>             csound/csound/issues>
>             Discussions of bugs and features can be posted here
>
>         Csound mailing list Csound@listserv.heanet.ie
>         <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/
>         cgi-bin/wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?
>         A0=CSOUND> Send bugs reports to https://github.com/csound/
>         csound/issues <https://github.com/csound/csound/issues>
>         Discussions of bugs and features can be posted here
>
>     Csound mailing list Csound@listserv.heanet.ie
>     <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/cgi-
>     bin/wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>     Send bugs reports to https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues> Discussions of bugs and
>     features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/cgi-bin/
> wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
> reports to https://github.com/csound/csound/issues <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

Date2025-04-14 20:53
FromGabriel Borin
SubjectRe: [Csnd] Multi-dimensional arrays problem
Hi, Mr. Heintz

Running like that iChordsArr = fillarray(51,54,61,65,49,53,60,65) does not work.

--Gabriel

On Mon, Apr 14, 2025 at 3:49 PM joachim heintz <jh@joachimheintz.de> wrote:
actually here are not more than one output variables.
i think parham pointed to an inconsistency of the code:
in csound you declare the array with brackets only once; then you refer
to the array without brackets.
does it work when you write
        iChordsArr = fillarray(51,54,61,65,49,53,60,65)
?

On 14/04/2025 21:07, Gabriel Borin wrote:
> Aha! That did it!
>
> I guess it is the same with other opcodes that take more than one
> variable (like, pan2). It just didn't occur to me that it would be the
> case here.
>
> Thanks!
>
> -- Gabriel
>
> On Mon, Apr 14, 2025 at 2:55 PM Parham Izadyar
> <parhamizadyar93@gmail.com <mailto:parhamizadyar93@gmail.com>> wrote:
>
>     hey gabriel -
>     i think the problem is with functional coding in csound 6.18 with
>     two dimensions array, because when i change line 35:
>
>     iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65) to:
>
>     iChordsArr fillarray 51,54,61,65,49,53,60,65
>
>     it works. so i guess with csound 7 you don't have to use traditional
>     way. parham
>
>
>     On Mon, Apr 14, 2025 at 10:09 PM Gabriel Borin
>     <gabriel.s.borin@gmail.com <mailto:gabriel.s.borin@gmail.com>> wrote:
>
>         Hi, Mr. Heintz
>
>         Even after moving it, it still doesn't work. Do you think it has
>         to do with Csound 6.18?
>
>         --Gabriel
>
>         On Mon, Apr 14, 2025 at 1:59 PM joachim heintz
>         <jh@joachimheintz.de <mailto:jh@joachimheintz.de>> wrote:
>
>             hi gabriel -
>
>             when i run your code with csound 7 develop, i had to move the
>             print(iNote) after the line
>                              iNote = iChordsArr[iCnt][indx]
>
>             then it worked; the output is:
>
>             new alloc (instance 1) for instr 1:
>                         T  0.003 TT  0.003 M:  0.00000  0.00000
>             new alloc (instance 2) for instr 2:
>             instr 2:        iNote = 51.000
>             instr 2:        iNote = 54.000
>             instr 2:        iNote = 61.000
>             instr 2:        iNote = 65.000
>                         T  1.004 TT  1.004 M:  0.00000  0.00000
>             instr 2:        iNote = 49.000
>             instr 2:        iNote = 53.000
>             instr 2:        iNote = 60.000
>             instr 2:        iNote = 65.000
>                         T  2.006 TT  2.006 M:  0.00000  0.00000
>             instr 2:        iNote = 51.000
>             instr 2:        iNote = 54.000
>             instr 2:        iNote = 61.000
>             instr 2:        iNote = 65.000
>                         T  3.004 TT  3.004 M:  0.00000  0.00000
>             new alloc (instance 3) for instr 2:
>             instr 2:        iNote = 49.000
>             instr 2:        iNote = 53.000
>             instr 2:        iNote = 60.000
>             instr 2:        iNote = 65.000
>
>             best -
>                      joachim
>
>             On 14/04/2025 19:42, Gabriel Borin wrote:
>              > Hello, everyone
>              >
>              > This might be a dumb question, but I am really falling to
>             see what I am
>              > doing wrong. This is still preliminary.
>              >
>              > When I run this:
>              >
>              > instr 1
>              >
>              > kCnt init 0
>              >
>              > if metro(1) == 1 then
>              >
>              > schedulek(2,0,1,kCnt)
>              >
>              > kCnt += 1
>              >
>              > endif
>              >
>              > endin
>              >
>              >
>              > instr 2
>              >
>              > iGate[] = fillarray(0,0,0,1,0,1,0,0)
>              >
>              > iChordsArr[][] init 2,4
>              >
>              > iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)
>              >
>              > iCnt = (p4%2)
>              >
>              > print(iNote)
>              >
>              > indx init 0
>              >
>              > while indx < 4 do
>              >
>              > iNote = iChordsArr[iCnt][indx]
>              >
>              > indx += 1
>              >
>              > od
>              >
>              > endin
>              >
>              > schedule(1,0,3600)
>              >
>              >
>              > I get the error: array-variable dimensions do not match
>              >
>              >
>              > The idea is to use multi-dimensional arrays to play 4-
>             note chords, where
>              > each chord will be on a line, and each column will give a
>             note to the a
>              > schedule of a different instrument.
>              >
>              >
>              > Am I missing something?
>              > Thanks for the help.
>              >
>              > Respectfully,
>              > Gabriel
>              >
>              >
>              >
>              > Csound mailing list Csound@listserv.heanet.ie
>             <mailto:Csound@listserv.heanet.ie>
>              > <mailto:Csound@listserv.heanet.ie
>             <mailto:Csound@listserv.heanet.ie>> https://
>             listserv.heanet.ie/cgi-bin/ <https://listserv.heanet.ie/cgi-
>             bin/>
>              > wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?
>             A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>>
>             Send bugs
>              > reports to https://github.com/csound/csound/issues
>             <https://github.com/csound/csound/issues> <https://
>             github.com/ <https://github.com/>
>              > csound/csound/issues> Discussions of bugs and features
>             can be posted here
>
>             Csound mailing list
>             Csound@listserv.heanet.ie <mailto:Csound@listserv.heanet.ie>
>             https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND <https://
>             listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>             Send bugs reports to
>             https://github.com/csound/csound/issues <https://github.com/
>             csound/csound/issues>
>             Discussions of bugs and features can be posted here
>
>         Csound mailing list Csound@listserv.heanet.ie
>         <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/
>         cgi-bin/wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?
>         A0=CSOUND> Send bugs reports to https://github.com/csound/
>         csound/issues <https://github.com/csound/csound/issues>
>         Discussions of bugs and features can be posted here
>
>     Csound mailing list Csound@listserv.heanet.ie
>     <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/cgi-
>     bin/wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>     Send bugs reports to https://github.com/csound/csound/issues
>     <https://github.com/csound/csound/issues> Discussions of bugs and
>     features can be posted here
>
> Csound mailing list Csound@listserv.heanet.ie
> <mailto:Csound@listserv.heanet.ie> https://listserv.heanet.ie/cgi-bin/
> wa?A0=CSOUND <https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND> Send bugs
> reports to https://github.com/csound/csound/issues <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

Date2025-04-14 21:13
Fromjoachim heintz
SubjectRe: [Csnd] Multi-dimensional arrays problem
ok, thanks.
then one more reason to look forward to csound 7 =)
	joachim

On 14/04/2025 21:53, Gabriel Borin wrote:
> Hi, Mr. Heintz
> 
> Running like that iChordsArr = fillarray(51,54,61,65,49,53,60,65) does 
> not work.
> 
> --Gabriel
> 
> On Mon, Apr 14, 2025 at 3:49 PM joachim heintz  > wrote:
> 
>     actually here are not more than one output variables.
>     i think parham pointed to an inconsistency of the code:
>     in csound you declare the array with brackets only once; then you refer
>     to the array without brackets.
>     does it work when you write
>              iChordsArr = fillarray(51,54,61,65,49,53,60,65)
>     ?
> 
>     On 14/04/2025 21:07, Gabriel Borin wrote:
>      > Aha! That did it!
>      >
>      > I guess it is the same with other opcodes that take more than one
>      > variable (like, pan2). It just didn't occur to me that it would
>     be the
>      > case here.
>      >
>      > Thanks!
>      >
>      > -- Gabriel
>      >
>      > On Mon, Apr 14, 2025 at 2:55 PM Parham Izadyar
>      > 
>          >> wrote:
>      >
>      >     hey gabriel -
>      >     i think the problem is with functional coding in csound 6.18 with
>      >     two dimensions array, because when i change line 35:
>      >
>      >     iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65) to:
>      >
>      >     iChordsArr fillarray 51,54,61,65,49,53,60,65
>      >
>      >     it works. so i guess with csound 7 you don't have to use
>     traditional
>      >     way. parham
>      >
>      >
>      >     On Mon, Apr 14, 2025 at 10:09 PM Gabriel Borin
>      >     
>          >> wrote:
>      >
>      >         Hi, Mr. Heintz
>      >
>      >         Even after moving it, it still doesn't work. Do you think
>     it has
>      >         to do with Csound 6.18?
>      >
>      >         --Gabriel
>      >
>      >         On Mon, Apr 14, 2025 at 1:59 PM joachim heintz
>      >         
>     >> wrote:
>      >
>      >             hi gabriel -
>      >
>      >             when i run your code with csound 7 develop, i had to
>     move the
>      >             print(iNote) after the line
>      >                              iNote = iChordsArr[iCnt][indx]
>      >
>      >             then it worked; the output is:
>      >
>      >             new alloc (instance 1) for instr 1:
>      >                         T  0.003 TT  0.003 M:  0.00000  0.00000
>      >             new alloc (instance 2) for instr 2:
>      >             instr 2:        iNote = 51.000
>      >             instr 2:        iNote = 54.000
>      >             instr 2:        iNote = 61.000
>      >             instr 2:        iNote = 65.000
>      >                         T  1.004 TT  1.004 M:  0.00000  0.00000
>      >             instr 2:        iNote = 49.000
>      >             instr 2:        iNote = 53.000
>      >             instr 2:        iNote = 60.000
>      >             instr 2:        iNote = 65.000
>      >                         T  2.006 TT  2.006 M:  0.00000  0.00000
>      >             instr 2:        iNote = 51.000
>      >             instr 2:        iNote = 54.000
>      >             instr 2:        iNote = 61.000
>      >             instr 2:        iNote = 65.000
>      >                         T  3.004 TT  3.004 M:  0.00000  0.00000
>      >             new alloc (instance 3) for instr 2:
>      >             instr 2:        iNote = 49.000
>      >             instr 2:        iNote = 53.000
>      >             instr 2:        iNote = 60.000
>      >             instr 2:        iNote = 65.000
>      >
>      >             best -
>      >                      joachim
>      >
>      >             On 14/04/2025 19:42, Gabriel Borin wrote:
>      >              > Hello, everyone
>      >              >
>      >              > This might be a dumb question, but I am really
>     falling to
>      >             see what I am
>      >              > doing wrong. This is still preliminary.
>      >              >
>      >              > When I run this:
>      >              >
>      >              > instr 1
>      >              >
>      >              > kCnt init 0
>      >              >
>      >              > if metro(1) == 1 then
>      >              >
>      >              > schedulek(2,0,1,kCnt)
>      >              >
>      >              > kCnt += 1
>      >              >
>      >              > endif
>      >              >
>      >              > endin
>      >              >
>      >              >
>      >              > instr 2
>      >              >
>      >              > iGate[] = fillarray(0,0,0,1,0,1,0,0)
>      >              >
>      >              > iChordsArr[][] init 2,4
>      >              >
>      >              > iChordsArr[][] = fillarray(51,54,61,65,49,53,60,65)
>      >              >
>      >              > iCnt = (p4%2)
>      >              >
>      >              > print(iNote)
>      >              >
>      >              > indx init 0
>      >              >
>      >              > while indx < 4 do
>      >              >
>      >              > iNote = iChordsArr[iCnt][indx]
>      >              >
>      >              > indx += 1
>      >              >
>      >              > od
>      >              >
>      >              > endin
>      >              >
>      >              > schedule(1,0,3600)
>      >              >
>      >              >
>      >              > I get the error: array-variable dimensions do not
>     match
>      >              >
>      >              >
>      >              > The idea is to use multi-dimensional arrays to play 4-
>      >             note chords, where
>      >              > each chord will be on a line, and each column will
>     give a
>      >             note to the a
>      >              > schedule of a different instrument.
>      >              >
>      >              >
>      >              > Am I missing something?
>      >              > Thanks for the help.
>      >              >
>      >              > Respectfully,
>      >              > Gabriel
>      >              >
>      >              >
>      >              >
>      >              > Csound mailing list Csound@listserv.heanet.ie
>     
>      >                  >
>      >              >      
>      >                  >> https://
>      > listserv.heanet.ie/cgi-bin/ 
>     
>      >             bin/>
>      >              > wa?A0=CSOUND      wa ?
>      >             A0=CSOUND      A0=CSOUND >>
>      >             Send bugs
>      >              > reports to https://github.com/csound/csound/issues
>     
>      >                  github.com/csound/csound/issues>>       > github.com/       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      listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>       > listserv.heanet.ie/cgi-bin/wa?A0=CSOUND      listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>>
>      >             Send bugs reports to
>      > https://github.com/csound/csound/issues      csound/csound/issues> 
>      >             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      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      A0=CSOUND >
>      >     Send bugs reports to https://github.com/csound/csound/issues
>     
>      >          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      github.com/csound/csound/issues>      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      listserv.heanet.ie/cgi-bin/wa?A0=CSOUND>
>     Send bugs reports to
>     https://github.com/csound/csound/issues      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  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