Lead
A lead carries the melody, so it needs to be heard over everything else. A bright sawtooth, a note-length control and an echo built from the pattern itself.
The sound
The echo is not an audio effect. off plays a second copy of the pattern half a beat later, and its callback turns that copy down with velocity.
export const leadSound = (sound: LeadSettings): PatternModifierCall[] => [
fn('instrument', sample('sawtooth')), // Bright and buzzy: cuts through a mix.
fn('lowPass', sound.cutoff),
fn('attack', 0.01),
fn('decay', 0.1),
fn('sustain', 0.6),
fn('release', 0.08),
fn('clip', sound.length), // Note length as a share of its slot: 1 = legato.
fn('gain', 0.16),
// off() layers a copy shifted by 1/8 of a cycle (half a beat) — an echo.
// The callback changes only the copy: here, how hard it is struck.
fn('off', 0.125, patternCallback(fn('velocity', sound.echo))),
]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 leadAlone = (settings: LeadSettings) => chain(
fn('note', sequence(
pitch('a4'), pitch('c5'), pitch('e5'), pitch('d5'),
pitch('c5'), pitch('a4'), pitch('g4'), rest(),
)),
...leadSound(settings),
fn('cpm', 25),
)How it is built
| Part | Unit | What it does |
|---|---|---|
instrument(sawtooth) | — | The source: bright and buzzy, so it stands out. |
clip | × slot | How much of its slot each note fills. Lower values leave gaps between notes; the rhythm stays. |
off(0.125, …) | cycles | Adds a copy shifted by an eighth of a cycle: half a beat in 4/4. |
velocity (in the copy) | × gain | How loud the echo is compared with the original. 0 silences it. |
In a groove
Your lead over a held A minor chord from the Pad page.
export const leadGroove = (settings: LeadSettings) => chain(
fn('stack',
chain(fn('note', sequence(
pitch('a4'), pitch('c5'), pitch('e5'), pitch('d5'),
pitch('c5'), pitch('a4'), pitch('g4'), rest(),
)), ...leadSound(settings)),
chain(fn('note', CHORDS.Am), ...padSound(PAD_DEFAULTS)), // A held chord underneath.
),
fn('cpm', 25),
)Lead over a pad
Used in: Layer a song · House loop