Click here to watch this tutorial on YouTube™
Formulas can access data from other cells in the pattern. Cells are addressed using simple coordinates, specifying the target cell's channel and row:
[1:0] - the first cell in the pattern (Ch. 1, Row 0)
[2:16] - the cell in Channel 2, Row 16
There is also shorthand for common scenarios, such as the current channel/row and relative addresses:
[32] - the cell in Row 32 of the current channel
[-4] - the cell four rows back, current channel
[+1:+1] - the cell in the next row, next channel
[-1:8] - the cell in Row 8, previous channel
[3:] - the cell in Channel 3, at the current row
Use cell addresses to create the four string parts of "Pachelbel's Canon":
- The eight notes of the ground bass (green) are provided in the first 32 rows of Channel 1. These notes repeat throughout the piece, unchanged. Rather than using copy and paste, we'll use formulas to copy the rows in code.
- After the end of the Bass section, at Row 32 of Channel 1, open the formula editor (=) and add the following expression in the first box, which specifies a formula to define the content of the whole cell:
[01:032][-32]
- Having entered the formula, select the cell (Shift + Cursor keys) and copy it to all subsequent rows of the channel. This pattern is long; to speed up the pasting process, first copy the one cell to fill a bar (16 rows), then select that bar and copy it to fill the rest of the channel.
- Unmute Channel 1 (Alt-1, or Alt-M in the channel) and play the pattern (Alt-Space) to check the notes repeat. Arcs should be drawn to show how cells and formulas use data from other cells (Ctrl-D to toggle).
- The "canon" (green) consists of a melody played by three violins in a round (one starting after another). The notes of the melody are provided in Channel 2 - unmute Channels 2 to 4 and have a listen.
- Use formulas to have Channels 3 and 4 copy the notes of the melody by referencing the previous channel, 32 rows back:
[03:032][-1:-32]
- This formula can be used for both channels, such that Channel 3 copies from Channel 2, and 4 from 3. Enter the formula in [4:32], then copy the cell to every cell in the Violin1 and Violin2 sections.
- Once complete, press Alt-Space to play the pattern from the start and listen to the first bars of the piece. Then continue to part 2, when ready.
Individual properties of cells (pitch, volume, etc.) are accessed using dot (.) notation, like before:
[4].pitch - the pitch in Row 4, current channel
[32:0].volume - the volume in Ch. 32, Row 0
[-1].pitch - the pitch above the current cell
Such syntax is used to create relationships between musical events - shared or linked attributes, where a change in one affects the other. Music has many such relationships - such as intervals, harmony, rhythms, repeats, themes and variations - which can all be captured in formulas.
Use cell pitch data to automatically harmonise the ground bass from "Pachelbel's Canon":
- Mute the original canon in Channels 1-4 (green) and unmute Channels 5-8 (yellow).
- In the first cell of Channel 5 (yellow), enter a formula that grabs the pitch from the Bass in Channel 1, and transposes it up an octave:
[05:000].pitch[1:].pitch + 12
- Notice this only copies the pitch, which would allow us to manually enter other attributes, such as instrument, volume, etc. In this example, however, the channel is preset to "S3 Strings (legato)".
- In the first cell of Channel 6, enter these formulas:
[06:000][5:].pitch.pitch + 4This copies the whole cell from Channel 5, then adds 4 semitones to the pitch create a major third interval.
- Repeat the previous step for Channels 6 and 7, but instead add 7 (perfect fifth) and 11 (major seventh) semitones respectively. The harmony resulting makes a Major Seventh chord, built upon the Canon's grounded bass.
- Now, select and copy the four rows of Channels 5 to 8 so that they repeat throughout the pattern.
- Press Alt-Space to audition the harmony. It should sound more 1990 than 1690. Toggle the formula dependencies to see the relationships in the music.
When ready, continue to step 3.
The remaining channels contain drum, bass, and flute parts that build on your chord sequence, and show how simple formulas can use harmony as the basis for whole song.
Complete the remix with the accompaniments provided in Channels 9 to 13:
- Unmute Channel 9 (Beat) and audition the pattern. This channel is based a drum loop (LM), broken up and 'recycled' using the Oxx (Sample Offset) effect.
The xx parameter sets the proportion of the loop to skip to (in hexadecimal) - 00 is the start, 80 is the middle, 40 is one quarter through, C0 three quarters, 20 one eighth, 10 one sixteenth. Notice how the use of hex (base 16) makes it easy to work with musical times, which are often divisible by 16. - Recycled loops are often accompanied by additional drum programming, as demonstrated in Channel 10, which provides a Percussion part containing hi-hats. Unmute the channel to add it to the mix.
Notice that some cells have a white tag | - this indicates that they have subrow content - between the rows of the pattern. To edit between the rows, press the backslash ('\') key (or '#', on PC) to open up the gap - and again to hide it. - Unmute Channel 11 to reveal the Bass part. This channel contains formulas that reference the root of our chords, but generally only every other beat.
Notice how we can inherit the pitch whenever we want, and also specify a different rhythm or performance style (adding pitch slides; Exx and Fxx). - Finally, unmute Channel 12 to add a Flute part. The flute part also inherits the pitches of our chord, but distributes them in time, rather than playing them at once.
Look at the formulas in the first 8 rows, which take different notes from the chord and transpose them to a higher register (octave). This 'arpeggiates' the chords - playing the four notes of one chord in order: 1 2 3 4, then the next chord's notes in a different order: 4 3 2 3. These formulas are repeated over the rest of the channel to form a melodic sequence. - This channel is accompanied by Channel 13, which is automatically unmuted by the code in the first cell of Channel 12. Here, the original flute part is simply echoed, by copying from earlier cells [-1:-1], and adding a slight delay (SD3) to place it between the rows.
The echo and delay combine to insert a copy of each note after the subsequent note, which creates an interesting melodic counterpoint.