# julian-b-smith/horde architecture

> Architecture diagram of the GitHub repository julian-b-smith/horde, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/julian-b-smith/horde
- Repository: https://github.com/julian-b-smith/horde

## Overview

horde is a CLAP-native coupled-oscillator synthesizer, with VST3/AU support through clap-wrapper. The main user workflow is playing notes in a host, shaping two seeded oscillator swarms, applying modulation and morphing, then processing and balancing the sound through the FX rack and output controls. The README also describes GUI performance and patch-storage features. A separate C++ composed-engine port and browser reference cores support the documented parity goal. Unsampled plugin and GUI internals limit the detail of their connections; those links rely on README statements.

Main entry points: [`src/hypersaw_clap.cpp`](https://github.com/julian-b-smith/horde/blob/main/src/hypersaw_clap.cpp) (CLAP instrument), [`h2/engine/engine.h`](https://github.com/julian-b-smith/horde/blob/main/h2/engine/engine.h) (Composed engine), [`src/swarm_core.h`](https://github.com/julian-b-smith/horde/blob/main/src/swarm_core.h) (Oscillator swarms), [`src/gui/hypersaw_gui_common.h`](https://github.com/julian-b-smith/horde/blob/main/src/gui/hypersaw_gui_common.h) (Live GUI pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin and interface"]
  node_plugin_entry["CLAP instrument<br/>[hypersaw_clap.cpp]"]
  node_gui["Live GUI pages"]
  node_preset_store[("Patch storage<br/>[preset_store.h]")]
end

subgraph group_sound["Sound generation"]
  node_swarm["Oscillator swarms<br/>[swarm_core.h]"]
  node_force["Coupling forces<br/>[force_core.h]"]
  node_glide["Pitch glide<br/>[glide_core.h]"]
  node_fx["FX rack<br/>[fx_rack.h]"]
  node_routing["Signal routing<br/>[routing_core.h]"]
end

subgraph group_control["Patch and control"]
  node_mod["Modulation matrix<br/>[mod_core.h]"]
  node_morph["Morph controls<br/>[morph_core.h]"]
end

subgraph group_parity["Parity implementations"]
  node_h2_engine["Composed engine<br/>[engine.h]"]
  node_h2_swarm["Engine swarm field<br/>[swarm.h]"]
  node_h2_blade["Blade DSP<br/>[blade.h]"]
  node_h2_js["JS compatibility<br/>[js.h]"]
  node_h2_swarm_core["Swarm core<br/>[swarm_core.h]"]
  node_h2_force["Swarm force core<br/>[force_core.h]"]
  node_h2_glide["Swarm glide core<br/>[glide_core.h]"]
  node_razor["SCALPEL reference<br/>[razor-core.js]"]
  node_maw["MAW reference core<br/>[core.js]"]
  node_maw_fidelity["MAW fidelity reference<br/>[fidelity.js]"]
  node_stream["SwarmSynth reference<br/>[swarm_core.h]"]
end

node_host(("Host and player"))

node_host -->|"plays notes"| node_plugin_entry
node_gui -->|"controls instrument"| node_plugin_entry
node_gui -->|"stores patches"| node_preset_store
node_plugin_entry -->|"renders sound"| node_swarm
node_swarm -->|"applies coupling"| node_force
node_swarm -->|"uses glide"| node_glide
node_plugin_entry -->|"routes modulation"| node_mod
node_plugin_entry -->|"applies morph"| node_morph
node_plugin_entry -->|"processes audio"| node_fx
node_plugin_entry -.->|"routes signals"| node_routing
node_h2_engine -->|"ticks swarm"| node_h2_swarm
node_h2_engine -->|"evaluates blades"| node_h2_blade
node_h2_engine -->|"uses compatibility"| node_h2_js
node_h2_swarm_core -->|"uses force core"| node_h2_force
node_h2_swarm_core -->|"uses glide core"| node_h2_glide
node_razor -->|"parity target"| node_h2_engine
node_swarm -->|"parity target"| node_h2_engine
node_maw_fidelity -->|"compares core"| node_maw

click node_plugin_entry "https://github.com/julian-b-smith/horde/blob/main/src/hypersaw_clap.cpp"
click node_gui "https://github.com/julian-b-smith/horde/blob/main/src/gui/hypersaw_gui_common.h"
click node_preset_store "https://github.com/julian-b-smith/horde/blob/main/src/gui/preset_store.h"
click node_swarm "https://github.com/julian-b-smith/horde/blob/main/src/swarm_core.h"
click node_force "https://github.com/julian-b-smith/horde/blob/main/src/force_core.h"
click node_glide "https://github.com/julian-b-smith/horde/blob/main/src/glide_core.h"
click node_fx "https://github.com/julian-b-smith/horde/blob/main/src/fx_rack.h"
click node_routing "https://github.com/julian-b-smith/horde/blob/main/src/routing_core.h"
click node_mod "https://github.com/julian-b-smith/horde/blob/main/src/mod_core.h"
click node_morph "https://github.com/julian-b-smith/horde/blob/main/src/morph_core.h"
click node_h2_engine "https://github.com/julian-b-smith/horde/blob/main/h2/engine/engine.h"
click node_h2_swarm "https://github.com/julian-b-smith/horde/blob/main/h2/engine/swarm.h"
click node_h2_blade "https://github.com/julian-b-smith/horde/blob/main/h2/engine/blade.h"
click node_h2_js "https://github.com/julian-b-smith/horde/blob/main/h2/engine/js.h"
click node_h2_swarm_core "https://github.com/julian-b-smith/horde/blob/main/h2/cores/swarm/swarm_core.h"
click node_h2_force "https://github.com/julian-b-smith/horde/blob/main/h2/cores/swarm/force_core.h"
click node_h2_glide "https://github.com/julian-b-smith/horde/blob/main/h2/cores/swarm/glide_core.h"
click node_razor "https://github.com/julian-b-smith/horde/blob/main/reference/scalpel/prototype/razor-core.js"
click node_maw "https://github.com/julian-b-smith/horde/blob/main/reference/maw/core.js"
click node_maw_fidelity "https://github.com/julian-b-smith/horde/blob/main/reference/maw/fidelity.js"
click node_stream "https://github.com/julian-b-smith/horde/blob/main/h2/cores/swarm/swarm_core.h"

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_plugin_entry,node_gui,node_preset_store toneBlue
class node_swarm,node_force,node_glide,node_fx,node_routing toneAmber
class node_mod,node_morph toneMint
class node_h2_engine,node_h2_swarm,node_h2_blade,node_h2_js,node_h2_swarm_core,node_h2_force,node_h2_glide,node_razor,node_maw,node_maw_fidelity,node_stream toneRose
class node_host toneIndigo
```

## Components

### Plugin and interface

- [CLAP instrument](https://github.com/julian-b-smith/horde/blob/main/src/hypersaw_clap.cpp): `src/hypersaw_clap.cpp`
- [Live GUI pages](https://github.com/julian-b-smith/horde/blob/main/src/gui/hypersaw_gui_common.h): `src/gui/hypersaw_gui_common.h`
- [Patch storage](https://github.com/julian-b-smith/horde/blob/main/src/gui/preset_store.h): `src/gui/preset_store.h`

### Sound generation

- [Oscillator swarms](https://github.com/julian-b-smith/horde/blob/main/src/swarm_core.h): `src/swarm_core.h`
- [Coupling forces](https://github.com/julian-b-smith/horde/blob/main/src/force_core.h): `src/force_core.h`
- [Pitch glide](https://github.com/julian-b-smith/horde/blob/main/src/glide_core.h): `src/glide_core.h`
- [FX rack](https://github.com/julian-b-smith/horde/blob/main/src/fx_rack.h): `src/fx_rack.h`
- [Signal routing](https://github.com/julian-b-smith/horde/blob/main/src/routing_core.h): `src/routing_core.h`

### Patch and control

- [Modulation matrix](https://github.com/julian-b-smith/horde/blob/main/src/mod_core.h): `src/mod_core.h`
- [Morph controls](https://github.com/julian-b-smith/horde/blob/main/src/morph_core.h): `src/morph_core.h`

### Parity implementations

- [Composed engine](https://github.com/julian-b-smith/horde/blob/main/h2/engine/engine.h): `h2/engine/engine.h`
- [Engine swarm field](https://github.com/julian-b-smith/horde/blob/main/h2/engine/swarm.h): `h2/engine/swarm.h`
- [Blade DSP](https://github.com/julian-b-smith/horde/blob/main/h2/engine/blade.h): `h2/engine/blade.h`
- [JS compatibility](https://github.com/julian-b-smith/horde/blob/main/h2/engine/js.h): `h2/engine/js.h`
- [Swarm core](https://github.com/julian-b-smith/horde/blob/main/h2/cores/swarm/swarm_core.h): `h2/cores/swarm/swarm_core.h`
- [Swarm force core](https://github.com/julian-b-smith/horde/blob/main/h2/cores/swarm/force_core.h): `h2/cores/swarm/force_core.h`
- [Swarm glide core](https://github.com/julian-b-smith/horde/blob/main/h2/cores/swarm/glide_core.h): `h2/cores/swarm/glide_core.h`
- [SCALPEL reference](https://github.com/julian-b-smith/horde/blob/main/reference/scalpel/prototype/razor-core.js): `reference/scalpel/prototype/razor-core.js`
- [MAW reference core](https://github.com/julian-b-smith/horde/blob/main/reference/maw/core.js): `reference/maw/core.js`
- [MAW fidelity reference](https://github.com/julian-b-smith/horde/blob/main/reference/maw/fidelity.js): `reference/maw/fidelity.js`
- [SwarmSynth reference](https://github.com/julian-b-smith/horde/blob/main/h2/cores/swarm/swarm_core.h): `h2/cores/swarm/swarm_core.h`

### Other components

- **Host and player**

## Connections

- Host and player → CLAP instrument: plays notes (evidence: `README.md`)
- Live GUI pages → CLAP instrument: controls instrument (evidence: `README.md`)
- Live GUI pages → Patch storage: stores patches (evidence: `README.md`)
- CLAP instrument → Oscillator swarms: renders sound (evidence: `README.md`)
- Oscillator swarms → Coupling forces: applies coupling (evidence: `src/swarm_core.h`)
- Oscillator swarms → Pitch glide: uses glide (evidence: `src/swarm_core.h`)
- CLAP instrument → Modulation matrix: routes modulation (evidence: `README.md`)
- CLAP instrument → Morph controls: applies morph (evidence: `README.md`)
- CLAP instrument → FX rack: processes audio (evidence: `README.md`)
- CLAP instrument → Signal routing: routes signals
- Composed engine → Engine swarm field: ticks swarm (evidence: `h2/engine/engine.h`)
- Composed engine → Blade DSP: evaluates blades (evidence: `h2/engine/engine.h`)
- Composed engine → JS compatibility: uses compatibility (evidence: `h2/engine/engine.h`)
- Swarm core → Swarm force core: uses force core (evidence: `h2/cores/swarm/swarm_core.h`)
- Swarm core → Swarm glide core: uses glide core (evidence: `h2/cores/swarm/swarm_core.h`)
- SCALPEL reference → Composed engine: parity target (evidence: `README.md`)
- Oscillator swarms → Composed engine: parity target (evidence: `README.md`)
- MAW fidelity reference → MAW reference core: compares core (evidence: `reference/maw/fidelity.js`)
