No you can't.
Or rather, you can achieve that result but you can't simply choose an array from an array of arrays with an !EventValue.
"This doesn't work"
!Select of: #(
#( 1 2 3)
#( 4 5 6))
The reason is that the answer (or result) of any Capytalk expression is always a number. A Capytalk expression cannot return an Array (or String or any other data type).
To select values from a two-dimensional array you need to include some Capytalk within the array.
eg.
Say you want to select a single number from this array:
#(
(0.0 0.1 0.2 0.3)
(1.0 1.1 1.2 1.3)
(2.0 2.1 2.2 2.3)
)
The way you would do it is like this:
!Y of: #(
{!X of: (0.0 0.1 0.2 0.3)}
{!X of: (1.0 1.1 1.2 1.3)}
{!X of: (2.0 2.1 2.2 2.3)}
)
In this case if !X is 1 and !Y is 2 the result would be 2.1 (of: is zero based).
(We enclose the "!X of: ..." expressions in curly brackets {}, because arrays in Smalltalk/Capytalk are space delimited. Without the {}s Smalltalk would try to interpret the !X as an element of the array followed by "of:" as another element, which doesn't make sense.)
This works because all of the "!X of:..." expressions return a single number and the "Y of:..." then chooses a single number from the array of single numbers created by the "!X of:..." expressions.
You can select an entire array with an !EventValue in a parameter that expects an array (eg. the parameters of the ModalFilter).
Let's say you wanted to select one of the arrays from the example array above, eg. (1.0 1.1 1.2 1.3).
You would do that like this:
#(
{!Select of: #(0.0 1.0 2.0)}
{!Select of: #(0.1 1.1 2.1)}
{!Select of: #(0.2 1.2 2.2)}
{!Select of: #(0.3 1.3 2.3)}
)
Here the structure of the array is constructed by Smalltalk at compile time. The contents of each element of that array is selected at runtime by Capytalk. Again each Capytalk expression ("!Select of:...") is only returning a single number.
Notice though to do this we've had to transpose the structure of our original array. The columns become rows and the rows become columns.
If you have a lot of data already structured in the arrays you want to select, like the original example, then it can be a bit of a pain to transpose the array by hand.
Here's a bit of Smalltalk that transposes arrays:
| transposer myArr |
"First we define a Smalltalk block (like a function or procedure) that transposes arrays"
transposer := [:arr|
(1 to: arr first size) collect: [:column| arr collect: [:row| row at: column]]
].
"Here's our test array"
myArr := #(
#( 1 2 3 4)
#(11 12 13 14)
#(21 22 23 24)).
"Now we run the function on our test array"
transposer value: myArr
So let's put this all together for the example of the ModeAmps field of the ModalFilter.
{
| amps transposedAmps transposer |
"Our sets of amplitudes:"
amps := #(
#(0.8 0.7 0.5 0.21 0.11 0.09)
#(0.75 0.65 0.2 0.21 0.1 0.03)
#(0.65 0.63 0.45 0.42 0.3 0.1)
).
"Define our transposer block"
transposer := [:arr|
(1 to: arr first size) collect: [:column| arr collect: [:row| row at: column]]
].
"Create the transposed array"
transposedAmps := transposer value: amps.
"Now we insert the !Select EventValue into each row of the transposed array to select the elements we want."
transposedAmps collect: [:row| !Select of: row]
}
If you compile (CMD-Y) this code you get:
(
!Select of: #( 0.8 0.75 0.65 )
!Select of: #( 0.7 0.65 0.63 )
!Select of: #( 0.5 0.2 0.45 )
!Select of: #( 0.21 0.21 0.42 )
!Select of: #( 0.11 0.1 0.3 )
!Select of: #( 0.09 0.03 0.1 )
)
(I've reformatted that to make it easier to read.)