You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
according to the manual, the usage of initalizing an array was first:
tab init isize[, ival]
and the comment is: "The t-variable form was introduced in 5.14 and allocated space for a vector or the given size, initialised to the given value (default value is zero)."
i would like to see this in Csound6 again, so
kArr[] init 3, 1
would result in [1, 1, 1](currently, there is no effect of the second argument)
a two-dimensional array could be filled with inital values like this:
kArr[][] init 3, 2, -1
-> [[-1, -1], [-1, -1], [-1, -1]]
so init should
look for the dimensions of the array on left hand side, and if
there is an extra argument on the right hand side, sompared to the number of dimensions, this argument should be interpreted as default value of the array elements.
so, for a string array, it would be:
S_array[] init 5, "hi"
-> ["hi", "hi", "hi", "hi", "hi"]
The text was updated successfully, but these errors were encountered:
I discussed this with @vlazzarini and @jpffitch and it seems like this may be confusing syntax. Suggested is to use fillarray after using init, and to leave the existing syntax as-is. I think with Csound 7 and array initializers (i.e. myArray:i[] = [1,2,3,4,5]) this won't be such a big issue.
according to the manual, the usage of initalizing an array was first:
tab init isize[, ival]
and the comment is: "The t-variable form was introduced in 5.14 and allocated space for a vector or the given size, initialised to the given value (default value is zero)."
i would like to see this in Csound6 again, so
kArr[] init 3, 1
would result in [1, 1, 1](currently, there is no effect of the second argument)
a two-dimensional array could be filled with inital values like this:
kArr[][] init 3, 2, -1
-> [[-1, -1], [-1, -1], [-1, -1]]
so init should
so, for a string array, it would be:
S_array[] init 5, "hi"
-> ["hi", "hi", "hi", "hi", "hi"]
The text was updated successfully, but these errors were encountered: