Bass line
A bass line follows the chords from underneath. Start with one note per chord, give it a rhythm, then lock it to the drums.
You will learn
- Follow a chord progression with roots and fifths, and reuse a rhythm with a small function
One note per chord
The progression is C – Am – F – G, one chord per bar. The simplest bass line plays each chord’s root — the note it is named after — once per bar, well below the chords.
// One note per bar: the root (lowest note) of each chord in C – Am – F – G.
export const roots = chain(
fn('cat',
fn('note', pitch('c2')),
fn('note', pitch('a1')),
fn('note', pitch('f2')),
fn('note', pitch('g2')),
),
...bassSound(BASS_DEFAULTS),
)Roots
Write the rhythm once
Every bar uses the same rhythm with different notes, so write it as a function. The fifth of a chord sits seven semitones above its root and almost always sounds right underneath it.
// A function writes the rhythm once; each bar passes its own root and fifth.
// The fifth is the note seven semitones (five letter names) above the root.
const bassBar = (root: Pitch, fifth: Pitch) => sequence(
pitch(root), rest(), pitch(root), pitch(fifth),
rest(), pitch(root), pitch(fifth), pitch(root),
)Roots and fifths
export const walkingRoots = chain(
fn('cat',
fn('note', bassBar('c2', 'g2')), // C: C and G.
fn('note', bassBar('a1', 'e2')), // Am: A and E.
fn('note', bassBar('f2', 'c3')), // F: F and C.
fn('note', bassBar('g2', 'd3')), // G: G and D.
),
...bassSound(BASS_DEFAULTS),
)Lock it to the drums
The kick and snare come straight from the Backbeat example. Importing a part is how a song grows without copying code.
// The kick and snare from the Backbeat example, under the new bass line.
export const bassWithDrums = chain(
fn('stack', walkingRoots, kickOneThree, snareTwoFour),
fn('cpm', 25),
)