You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Synth currently takes (wave, pitch?) — the wave type is the first arg. This is inconsistent with the rest of the DSL (Bass303('A2'), Pad('A3'), SubSynth('C2') are all pitch-first) and creates a silent footgun: Synth('C3') treats 'C3' as the wave type with no error.
Context — how synths work musically
A synth is a voice architecture, not a note. In every major live coding tool, pitch lives in the pattern:
TidalCycles — d1 $ sound "bd" # note "c3" — pitch is always at the play site
Sonic Pi — play :C3 — synth definition is architecture only
SuperCollider — synth def is architecture, pitch is a control signal
This means Synth() or Synth(wave) is more musically honest than Synth(pitch). The note belongs in .pattern() or .notes().
Bass303('A2') and Pad('A3') are the exception — they describe a specific voiced line, where the root note is part of the instrument definition. A general Synth is not that.
Proposed resolution
Make Synth() take no required args — default wave is 'sawtooth'
Add .wave() as a chain method so the voice can be described fluently:
Problem
Synthcurrently takes(wave, pitch?)— the wave type is the first arg. This is inconsistent with the rest of the DSL (Bass303('A2'),Pad('A3'),SubSynth('C2')are all pitch-first) and creates a silent footgun:Synth('C3')treats'C3'as the wave type with no error.Context — how synths work musically
A synth is a voice architecture, not a note. In every major live coding tool, pitch lives in the pattern:
d1 $ sound "bd" # note "c3"— pitch is always at the play siteplay :C3— synth definition is architecture onlyThis means
Synth()orSynth(wave)is more musically honest thanSynth(pitch). The note belongs in.pattern()or.notes().Bass303('A2')andPad('A3')are the exception — they describe a specific voiced line, where the root note is part of the instrument definition. A generalSynthis not that.Proposed resolution
Synth()take no required args — default wave is'sawtooth'.wave()as a chain method so the voice can be described fluently:pitchconstructor arg — pitch always goes in.notes()or.pattern()score-dsl.d.ts,LiveCode/index.tsxdefaults, andReferencePanel.tsx(tracked in fix(gui): update ReferencePanel + LiveCode defaults to chain API #124)Files to change
packages/dsl/src/melodic.ts— Synth factory signaturepackages/dsl/src/chain.ts— add.wave()toChainMethods<T>packages/gui/src/renderer/types/score-dsl.d.ts— ambient type declarationpackages/gui/src/renderer/components/LiveCode/index.tsx— default snippetpackages/gui/src/renderer/components/shared/ReferencePanel.tsx— reference exampleOpen questions
.wave()be on all instruments or onlySynth/SubSynth? Bass303 and FMSynth have their own timbre controls.Synth(pitch?)remain as a convenience overload, or is removing it cleaner?Blocked by: #124 (ReferencePanel update should land after this is resolved)