Scripter Javascript Tutorial
javascriptmusiclogicscripterbookexcerpttutorial44 Update Data in an Array
Stored values in arrays are counted sequentially starting with 0 and going all the way to n − 1 (the number of values as a person would count them minus 1). To update the data already in the array, the index is used within brackets after the array’s name:
var scale = [60, 62, 64, 65, 67, 69, 71];
// make the C Major scale Lydian
3] = 66; // raise the 4th scale degree by a half step
scale[Trace(scale); // 60,62,64,66,67,69,71