Keys

Keys are struck notes that fade on their own. A square wave, a filter for brightness and a touch of reverb make a simple electric-organ sound for chords.

  • Synthesized
  • Square + reverb

The sound

With sustain at 0, every note fades by itself after Decay seconds, however long its slot is. That is what makes it sound struck rather than blown.

react-strudel-kit
export const keysSound = (sound: KeysSettings): PatternModifierCall[] => [
  fn('instrument', sample('square')), // Hollow and woody, like an electric organ.
  fn('lowPass', sound.brightness), // Higher lets more of the square wave's edge through.
  fn('attack', 0.002),
  fn('decay', sound.decay),
  fn('sustain', 0), // Every note fades on its own, like a struck key.
  fn('release', 0.1),
  fn('room', sound.room), // Reverb: 0 is dry, higher sounds farther away.
  fn('gain', 0.14),
]

Playing it on its own takes a rhythm, here written next to the sound. Switch to Strudel output to see the values the sliders are playing now.

export const keysAlone = (settings: KeysSettings) => chain(
  fn('cat', fn('note', CHORDS.C), fn('note', CHORDS.Am)), // One chord per bar.
  ...keysSound(settings),
  fn('cpm', 25),
)

How it is built

PartUnitWhat it does
instrument(square)—The source: a hollow wave with odd overtones only.
lowPassHzBrightness. Lower values sound muted, as if played softly.
decay · sustain(0)secondsEach note fades to silence on its own timeline.
room0–1How much reverb is mixed in. More sounds farther away.

In a groove

Your keys strike each chord on beats 2 and 4 — “comping” — over one bass note per bar.

export const keysGroove = (settings: KeysSettings) => chain(
  fn('stack',
    // Each chord struck on beats 2 and 4 instead of held: a "comp".
    chain(fn('cat',
      fn('note', sequence(rest(), CHORDS.C, rest(), CHORDS.C)),
      fn('note', sequence(rest(), CHORDS.Am, rest(), CHORDS.Am)),
    ), ...keysSound(settings)),
    chain(fn('cat', fn('note', pitch('c2')), fn('note', pitch('a1'))), ...bassSound(BASS_DEFAULTS)),
  ),
  fn('cpm', 25),
)

Keys comping over bass

Ready

Used in: Chords and arpeggios · Lo-fi loop