# rapt0p7/scenegrid-console architecture

> Architecture diagram of the GitHub repository rapt0p7/scenegrid-console, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rapt0p7/scenegrid-console
- Repository: https://github.com/rapt0p7/scenegrid-console

## Overview

SceneGrid combines a real-time Web Audio runtime with asset preparation and developer-facing observability/control tools. The principal workflow is game audio requests entering the engine, being orchestrated and routed through buses to master output, while runtime state is exposed for inspection and control. The README documents the major runtime capabilities; source excerpts and the SOURCE INDEX support several concrete connections. Some unsampled subsystem links are therefore left out rather than inferred.

Main entry points: [`packages/inspector/src/InspectorApp.tsx`](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/InspectorApp.tsx) (Inspector App), [`packages/engine/src/Application/AudioEngine.ts`](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Application/AudioEngine.ts) (Audio Engine), [`packages/cli/src/pipeline.ts`](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/pipeline.ts) (Asset Pipeline), [`packages/engine/src/Infrastructure/busSystem/AudioBusSystem.ts`](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/busSystem/AudioBusSystem.ts) (Bus Routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Audio Runtime"]
  node_engine["Audio Engine<br/>[AudioEngine.ts]"]
  node_sound["Sound Playback<br/>[SoundController.ts]"]
  node_culling["Voice Culling"]
  node_shared["Shared Types<br/>[Branded.ts]"]
end

subgraph group_mix["Mix And Orchestration"]
  node_buses["Bus Routing<br/>[AudioBusSystem.ts]"]
  node_master["Master Output<br/>[MasterOutput.ts]"]
  node_mixer["Mixer Snapshots"]
  node_automation["RTPC Automation"]
  node_ticker["Engine Ticker<br/>[EngineTicker.ts]"]
  node_orchestration["Music Orchestration"]
end

subgraph group_tooling["Asset Tooling"]
  node_cli["Asset Pipeline<br/>[pipeline.ts]"]
  node_ladder["Codec Ladder<br/>[ladder.ts]"]
  node_pcm["PCM Metadata<br/>[pcm.ts]"]
  node_stream["Chunked Streams<br/>[stream.ts]"]
end

subgraph group_observe["Debug And Inspect"]
  node_inspector["Inspector App<br/>[InspectorApp.tsx]"]
  node_timeline["Snapshot Timeline"]
  node_telemetry["Telemetry Bus<br/>[useTelemetryBus.ts]"]
  node_graphui["Audio Graph UI<br/>[NodeInspector.tsx]"]
  node_performance["Performance View"]
  node_logger["Raw Logger<br/>[RawLogger.tsx]"]
  node_simulator["What-If Simulator"]
  node_scrubber["Timeline Scrubber"]
  node_debugger["Audio Visualizers<br/>[visualizers.ts]"]
end

subgraph group_control["External Control"]
  node_mcp["MCP Server<br/>[index.ts]"]
  node_runtime_tools["Runtime Tools<br/>[runtime_tools.ts]"]
  node_ws["Telemetry WebSocket"]
end

node_game(("Game Application"))

node_game -->|"requests audio"| node_engine
node_engine -.->|"plays sounds"| node_sound
node_sound -->|"routes voices"| node_buses
node_buses -->|"feeds output"| node_master
node_engine -.->|"coordinates music"| node_orchestration
node_engine -->|"manages voices"| node_culling
node_engine -.->|"controls mix state"| node_mixer
node_mixer -->|"applies transitions"| node_buses
node_ticker -->|"ticks automation"| node_automation
node_cli -->|"extracts metadata"| node_pcm
node_cli -->|"generates codecs"| node_ladder
node_cli -->|"generates chunks"| node_stream
node_inspector -->|"uses timeline"| node_timeline
node_inspector -->|"uses telemetry"| node_telemetry
node_inspector -->|"renders inspection"| node_graphui
node_inspector -->|"renders metrics"| node_performance
node_inspector -->|"renders logs"| node_logger
node_inspector -.->|"renders simulator"| node_simulator
node_inspector -->|"renders scrubber"| node_scrubber
node_debugger -.->|"observes audio"| node_engine
node_mcp -->|"dispatches tools"| node_runtime_tools
node_mcp -->|"configures telemetry"| node_ws
node_runtime_tools -->|"uses telemetry"| node_ws
node_engine -->|"uses shared types"| node_shared

click node_engine "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Application/AudioEngine.ts"
click node_sound "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/loader/SoundController.ts"
click node_buses "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/busSystem/AudioBusSystem.ts"
click node_master "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/nodes/MasterOutput.ts"
click node_mixer "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Domain/Mixer/MixerTransitionEngine.ts"
click node_automation "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/automation/AutomationEngine.ts"
click node_ticker "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/scheduling/EngineTicker.ts"
click node_orchestration "https://github.com/rapt0p7/scenegrid-console/tree/main/packages/engine/src/Domain/Orchestration"
click node_culling "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Domain/Culling/VoiceCullingArbiter.ts"
click node_cli "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/pipeline.ts"
click node_ladder "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/ladder.ts"
click node_pcm "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/pcm.ts"
click node_stream "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/stream.ts"
click node_inspector "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/InspectorApp.tsx"
click node_timeline "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/hooks/useSnapshotTimeline.ts"
click node_telemetry "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/hooks/useTelemetryBus.ts"
click node_graphui "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/AudioGraph/NodeInspector.tsx"
click node_performance "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/PerformanceGraph.tsx"
click node_logger "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/RawLogger.tsx"
click node_simulator "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/SimulatorDrawer.tsx"
click node_scrubber "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/TimelineScrubber.tsx"
click node_debugger "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/debugger/src/visualizers.ts"
click node_mcp "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/mcp-server/index.ts"
click node_runtime_tools "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/mcp-server/src/runtime_tools.ts"
click node_ws "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/mcp-server/src/WebSocketTelemetryServer.ts"
click node_shared "https://github.com/rapt0p7/scenegrid-console/blob/main/packages/shared/src/Types/Branded.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_engine,node_sound,node_culling,node_shared toneBlue
class node_buses,node_master,node_mixer,node_automation,node_ticker,node_orchestration toneAmber
class node_cli,node_ladder,node_pcm,node_stream toneMint
class node_inspector,node_timeline,node_telemetry,node_graphui,node_performance,node_logger,node_simulator,node_scrubber,node_debugger toneRose
class node_mcp,node_runtime_tools,node_ws,node_game toneIndigo
```

## Components

### Audio Runtime

- [Audio Engine](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Application/AudioEngine.ts): `packages/engine/src/Application/AudioEngine.ts`
- [Sound Playback](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/loader/SoundController.ts): `packages/engine/src/Infrastructure/loader/SoundController.ts`
- [Voice Culling](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Domain/Culling/VoiceCullingArbiter.ts): `packages/engine/src/Domain/Culling/VoiceCullingArbiter.ts`
- [Shared Types](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/shared/src/Types/Branded.ts): `packages/shared/src/Types/Branded.ts`

### Mix And Orchestration

- [Bus Routing](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/busSystem/AudioBusSystem.ts): `packages/engine/src/Infrastructure/busSystem/AudioBusSystem.ts`
- [Master Output](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/nodes/MasterOutput.ts): `packages/engine/src/Infrastructure/nodes/MasterOutput.ts`
- [Mixer Snapshots](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Domain/Mixer/MixerTransitionEngine.ts): `packages/engine/src/Domain/Mixer/MixerTransitionEngine.ts`
- [RTPC Automation](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/automation/AutomationEngine.ts): `packages/engine/src/Infrastructure/automation/AutomationEngine.ts`
- [Engine Ticker](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/engine/src/Infrastructure/scheduling/EngineTicker.ts): `packages/engine/src/Infrastructure/scheduling/EngineTicker.ts`
- [Music Orchestration](https://github.com/rapt0p7/scenegrid-console/tree/main/packages/engine/src/Domain/Orchestration): `packages/engine/src/Domain/Orchestration`

### Asset Tooling

- [Asset Pipeline](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/pipeline.ts): `packages/cli/src/pipeline.ts`
- [Codec Ladder](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/ladder.ts): `packages/cli/src/ladder.ts`
- [PCM Metadata](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/pcm.ts): `packages/cli/src/pcm.ts`
- [Chunked Streams](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/cli/src/stream.ts): `packages/cli/src/stream.ts`

### Debug And Inspect

- [Inspector App](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/InspectorApp.tsx): `packages/inspector/src/InspectorApp.tsx`
- [Snapshot Timeline](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/hooks/useSnapshotTimeline.ts): `packages/inspector/src/hooks/useSnapshotTimeline.ts`
- [Telemetry Bus](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/hooks/useTelemetryBus.ts): `packages/inspector/src/hooks/useTelemetryBus.ts`
- [Audio Graph UI](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/AudioGraph/NodeInspector.tsx): `packages/inspector/src/ui/AudioGraph/NodeInspector.tsx`
- [Performance View](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/PerformanceGraph.tsx): `packages/inspector/src/ui/PerformanceGraph.tsx`
- [Raw Logger](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/RawLogger.tsx): `packages/inspector/src/ui/RawLogger.tsx`
- [What-If Simulator](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/SimulatorDrawer.tsx): `packages/inspector/src/ui/SimulatorDrawer.tsx`
- [Timeline Scrubber](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/inspector/src/ui/TimelineScrubber.tsx): `packages/inspector/src/ui/TimelineScrubber.tsx`
- [Audio Visualizers](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/debugger/src/visualizers.ts): `packages/debugger/src/visualizers.ts`

### External Control

- [MCP Server](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/mcp-server/index.ts): `packages/mcp-server/index.ts`
- [Runtime Tools](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/mcp-server/src/runtime_tools.ts): `packages/mcp-server/src/runtime_tools.ts`
- [Telemetry WebSocket](https://github.com/rapt0p7/scenegrid-console/blob/main/packages/mcp-server/src/WebSocketTelemetryServer.ts): `packages/mcp-server/src/WebSocketTelemetryServer.ts`

### Other components

- **Game Application**

## Connections

- Game Application → Audio Engine: requests audio (evidence: `README.md`)
- Audio Engine → Sound Playback: plays sounds
- Sound Playback → Bus Routing: routes voices (evidence: `README.md`)
- Bus Routing → Master Output: feeds output (evidence: `README.md`)
- Audio Engine → Music Orchestration: coordinates music
- Audio Engine → Voice Culling: manages voices (evidence: `README.md`)
- Audio Engine → Mixer Snapshots: controls mix state
- Mixer Snapshots → Bus Routing: applies transitions (evidence: `packages/engine/src/Domain/Mixer/MixerTransitionEngine.ts`)
- Engine Ticker → RTPC Automation: ticks automation (evidence: `packages/engine/src/Infrastructure/automation/AutomationEngine.ts`)
- Asset Pipeline → PCM Metadata: extracts metadata (evidence: `packages/cli/src/pipeline.ts`)
- Asset Pipeline → Codec Ladder: generates codecs (evidence: `packages/cli/src/pipeline.ts`)
- Asset Pipeline → Chunked Streams: generates chunks (evidence: `packages/cli/src/pipeline.ts`)
- Inspector App → Snapshot Timeline: uses timeline (evidence: `packages/inspector/src/InspectorApp.tsx`)
- Inspector App → Telemetry Bus: uses telemetry (evidence: `packages/inspector/src/InspectorApp.tsx`)
- Inspector App → Audio Graph UI: renders inspection (evidence: `packages/inspector/src/InspectorApp.tsx`)
- Inspector App → Performance View: renders metrics (evidence: `packages/inspector/src/InspectorApp.tsx`)
- Inspector App → Raw Logger: renders logs (evidence: `packages/inspector/src/InspectorApp.tsx`)
- Inspector App → What-If Simulator: renders simulator
- Inspector App → Timeline Scrubber: renders scrubber (evidence: `packages/inspector/src/InspectorApp.tsx`)
- Audio Visualizers → Audio Engine: observes audio
- MCP Server → Runtime Tools: dispatches tools (evidence: `packages/mcp-server/index.ts`)
- MCP Server → Telemetry WebSocket: configures telemetry (evidence: `packages/mcp-server/index.ts`)
- Runtime Tools → Telemetry WebSocket: uses telemetry (evidence: `packages/mcp-server/src/runtime_tools.ts`)
- Audio Engine → Shared Types: uses shared types (evidence: `packages/engine/src/Application/AudioEngine.ts`)
