I’m digging a little bit into the array facility of csound.
I wanted to created a array with values which defines the starting time (p2 - field) for triggering an instrument via the 'event‘ opcode.
This array should be a result out of another array, which holds values that define note-lengths/the duration of the instrument call.
iStartValue = 0
kNewVal init iStartValue
while kDurIndex < lenarray(iDurArr) do
gkStartTimeArr[] = kNewVal
printk2 kNewVal
kLastVal = kNewVal
kNewVal = kLastVal + iDurArr[kDurIndex]
kDurIndex += 1
od
endin
I get the right results. But when i understand it right, the gkStartTimeArr just exists temporarily and i can’t call the values when i need them. I want to combine this array with this kind of process:
while kDurIndex < lenarray(iDurArr) do
event "i", 100, gKStartTimeArr[kDurIndex], iDurArr[kDurIndex]
kDurIndex += 1
if kDurIndex == lenarray(iDurArr) then
kDurIndex = 0
endif
od
How can i pair them that they work together? I don’t get it right now.
I would suggest to add some infos to the floss manual about this.
At least for me it is not very clear how this process is working just from reviewing the floss manual. E.g. this example:
iArr[] fillarray 1, 2, 3
iNew[] = iArr + 10 ; -> 11 12 13 as new array
iArr += 10 ; iArr is now 11 12 13
it doesn’t tell me that i have to create iNew[] from the beginning and that i have to use the index for this.
But maybe i’m the only person?
i understand what you mean. we just had a discussion on this list about the equal sign for arrays, or not working. it seems to be a bit complicated. probably in csound 7 (so perhaps soon =) it will be easier.
i am currently working on a new Getting Started for the floss manual. i hope i can cover some of these steps and traps. once i finished what i am doing now, i will send a link here on this list, and any suggestions will be appreciated.