Public-alpha playback must flow through this path:
SongDNA
-> SourceClassifier / stem manifest
-> ProducerBrain
-> RemixBlueprintGenerator
-> ArrangementReconstructionEngine
-> TimelineEventV2[]
-> EventScheduler
-> TimelineEventRouter
-> ToneAdapter
-> BusGraph
-> Audio Output
No UI component, server handler, scene trigger, macro, or engine helper should schedule sound outside:
TimelineEventV2[] -> EventScheduler -> TimelineEventRouter -> ToneAdapter -> BusGraph
ArrangementReconstructionEnginecreatesTimelineEventV2[].EventSchedulervalidates, deduplicates, orders, and clears scheduled events.TimelineEventRoutermapsTimelineEventV2to typed playback actions.ToneAdapterowns rendering primitives and Tone transport callbacks.BusGraphowns Tone/WebAudio nodes and the final output path.
WubLabz engine uses a robust Tone.js effect graph managed by BusGraph. All playback events are dynamically routed to specific named buses, which merge into a master effects chain before reaching the destination.
Inputs: [drum, bass, melody, vocal, fx, preview, render]
↓
(Tone.Channel per bus)
↓
preMasterNode (Tone.Gain)
↓
filterNode (Tone.Filter)
↓
distortionNode (Tone.Distortion)
↓
delayNode (Tone.FeedbackDelay)
↓
reverbNode (Tone.Reverb)
↓
masterGainNode (Tone.Gain)
↓
Destination
The WebSocket protocol exposes abstract parameters. The BusGraph physically binds these to Tone.js AudioParams:
| Protocol Target | Tone.js Mapping | Type / Unit |
|---|---|---|
filter.cutoff |
filterNode.frequency |
Hz |
filter.resonance |
filterNode.Q |
Q |
reverb.wet |
reverbNode.wet |
Normalized (0-1) |
delay.feedback |
delayNode.feedback |
Normalized (0-1) |
delay.wet |
delayNode.wet |
Normalized (0-1) |
distortion.drive |
distortionNode.distortion |
Normalized (0-1) |
master.volume |
masterGainNode.gain |
Normalized (0-1) |
An EMERGENCY_STOP event cascades safely through the engine layers:
- Server Transport:
WubLabzEngine.emergencyStop()clears playback transport scheduling and haltsTone.Transport. - Modulation Adapter: Wipes
activeModulationsstate and fires reset routines. - Scene Scheduler: Clears
queuedSceneandcurrentScene. - BusGraph Audio:
- Immediately sets
.mute = trueon all inputTone.Channelbuses. - Clears pending automations via
cancelScheduledValues(Tone.now())on all effect parameters. - Rapidly ramps
masterGainNode.gainto0.
- Immediately sets
The BusGraph handles missing or incomplete Tone instances defensively. In Node.js testing environments, where WebAudio API is not fully available, BusGraph binds to proxy objects and gracefully ignores un-schedulable automations (e.g. falling back to simple assignment if exponentialRampTo is undefined), preventing test suite crashes.
- Source classification is still stem-manifest driven; no full stem separation worker exists yet.
- Slice/chop, macro, gain, and modulation route actions are typed by
TimelineEventRouter, but most are marker-level actions until full renderer support is implemented. ToneAdapterdrops renderable events if noBusGraphis attached; it must never fall back to direct destination output.