Exercise 9.1 - Harmonic Sequences 1 2  

Last time, we used a counter to track progress through a piece and selectively layer a mix by muting or unmuting channels - enabled by a series of if statements. In this tutorial, we will combine counters with arrays that allow us to use a prescribed specific sequences of chords or note patterns. These techniques can be used to replicate both linear and cyclic harmonic or melodic progressions, commonly found in music.
  This tutorial will also introduce several important built-in functions you can use in formulas to manipulate multiple notes at once - to clear, move, copy, or otherwise process blocks or ranges of cells (e.g. whole arrays).
  We explore these concepts in the recreation of a piece of minimalist piano music, The Departure by Max Richter, written for the HBO TV Series The Leftovers. This piece has a well-defined chord progression and simple melody.

Create a chord sequence based on array data:

Exercise 9.2 - Melodic Sequences 1 2  

While harmonic progressions and textures often feature repeating note patterns, like the arpeggio in the previous exercise, melodic phrases can be longer, spread over several bars or the whole piece. However, they may still have rhythmic patterns that can be exploited by code.
  In this exercise, we'll use an array of notes to specify a melodic part for the piece, where notes are iteratively read and placed at set locations in the bar, as the piece progresses.

Use an array to step through the right hand part: