AsNoteNames operator
<< Click to Display Table of Contents >> Navigation: Basic concepts > Operators > AsNoteNames operator |
The operator AsNoteNames followed by an integer range creates a string array whose values are strings of MIDI note names matching the integer range.
Usage with string arrays:
Var notes : String Array = AsNoteNames C3 .. E3
is equivalent to writing:
Var notes : String Array = ["C3", "C#3", "D3", "D#3", "E3"]
Usage with scriptlet parameters:
Var notes : parameter AsNoteNames C3 .. E3 = "C3"
This is equivalent to writing
Var notes : parameter "C3", "C#3", "D3", "D#3", "E3" = "C3"
Note the slightly different syntax between the two versions. In the former, we have created a string array and are assigning a sequence of strings to it. In the latter, the sequence of strings causes the parameter to be a discrete parameter and the assignment is used to specify the initial value of the parameter.