Hello Everybody!
I’m working on a instrument where i can save multiple arrays in one array. Then i want to read these arrays out, one after another.
For example:
iArr1[] = 1, 2, 3, 4, 5
iArr2[] = 11, 22, 33, 44, 55
iArr3[] = 111, 222, 333, 444, 555
iAllArr[] = iArr1, iArr2, iArr3
After this i want to create automatically a new array with all the values like this:
iAllValues[] = 1, 2, 3, 4, 5, 11, 22, 33, 44, 55, 111, 222, 333, 444, 555
I already done this and this working quit well:
kPtr1[] fillarray 1, 2, 3, 4
kPtr2[] fillarray 11, 12, 13
iSngLng = lenarray(kPtr1) + lenarray(kPtr2)
gkPtrCmpl[] init iSngLng
kSngNdx init 0
kRdNdx init 0
kActPtr[] = kPtr1
while kSngNdx < iSngLng do
kNewValue = kActPtr[kRdNdx]
gkPtrCmpl[kSngNdx] = kNewValue
kRdNdx += 1
kSngNdx += 1
if kRdNdx == lenarray(kActPtr) then
kRdNdx = 0
kActPtr = kPtr2
endif
od
But this is only a solution for two arrays as input for a new array.
I want to use a abritary number of kPtrN - Arrays as Input for another Array (iPtrChain[] = iPtr1, iPtr1, iPtr2).
Then i want to read all the values into a new array.
How can i come there?
Greetings,
Philipp
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here