Skip to content

feat(@score/dsl): add .tremolo(rate, depth) chain method #126

@bwyard

Description

@bwyard

Summary

Add .tremolo(rate, depth) as a chain method on all instruments. Tremolo is amplitude modulation — the volume oscillates at rate Hz with depth controlling the intensity (0–1). Essential for vintage organ, guitar, and lo-fi sounds.

Expected API

// Tremolo on a pad — slow, subtle wobble
Pad('C3').attack(0.3).tremolo(4, 0.3).volume(0.5)

// Faster tremolo on a plucked string
Pluck('E4').tremolo(8, 0.6).volume(0.7)

Where to make the change

  1. packages/dsl/src/chain.ts — add readonly tremolo: (rate: number, depth: number) => T to ChainMethods<T> interface, implement in createPart()
  2. packages/dsl/src/validators.ts — add validation: rate > 0, depth 0–1
  3. packages/gui/src/renderer/types/score-dsl.d.ts — add to ambient declarations for Monaco IntelliSense
  4. Engine wiring in packages/components/ — connect _tremolo descriptor prop to a TremoloNode (LFO → GainNode)

Notes

  • Follow the pattern of existing fx chain methods: .chorus(), .phaser() in chain.ts
  • The LFO infrastructure is already in @score/modulation — use it
  • Must ship with tests and TSDoc
  • Rate is in Hz (not BPM-synced — that's a separate tremoloSync concern)

Good first issue — self-contained chain method addition, clear scope, no planning required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions