# smileybones/oscillo-synth architecture

> Architecture diagram of the GitHub repository smileybones/oscillo-synth, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/smileybones/oscillo-synth
- Repository: https://github.com/smileybones/oscillo-synth
- Video tour (about a minute): https://gitdiagram.com/smileybones/oscillo-synth/video

## Overview

oscillo-synth is a client-side oscilloscope-art instrument paired with a synthesizer, available in browser and Electron desktop shells. The main workflow configures trace sources and effects in the shared UI, renders paths into X/Y samples, and displays the trace; the synth has its own DSP and audio-worklet path, with MIDI input and live waveform preview. The README documents several capabilities whose detailed wiring was not sampled; those are represented as subsystem nodes without speculative internal call edges.

Main entry points: [`packages/ui-web/src/app.ts`](https://github.com/smileybones/oscillo-synth/blob/main/packages/ui-web/src/app.ts) (Instrument UI), [`packages/platform-web/src/audio/audio-graph.ts`](https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/audio/audio-graph.ts) (Audio graph), [`packages/platform-web/src/synth/synth-worklet.ts`](https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/synth/synth-worklet.ts) (Synth worklet), [`packages/engine/src/geometry`](https://github.com/smileybones/oscillo-synth/tree/main/packages/engine/src/geometry) (Path geometry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Shared instrument UI"]
  node_ui_app["Instrument UI<br/>[app.ts]"]
  node_ui_knob["Knob controls<br/>[knob.ts]"]
  node_ui_pad["XY pad<br/>[xy-pad.ts]"]
end

subgraph group_trace["Trace engine"]
  node_sources["Trace sources"]
  node_svg_parser["SVG path parser<br/>[svg-path-parser.ts]"]
  node_mesh_source["3D mesh source<br/>[mesh-source.ts]"]
  node_pixel_trace["Video tracing<br/>[trace-pixels.ts]"]
  node_geometry["Path geometry"]
  node_effects["Trace effects"]
  node_render_samples["Sample renderer<br/>[path-to-samples.ts]"]
  node_travel["Travel optimizer"]
end

subgraph group_synth["Synth engine"]
  node_synth_dsp["Synth DSP<br/>[voice.ts]"]
end

subgraph group_platform["Web platform"]
  node_synth_worklet["Synth worklet<br/>[synth-worklet.ts]"]
  node_audio_graph["Audio graph<br/>[audio-graph.ts]"]
  node_render_worklet["Trace worklet<br/>[render-worklet.ts]"]
  node_midi["MIDI manager<br/>[midi-manager.ts]"]
  node_xy_preview["X/Y preview<br/>[xy-preview.ts]"]
  node_wave_preview["Waveform preview"]
end

subgraph group_shells["App shells"]
  node_web_entry["Browser entry<br/>[main.ts]"]
  node_desktop_entry["Desktop renderer<br/>[main.ts]"]
  node_electron_main["Electron shell<br/>[index.ts]"]
end

node_user(("Musician"))
node_midi_device["MIDI keyboard"]
node_scope["Oscilloscope"]

node_user -->|"configures"| node_ui_app
node_web_entry -->|"starts"| node_ui_app
node_desktop_entry -->|"starts"| node_ui_app
node_electron_main -.->|"hosts"| node_desktop_entry
node_ui_app -->|"enhances controls"| node_ui_knob
node_ui_app -->|"configures pad"| node_ui_pad
node_ui_app -->|"creates sources"| node_sources
node_ui_app -->|"renders paths"| node_render_samples
node_ui_app -->|"applies effects"| node_effects
node_ui_app -->|"manages input"| node_midi
node_ui_app -->|"previews trace"| node_xy_preview
node_svg_parser -->|"builds commands"| node_geometry
node_mesh_source -->|"builds paths"| node_geometry
node_pixel_trace -->|"produces paths"| node_geometry
node_render_samples -->|"optimizes travel"| node_travel
node_midi_device -->|"sends notes"| node_midi
node_ui_app -.->|"controls synth"| node_synth_worklet
node_synth_worklet -->|"runs DSP"| node_synth_dsp
node_ui_app -.->|"controls audio"| node_audio_graph
node_audio_graph -.->|"hosts"| node_synth_worklet
node_audio_graph -.->|"hosts"| node_render_worklet
node_ui_app -->|"previews waveform"| node_wave_preview
node_xy_preview -->|"visualizes trace"| node_scope

click node_ui_app "https://github.com/smileybones/oscillo-synth/blob/main/packages/ui-web/src/app.ts"
click node_ui_knob "https://github.com/smileybones/oscillo-synth/blob/main/packages/ui-web/src/knob.ts"
click node_ui_pad "https://github.com/smileybones/oscillo-synth/blob/main/packages/ui-web/src/xy-pad.ts"
click node_web_entry "https://github.com/smileybones/oscillo-synth/blob/main/apps/web/src/main.ts"
click node_desktop_entry "https://github.com/smileybones/oscillo-synth/blob/main/apps/desktop/src/renderer/src/main.ts"
click node_electron_main "https://github.com/smileybones/oscillo-synth/blob/main/apps/desktop/src/main/index.ts"
click node_sources "https://github.com/smileybones/oscillo-synth/tree/main/packages/engine/src/sources"
click node_svg_parser "https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/sources/svg-path-parser.ts"
click node_mesh_source "https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/sources/mesh-source.ts"
click node_pixel_trace "https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/render/trace-pixels.ts"
click node_geometry "https://github.com/smileybones/oscillo-synth/tree/main/packages/engine/src/geometry"
click node_effects "https://github.com/smileybones/oscillo-synth/tree/main/packages/engine/src/effects"
click node_render_samples "https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/render/path-to-samples.ts"
click node_travel "https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/render/travel-optimizer.ts"
click node_synth_dsp "https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/synth/voice.ts"
click node_synth_worklet "https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/synth/synth-worklet.ts"
click node_audio_graph "https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/audio/audio-graph.ts"
click node_render_worklet "https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/audio/render-worklet.ts"
click node_midi "https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/midi/midi-manager.ts"
click node_xy_preview "https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/canvas/xy-preview.ts"
click node_wave_preview "https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/canvas/waveform-preview.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_ui_app,node_ui_knob,node_ui_pad toneBlue
class node_sources,node_svg_parser,node_mesh_source,node_pixel_trace,node_geometry,node_effects,node_render_samples,node_travel toneAmber
class node_synth_dsp toneMint
class node_synth_worklet,node_audio_graph,node_render_worklet,node_midi,node_xy_preview,node_wave_preview toneRose
class node_web_entry,node_desktop_entry,node_electron_main,node_user,node_midi_device,node_scope toneIndigo
```

## Components

### Shared instrument UI

- [Instrument UI](https://github.com/smileybones/oscillo-synth/blob/main/packages/ui-web/src/app.ts): `packages/ui-web/src/app.ts`
- [Knob controls](https://github.com/smileybones/oscillo-synth/blob/main/packages/ui-web/src/knob.ts): `packages/ui-web/src/knob.ts`
- [XY pad](https://github.com/smileybones/oscillo-synth/blob/main/packages/ui-web/src/xy-pad.ts): `packages/ui-web/src/xy-pad.ts`

### Trace engine

- [Trace sources](https://github.com/smileybones/oscillo-synth/tree/main/packages/engine/src/sources): `packages/engine/src/sources`
- [SVG path parser](https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/sources/svg-path-parser.ts): `packages/engine/src/sources/svg-path-parser.ts`
- [3D mesh source](https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/sources/mesh-source.ts): `packages/engine/src/sources/mesh-source.ts`
- [Video tracing](https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/render/trace-pixels.ts): `packages/engine/src/render/trace-pixels.ts`
- [Path geometry](https://github.com/smileybones/oscillo-synth/tree/main/packages/engine/src/geometry): `packages/engine/src/geometry`
- [Trace effects](https://github.com/smileybones/oscillo-synth/tree/main/packages/engine/src/effects): `packages/engine/src/effects`
- [Sample renderer](https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/render/path-to-samples.ts): `packages/engine/src/render/path-to-samples.ts`
- [Travel optimizer](https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/render/travel-optimizer.ts): `packages/engine/src/render/travel-optimizer.ts`

### Synth engine

- [Synth DSP](https://github.com/smileybones/oscillo-synth/blob/main/packages/engine/src/synth/voice.ts): `packages/engine/src/synth/voice.ts`

### Web platform

- [Synth worklet](https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/synth/synth-worklet.ts): `packages/platform-web/src/synth/synth-worklet.ts`
- [Audio graph](https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/audio/audio-graph.ts): `packages/platform-web/src/audio/audio-graph.ts`
- [Trace worklet](https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/audio/render-worklet.ts): `packages/platform-web/src/audio/render-worklet.ts`
- [MIDI manager](https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/midi/midi-manager.ts): `packages/platform-web/src/midi/midi-manager.ts`
- [X/Y preview](https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/canvas/xy-preview.ts): `packages/platform-web/src/canvas/xy-preview.ts`
- [Waveform preview](https://github.com/smileybones/oscillo-synth/blob/main/packages/platform-web/src/canvas/waveform-preview.ts): `packages/platform-web/src/canvas/waveform-preview.ts`

### App shells

- [Browser entry](https://github.com/smileybones/oscillo-synth/blob/main/apps/web/src/main.ts): `apps/web/src/main.ts`
- [Desktop renderer](https://github.com/smileybones/oscillo-synth/blob/main/apps/desktop/src/renderer/src/main.ts): `apps/desktop/src/renderer/src/main.ts`
- [Electron shell](https://github.com/smileybones/oscillo-synth/blob/main/apps/desktop/src/main/index.ts): `apps/desktop/src/main/index.ts`

### Other components

- **Musician**
- **MIDI keyboard**
- **Oscilloscope**

## Connections

- Musician → Instrument UI: configures
- Browser entry → Instrument UI: starts (evidence: `apps/web/src/main.ts`)
- Desktop renderer → Instrument UI: starts (evidence: `apps/desktop/src/renderer/src/main.ts`)
- Electron shell → Desktop renderer: hosts
- Instrument UI → Knob controls: enhances controls (evidence: `packages/ui-web/src/app.ts`)
- Instrument UI → XY pad: configures pad (evidence: `packages/ui-web/src/app.ts`)
- Instrument UI → Trace sources: creates sources (evidence: `packages/ui-web/src/app.ts`)
- Instrument UI → Sample renderer: renders paths (evidence: `packages/ui-web/src/app.ts`)
- Instrument UI → Trace effects: applies effects (evidence: `packages/ui-web/src/app.ts`)
- Instrument UI → MIDI manager: manages input (evidence: `packages/ui-web/src/app.ts`)
- Instrument UI → X/Y preview: previews trace (evidence: `packages/ui-web/src/app.ts`)
- SVG path parser → Path geometry: builds commands (evidence: `packages/engine/src/sources/svg-path-parser.ts`)
- 3D mesh source → Path geometry: builds paths (evidence: `packages/engine/src/sources/mesh-source.ts`)
- Video tracing → Path geometry: produces paths (evidence: `packages/engine/src/render/trace-pixels.ts`)
- Sample renderer → Travel optimizer: optimizes travel (evidence: `packages/engine/src/render/path-to-samples.ts`)
- MIDI keyboard → MIDI manager: sends notes
- Instrument UI → Synth worklet: controls synth
- Synth worklet → Synth DSP: runs DSP (evidence: `packages/platform-web/src/synth/synth-worklet.ts`)
- Instrument UI → Audio graph: controls audio
- Audio graph → Synth worklet: hosts
- Audio graph → Trace worklet: hosts
- Instrument UI → Waveform preview: previews waveform (evidence: `packages/ui-web/src/app.ts`)
- X/Y preview → Oscilloscope: visualizes trace
