Fugematon is a deterministic fugue generator. The core package generates a tick-based four-voice score from a seed, the CLI exports JSON diagnostics or MIDI files, and the web app plays the generated fugue-form score with WebAudio while showing a Canvas piano roll.
- Node.js version from
.nvmrc - pnpm version from
package.json
If Corepack is not already enabled, run:
corepack enableInstall workspace dependencies:
pnpm installBuild all packages and the web bundle:
pnpm buildRun the full test suite:
pnpm testBuild before using the CLI, because the root fugematon script runs the compiled CLI entrypoint:
pnpm buildGenerate ScoreEvent JSON to stdout:
pnpm fugematon generate --seed fugue-smoke --ticks 7680Write ScoreEvent JSON to a file:
pnpm fugematon generate --seed fugue-smoke --ticks 7680 --out fugue-smoke.jsonPrint diagnostics:
pnpm fugematon diagnose --seed fugue-smoke --ticks 7680Export MIDI:
pnpm fugematon midi --seed fugue-smoke --ticks 7680 --out samples/fugue-smoke-exposition.midThe sample MIDI command is also available as:
pnpm samples:generateStart the Vite development server:
pnpm web:devOpen the local URL printed by Vite. The app lets you:
- Enter a seed and regenerate the deterministic fugue-form score.
- Play a score with exposition, episode, subject return, and stretto-like states.
- Press Start to begin WebAudio playback after the required browser user gesture.
- Press Stop to stop scheduled playback.
- Watch a fixed-window Canvas piano roll follow playback while entry-plan subject highlights stay readable.
Run the headless browser smoke inspection:
pnpm ui:inspectThe inspection starts the Vite development server, checks desktop and mobile Chromium viewports, captures screenshots, and fails on browser console errors.
Run the same smoke inspection against the production bundle:
pnpm build
pnpm ui:inspect:prodThe production inspection serves packages/web/app-dist with Vite preview and is used as the pre-deploy GitHub Pages gate.
Regenerate the Open Graph preview image:
pnpm web:og-imageCreate a production web build:
pnpm buildpackages/core: deterministic score generation, diagnostics, and PRNG.packages/performance: shared performance profile conversion for MIDI and WebAudio rendering.packages/midi: standard MIDI export from score events and performance profiles.packages/cli: command-line wrapper around the core generator.packages/web: Vite app for browser playback and visualization.docs: design notes, technical plan, and implementation history.samples: generated sample artifacts for manual listening checks.
Read docs/README.md for implementation context.