Summary
Add five music theory utility functions to packages/dsl/src/theory.ts. These are used in song files to build progressions, transpose ideas, and explore harmonic relationships without memorising interval tables.
Expected API
import { scale, chord, transpose, relativeMinor, dominantOf } from '@score/dsl'
// Transpose a note or array of notes by semitones
transpose('A2', 7) // → 'E3'
transpose(['C3','E3','G3'], 5) // → ['F3','A3','C4']
// Relative minor of a major key
relativeMinor('C') // → 'A'
relativeMinor('G') // → 'E'
// Dominant (V chord root) of a key
dominantOf('C') // → 'G'
dominantOf('Am') // → 'E'
// Parallel major of a minor key (same root, major mode)
parallelMajor('Am') // → 'A'
// Mode of a scale
modeOf('C', 2) // → 'D Dorian'
modeOf('C', 5) // → 'G Mixolydian'
Where to make the change
packages/dsl/src/theory.ts — add the five functions
packages/dsl/src/index.ts — export them
packages/gui/src/renderer/types/score-dsl.d.ts — ambient declarations for Monaco
Notes
- All functions are pure — same input, same output, no side effects
transpose should handle note strings like 'A2', 'C#3', 'Bb4'
- Must ship with unit tests covering edge cases (sharps, flats, octave boundaries)
- TSDoc required on all five exports
Good first issue — pure functions, well-defined music theory rules, no engine wiring needed.
Summary
Add five music theory utility functions to
packages/dsl/src/theory.ts. These are used in song files to build progressions, transpose ideas, and explore harmonic relationships without memorising interval tables.Expected API
Where to make the change
packages/dsl/src/theory.ts— add the five functionspackages/dsl/src/index.ts— export thempackages/gui/src/renderer/types/score-dsl.d.ts— ambient declarations for MonacoNotes
transposeshould handle note strings like'A2','C#3','Bb4'Good first issue — pure functions, well-defined music theory rules, no engine wiring needed.