# Tasks — enterprise-audio-fx-plugin-spessasynth ## 0. Pre-flight (non-negotiable) - [ ] 0.1 Confirm clean working tree (`git status` reports nothing) and no in-flight worktrees with uncommitted work (`git worktree list` then `git status` in each) - [ ] 0.2 Account for every `.claude/worktrees/*` entry; prune stale ones via `bun scripts/worktree-prune.ts --remove`. - [ ] 0.3 Confirm `MANIFEST.md` matches `find packages -maxdepth 3 -name package.json | wc -l`. ## 1. Spec authoring - [ ] 1.1 Draft `proposal.md` (this file's sibling), `tasks.md`, `specs/audio-fx-plugin-spessasynth/spec.md` ## 2. Catalog additions - [ ] 2.1 Add `spessasynth_lib` (latest stable, pinned) to `catalog:audio` in root `package.json` - [ ] 2.2 `bun install` to update lockfile ## 3. Implementation - [ ] 3.1 `src/error-codes.ts` — `SPESSASYNTH.{SOUNDFONT_LOAD_FAILED, SOUNDFONT_PARSE_FAILED, UNSUPPORTED_FORMAT, VOICE_LIMIT_EXCEEDED, NOT_INITIALIZED}` via `defineCodes` - [ ] 3.2 `src/loader/soundfont-loader.ts` — lazy `import("spessasynth_lib")`, async URL/bytes fetch, SF2/SF3 parse, validation - [ ] 3.3 `src/midi-router/midi-router.ts` — `MidiPortLike` consumer; channel-voice → synth, program-change → preset, NRPN/RPN → registered handlers - [ ] 3.4 `src/parameters/parameters.ts` — 16-channel × 5-param + master surface; bound through `audio-fx-plugin-base` automation - [ ] 3.5 `src/voice-manager/voice-manager.ts` — `getActiveVoiceCount`, `setMaxPolyphony`, `allNotesOff`, voice-stealing - [ ] 3.6 `src/plugin/spessasynth-plugin.ts` — implements `AudioFxPlugin` (`init`, `process`, `dispose`, `getParameters`, `snapshot`, `restore`) - [ ] 3.7 `src/telemetry/telemetry.ts` — counter `spessasynth_voices_triggered_total`, gauge `spessasynth_voices_active`, histogram `spessasynth_process_duration_us` - [ ] 3.8 `src/register/register.ts` — register the plugin with `PluginChain`'s discovery ## 4. Tests - [ ] 4.1 Per-feature `.test.ts` covering every scenario - [ ] 4.2 `tests/integration.test.ts` — load a vendored SF2 fixture, render a C-major chord through `process()`, assert non-zero RMS - [ ] 4.3 `tests/midi-routing.test.ts` — feed a 4-bar MIDI sequence, assert correct voice activations - [ ] 4.4 `tests/automation.test.ts` — automate volume on channel 1 over a render, assert output envelope matches the schedule - [ ] 4.5 Every `it(...)` has `{ timeout: 5000 }` (30000 for the integration that loads SF2) ## 5. Documentation - [ ] 5.1 Sibling `.md` per `.ts` (≥200 words, basic + advanced examples) - [ ] 5.2 README with quickstart + SF2 loading example + control-surface integration example ## 6. Pre-archive verification - [ ] 6.1 `bunx turbo lint typecheck test --filter=@suaveplan/audio-fx-plugin-spessasynth` — green - [ ] 6.2 `bunx turbo test:coverage --filter=@suaveplan/audio-fx-plugin-spessasynth` — 100/100/100/100 - [ ] 6.3 `bunx turbo build --filter=@suaveplan/audio-fx-plugin-spessasynth` — green ## 7. Archive - [ ] 7.1 Fold spec delta → `openspec/specs/audio-fx-plugin-spessasynth/spec.md` - [ ] 7.2 Move folder → `openspec/archive/-enterprise-audio-fx-plugin-spessasynth/` - [ ] 7.3 Refresh `MANIFEST.md` - [ ] 7.4 Prune worktree