A SuperCollider Array is a collection whose messages return transformed copies and whose arithmetic broadcasts element-wise
Arrays are the most common collection type in SuperCollider — any items in square brackets form an Array. They are also built with constructors: Array.fill(n, {func}) evaluates a function n times and collects the results (the function can take a counter argument), Array.series and Array.geom build arithmetic/geometric series, the shorthand 30!4 equals Array.fill(4, 30), and the range shortcut (50..79) creates an arithmetic series. Arrays understand a wide message vocabulary. Non-destructive methods return new arrays: .reverse, .scramble, .mirror (palindrome), .choose (random element), .size, .at(n) / a[n], .wrapAt(n). Arithmetic broadcasts element-wise: [1,2,3] * 10 => [10,20,30]; [1,2,3] + 10 => [11,12,13]. .do({|item, count| …}) iterates with item and counter; .collect is like .do but returns a new array of results. Destructive methods (.add, .insert, .put) modify the array in place. This functional collection API underpins multichannel expansion and pattern-building.
Examples
a = [10, 11, 12, 13, 14];
a.reverse; // [14, 13, 12, 11, 10]
a.scramble; a.choose;
a + 100; // [110, 111, 112, 113, 114]
a.do({|item| item.postln});
Array.fill(8, {|i| (i+1)*110}); // harmonic series
[60,62,64,65,67,69,71].midicps.round(0.1);
Assessment
Given a = [0, 2, 4, 5, 7, 9, 11], write a one-liner transposing all pitches up one octave (+12), then produce the descending version — no explicit loops. Then use Array.fill with a counter argument to generate 12 MIDI notes starting at 60, stepping by 5.