Layer a song
Drums, bass, chords and a melody — each written on its own page — stacked into one song and balanced so every part can be heard.
You will learn
- Combine finished parts with
stackand balance them withvelocityandpostGain
Drums
The kick, snare and hi-hats from the Backbeat example, stacked into one part.
export const drums = fn('stack', kickOneThree, snareTwoFour, eighthHats)Drums
Melody
A new four-bar tune for the lead sound. Bass and chords are imported from the Harmony examples.
// Four bars over C – Am – F – G. Most notes belong to the chord underneath;
// the others (D, B, and the E that ends bar 3) step between chord notes.
export const melody = chain(
fn('cat',
fn('note', sequence(pitch('e5'), pitch('d5'), weight(pitch('c5'), 2))),
fn('note', sequence(pitch('c5'), pitch('b4'), weight(pitch('a4'), 2))),
fn('note', sequence(pitch('a4'), pitch('c5'), pitch('f5'), pitch('e5'))),
fn('note', sequence(weight(pitch('d5'), 3), rest())),
),
...leadSound(LEAD_DEFAULTS),
)Melody
Stack and balance
Stacking parts adds their volumes together. velocity scales each part as a whole, so the arpeggio can sit behind the melody without editing its sound. postGain then turns the finished mix down so it doesn’t distort.
// velocity scales a whole part without touching its sound: the mix balance.
export const song = chain(
fn('stack',
chain(drums, fn('velocity', 0.9)),
chain(walkingRoots, fn('velocity', 1)),
chain(arpeggios, fn('velocity', 0.6)), // Background: quieter.
chain(melody, fn('velocity', 1)), // Foreground: full.
),
fn('postGain', 0.8), // Turn the whole mix down a little.
fn('cpm', 25),
)