Skip to content

fix(gui): update ReferencePanel + LiveCode defaults to chain API #124

@bwyard

Description

@bwyard

Summary

Several places in the GUI still reference the old pre-chain-API DSL style. These cause runtime errors and show incorrect usage to contributors.

Locations

File Issue
packages/gui/src/renderer/components/shared/ReferencePanel.tsx:87 Track(Synth({ wave: 'sawtooth', pattern: [...], gain: 0.6 })) — old object-props API, no longer valid
packages/gui/src/renderer/components/LiveCode/index.tsx:492 Default snippet Synth('C3').attack(0.01).release(0.4) — wrong arg order ('C3' becomes wave type, not pitch)
packages/gui/src/renderer/components/LiveCode/index.tsx The default song loaded on first launch / new file should be updated to use the correct chain API and serve as a working example contributors can copy
packages/gui/src/renderer/types/score-dsl.d.ts:92 Declares Synth(props?: { wave?, volume? }) — old signature, does not match current Synth(wave, pitch?)

What the correct chain API looks like

import { Song, Kick808, Snare909, Hihat808, Bass303 } from '@score/dsl'

const kick  = Kick808(4).volume(0.8)
const snare = Snare909(2).volume(0.55)
const hihat = Hihat808(8).volume(0.25)

const bass = Bass303('A2')
  .cutoff(600)
  .resonance(0.4)
  .pattern(['A2', 0, 0, 0, 'D3', 0, 0, 0])
  .volume(0.6)

export default Song({ bpm: 128, tracks: [kick, snare, hihat, bass] })

Notes

  • Synth signature is under design review — see design(@score/dsl): Synth signature — wave-first vs pitch-first, add .wave() chain method #125. ReferencePanel and LiveCode default snippets for Synth should wait until that is resolved.
  • All other instruments (Bass303, Pad, SubSynth, FMSynth) are pitch-first. Synth is the outlier.
  • score-dsl.d.ts is a manually maintained ambient declaration for the Monaco editor. It must stay in sync with packages/dsl/src/melodic.ts and chain.ts.
  • The default song loaded on new file / first launch should be a clean, working chain API example that doubles as a contributor reference.

Acceptance criteria

Blocked by: #125 (Synth signature) for the Synth-specific snippets

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions