Files
settled-reach/docs/diagrams/architecture/audio-bus.d2
T
jpmschweitzerandClaude Opus 4.6 1e556ccca2 docs(diagrams): add decision diagrams across all domains
16 d2 diagrams covering architecture (IPC bridge, system tiers,
testability, audio bus), data flow (perception, dialogue, eavesdrop
pipelines), entity (knowledge graph, NPC generation, dialogue tags),
state (simulation tiers, movement stances, knowledge confidence), and
UI (HUD layout, interaction flow, fog layers). PNG output for universal
viewer compatibility. Removes test SVG from font debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:57:07 +01:00

122 lines
3.8 KiB
Plaintext

# Audio Architecture — D-068, D-073
# 5-bus audio system with zone crossfade and AudioManager singleton.
vars: {
color-bg: "#2a3040"
color-stroke: "#333340"
color-text: "#c8d0e0"
color-accent: "#c8d8f0"
color-dim: "#1a1e24"
}
direction: down
server_event: Rust Server\n(ObserverSnapshot) {
shape: hexagon
style.fill: ${color-bg}
style.stroke: ${color-accent}
style.font-color: ${color-text}
zone_id: zone_id per tile {
style.fill: ${color-dim}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
sound_events: sound events {
style.fill: ${color-dim}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
}
manager: AudioManager\n(GDScript autoload singleton) {
shape: hexagon
style.fill: ${color-bg}
style.stroke: ${color-accent}
style.font-color: ${color-text}
registry: Directory-scan registry\n(res://audio/ on startup) {
style.fill: ${color-dim}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
crossfade: Zone crossfade\n1.5-2s tween on zone_id change {
style.fill: ${color-dim}
style.stroke: ${color-accent}
style.font-color: ${color-text}
}
}
buses: 5-Bus Mixer {
style.fill: ${color-dim}
style.stroke: ${color-accent}
style.font-color: ${color-text}
music: Bus 1 — Music\n(reserved · empty v0.1) {
style.fill: ${color-bg}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
style.stroke-dash: 5
}
ambient: Bus 2 — Ambient\n(station hum + zone overlays) {
style.fill: ${color-bg}
style.stroke: ${color-accent}
style.font-color: ${color-text}
}
world_sfx: Bus 3 — World SFX\n(NPC footsteps · doors · env events) {
style.fill: ${color-bg}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
player_actions: Bus 4 — Player Actions\n(footsteps · future: combat · items) {
style.fill: ${color-bg}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
ui_sounds: Bus 5 — UI Sounds\n(cursor hover · implant open · chimes) {
style.fill: ${color-bg}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
}
sliders: Player Volume Sliders\n(1 per bus · in Settings) {
shape: queue
style.fill: ${color-dim}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
dips: Audio Dip Profiles (D-069) {
style.fill: ${color-dim}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
dialogue_dip: Dialogue\nAmbient -6 to -8dB · 300ms in {
style.fill: ${color-bg}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
confrontation_dip: Confrontation\nAmbient -10 to -12dB + LPF · 500ms in {
style.fill: ${color-bg}
style.stroke: ${color-accent}
style.font-color: ${color-text}
}
listen_boost: ListeningFocus\nWorld SFX +2 to +3dB\n(stationary 30+ ticks) {
style.fill: ${color-bg}
style.stroke: ${color-stroke}
style.font-color: ${color-text}
}
}
server_event.zone_id -> manager.crossfade: "zone change" { style.stroke: ${color-accent} }
server_event.sound_events -> manager: "typed events" { style.stroke: ${color-stroke} }
manager.registry -> manager.crossfade: "filename → AudioStream" { style.stroke: ${color-stroke} }
manager -> buses.ambient: "loop" { style.stroke: ${color-accent} }
manager -> buses.world_sfx: "event" { style.stroke: ${color-stroke} }
manager -> buses.player_actions: "event" { style.stroke: ${color-stroke} }
manager -> buses.ui_sounds: "event" { style.stroke: ${color-stroke} }
sliders -> buses: "proportional volume" { style.stroke: ${color-stroke} }
dips -> buses.ambient: "proportional dip" { style.stroke: ${color-stroke}; style.stroke-dash: 4 }
dips -> buses.world_sfx: "proportional dip" { style.stroke: ${color-stroke}; style.stroke-dash: 4 }