Layer the parts

Your drums and bass are a foundation. Add harmony and a melody, then give each layer room in the mix.

  • Lesson 4
  • 100 BPM

You will learn

  • Turn chord tones into an arpeggio
  • Combine one-bar drums with four-bar musical parts
  • Balance foreground and background without rewriting sounds

Give the bass some harmony

The bass followed C–Am–F–G. These keys use the same progression above it. An arpeggio plays chord tones one at a time: low, middle, high, middle, repeated twice. That makes eight notes per bar.

sequence writes the order inside a bar; cat advances through the four chords. Compare the chords and arpeggios example for the block-chord version.

// The same notes one at a time: sequence instead of stack.
// Low, middle, high, middle — played twice per bar with repeat().
const arpeggio = (low: Pitch, middle: Pitch, high: Pitch) =>
  repeat(sequence(pitch(low), pitch(middle), pitch(high), pitch(middle)), 2)

export const arpeggios = chain(
  fn('cat',
    fn('note', arpeggio('c4', 'e4', 'g4')),
    fn('note', arpeggio('c4', 'e4', 'a4')),
    fn('note', arpeggio('c4', 'f4', 'a4')),
    fn('note', arpeggio('b3', 'd4', 'g4')),
  ),
  ...keysSound(KEYS_DEFAULTS),
)

The harmony layer

Ready

Add a foreground melody

The melody also has four bars. Read each sequence as a phrase: held notes contrast with shorter notes, and a written rest leaves room for the lead sound’s echo tail.

The first bar holds its final C for two beats. In the last bar, D takes three beats and the written fourth beat is a rest. The lead sound adds a quieter, delayed copy.

// 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),
)

The melody layer

Ready

Stack and balance the layers

The drums repeat every bar while bass, arpeggio and melody follow their four-bar phrases. Stacking does not force the parts to have the same phrase length.

The arpeggio is background, so its velocity is 0.6. The melody stays in front at 1. postGain then scales the entire result; it is separate from the balance of individual parts.

// 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),
)

The complete arrangement

Ready

Make it yours

Change the controls, then press Play. While playing, changes apply live; while stopped, they wait for your next Play. The Strudel output tab shows your current values.

Your arrangement

Ready
export const makeArrangement = (bpm: number, melodyLevel: number) => chain(
  fn('stack',
    chain(LAYERS.drums, fn('velocity', 0.9)),
    chain(LAYERS.bass, fn('velocity', 1)),
    chain(LAYERS.chords, fn('velocity', 0.6)),
    chain(LAYERS.melody, fn('velocity', melodyLevel)),
  ),
  fn('postGain', 0.8),
  fn('cpm', bpm / 4),
)

Recap

Lower the melody level to focus on the accompaniment, then bring it forward again. The practice builder uses the same four layers as the complete arrangement.

  • Use different registers and musical roles to separate the parts.
  • Keep each part reusable; combine patterns with fn('stack', …).
  • Scale levels with velocity, then set one shared tempo.

Next, put those layers behind React controls. You can also inspect the Layer a song example.