3.7 KiB
3.7 KiB
Tasks: enterprise-audio-controllers
Change ID: enterprise-audio-controllers
Package: @suaveplan/audio-controllers
Target path: packages/audio/audio-controllers
Prerequisite packages on Verdaccio: @suaveplan/audio-core, @suaveplan/audio-transport, @suaveplan/events, @suaveplan/error, @suaveplan/types
1. Scaffold
- Create directory
packages/audio/audio-controllers/withsrc/,tests/,src/__benchmarks__/,src/plugins/,tests/e2e/, and all feature subdirectories per the layout inproposal.md. - Write
package.jsonat version0.1.0with"type": "module","sideEffects": false, fullexportsmap, deps:@suaveplan/audio-core workspace:^,@suaveplan/audio-transport workspace:^,@suaveplan/events workspace:^,@suaveplan/error workspace:^,@suaveplan/types workspace:^,@suaveplan/opentelemetry workspace:^,zod catalog:forms. - Write
tsconfig.jsonextending@suaveplan/typescript-config/library.json. - Write
vitest.config.tsusingcreateTestConfig()from@suaveplan/testing/configwithhappy-domenvironment for Web MIDI mocking. - Add
lint,typecheck,test,test:coverage,build,docs:checkscripts.
2. Types + errors
- Write
src/error-codes.ts—AudioControllerErrorCode,AUDIO_CONTROLLER.*codes,registerAudioControllerErrorCodes(). - Write Zod schemas:
ControllerMetadataSchema,CCMappingSchema,LEDUpdateSchema.
3. Base classes
- Implement
MidiControllerPluginabstract base class with:- MIDI lifecycle (
requestAccess,onStateChange) - LED feedback (
flushLEDs) - CC mapping DSL (
defineMappings) - Learn mode (
enterLearnMode,exitLearnMode) - Event bus (
on,off) - Sequencer access
- MIDI lifecycle (
- Write
midi-controller-plugin.test.tsandmidi-controller-plugin.md(≥200 words). - Implement
Sequencerclass using@suaveplan/audio-transportfor scheduling. - Write
sequencer.test.tsandsequencer.md(≥200 words). - Implement
Arpeggiatorclass asTransportevent subscriber. - Write
arpeggiator.test.tsandarpeggiator.md(≥200 words). - Implement
LearnModefor CC mapping capture. - Write
learn-mode.test.tsandlearn-mode.md(≥200 words).
4. Device plugins
- Implement
KontrolS88Pluginwith scale modes, arp modes, pitch/mod wheel, LED control. - Write
kontrol-s88.test.tsandkontrol-s88.md(≥200 words). - Implement
MaschinePluginwith pad velocity, step sequencing, sample loading. - Write
maschine.test.tsandmaschine.md(≥200 words). - Implement
TraktorS4Pluginwith deck loading, crossfader, channel volume. - Write
traktor-s4.test.tsandtraktor-s4.md(≥200 words).
5. Benchmarks
- Write
src/__benchmarks__/midi.bench.ts— MIDI message throughput, sequencer step scheduling.
6. Tests
- Write
tests/integration.test.ts— controller → sequencer → transport → synth trigger. - Write
tests/e2e/kontrol-s88.e2e.test.tswith mocked Web MIDI. - Write
tests/e2e/maschine.e2e.test.tswith mocked Web MIDI. - Write
tests/e2e/traktor-s4.e2e.test.tswith mocked Web MIDI.
7. Docs + verify + publish
- All co-located
.mdfiles (≥200 words each). - Write
README.mdat package root. bunx turbo lint typecheck test --filter=@suaveplan/audio-controllers— green.bunx turbo test:coverage --filter=@suaveplan/audio-controllers— 100%.bun scripts/publish.ts --package @suaveplan/audio-controllers.- Fold
specs/audio-controllers/spec.mdintoopenspec/specs/audio-controllers/spec.md. - Archive to
openspec/archive/2026-05-14-enterprise-audio-controllers/.