# theaudioprogrammer/jucesampleraudioplugin architecture

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

- Interactive diagram: https://gitdiagram.com/theaudioprogrammer/jucesampleraudioplugin
- Repository: https://github.com/theaudioprogrammer/jucesampleraudioplugin

## Overview

This JUCE instrument accepts MIDI, maps notes to embedded chromatic WAV samples, renders them through an eight-voice sampler with adjustable decay and always-active reverb, then produces stereo audio. The editor exposes decay and reverb parameters through attached knobs and uses embedded artwork and fonts. Processor state is serialized through the host-facing state callbacks. Workflow and UI links are grounded in sampled source; other documented capabilities, such as plugin formats and full-range note mapping, are represented where source supports them.

Main entry points: [`sources/PluginProcessor.cpp`](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp) (Audio processor), [`sources/PluginEditor.cpp`](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginEditor.cpp) (Plugin editor), [`sources/Knob.cpp`](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/Knob.cpp) (Parameter knobs), [`sources/SamplerLookAndFeel.cpp`](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/SamplerLookAndFeel.cpp) (Knob rendering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_audio["Audio engine"]
  node_processor["Audio processor"]
  node_sampler["Sampler engine"]
  node_reverb["Stereo reverb"]
  node_audioout["Stereo audio"]
end

subgraph group_controls["Parameters and state"]
  node_parameters["Decay and reverb parameters"]
  node_state["Parameter state"]
end

subgraph group_interface["Plugin interface"]
  node_editor["Plugin editor<br/>[PluginEditor.cpp]"]
  node_knobs["Parameter knobs<br/>[Knob.cpp]"]
  node_lookfeel["Knob rendering"]
end

subgraph group_resources["Embedded resources"]
  node_sampledata["Chromatic WAVs"]
  node_images["Background and filmstrip"]
  node_fonts["Inter fonts"]
end

node_host(("Plugin host"))
node_midi(("MIDI input"))

node_host -->|"invokes processing"| node_processor
node_midi -->|"sends MIDI"| node_processor
node_processor -->|"renders MIDI"| node_sampler
node_sampledata -->|"supplies embedded WAVs"| node_processor
node_processor -->|"loads mapped sounds"| node_sampler
node_sampler -->|"renders samples"| node_reverb
node_reverb -->|"outputs stereo"| node_audioout
node_processor -->|"reads and updates"| node_parameters
node_processor -->|"serializes and restores"| node_state
node_host -->|"saves and restores"| node_state
node_processor -->|"creates editor"| node_editor
node_editor -->|"displays controls"| node_knobs
node_knobs -->|"attaches sliders"| node_parameters
node_knobs -->|"uses renderer"| node_lookfeel
node_editor -->|"draws background"| node_images
node_lookfeel -->|"draws filmstrip"| node_images
node_lookfeel -->|"uses typefaces"| node_fonts

click node_processor "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp"
click node_sampler "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp"
click node_sampledata "https://github.com/theaudioprogrammer/jucesampleraudioplugin/tree/main/assets/sounds"
click node_reverb "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp"
click node_audioout "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp"
click node_parameters "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp"
click node_state "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp"
click node_editor "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginEditor.cpp"
click node_knobs "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/Knob.cpp"
click node_lookfeel "https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/SamplerLookAndFeel.cpp"
click node_images "https://github.com/theaudioprogrammer/jucesampleraudioplugin/tree/main/assets/images"
click node_fonts "https://github.com/theaudioprogrammer/jucesampleraudioplugin/tree/main/assets/fonts"

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_processor,node_sampler,node_reverb,node_audioout toneBlue
class node_parameters,node_state toneAmber
class node_editor,node_knobs,node_lookfeel toneMint
class node_sampledata,node_images,node_fonts toneRose
class node_host,node_midi toneIndigo
```

## Components

### Audio engine

- [Audio processor](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp): `sources/PluginProcessor.cpp`
- [Sampler engine](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp): `sources/PluginProcessor.cpp`
- [Stereo reverb](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp): `sources/PluginProcessor.cpp`
- [Stereo audio](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp): `sources/PluginProcessor.cpp`

### Parameters and state

- [Decay and reverb parameters](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp): `sources/PluginProcessor.cpp`
- [Parameter state](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginProcessor.cpp): `sources/PluginProcessor.cpp`

### Plugin interface

- [Plugin editor](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/PluginEditor.cpp): `sources/PluginEditor.cpp`
- [Parameter knobs](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/Knob.cpp): `sources/Knob.cpp`
- [Knob rendering](https://github.com/theaudioprogrammer/jucesampleraudioplugin/blob/main/sources/SamplerLookAndFeel.cpp): `sources/SamplerLookAndFeel.cpp`

### Embedded resources

- [Chromatic WAVs](https://github.com/theaudioprogrammer/jucesampleraudioplugin/tree/main/assets/sounds): `assets/sounds`
- [Background and filmstrip](https://github.com/theaudioprogrammer/jucesampleraudioplugin/tree/main/assets/images): `assets/images`
- [Inter fonts](https://github.com/theaudioprogrammer/jucesampleraudioplugin/tree/main/assets/fonts): `assets/fonts`

### Other components

- **Plugin host**
- **MIDI input**

## Connections

- Plugin host → Audio processor: invokes processing
- MIDI input → Audio processor: sends MIDI
- Audio processor → Sampler engine: renders MIDI
- Chromatic WAVs → Audio processor: supplies embedded WAVs
- Audio processor → Sampler engine: loads mapped sounds
- Sampler engine → Stereo reverb: renders samples
- Stereo reverb → Stereo audio: outputs stereo
- Audio processor → Decay and reverb parameters: reads and updates
- Audio processor → Parameter state: serializes and restores
- Plugin host → Parameter state: saves and restores
- Audio processor → Plugin editor: creates editor
- Plugin editor → Parameter knobs: displays controls
- Parameter knobs → Decay and reverb parameters: attaches sliders
- Parameter knobs → Knob rendering: uses renderer
- Plugin editor → Background and filmstrip: draws background
- Knob rendering → Background and filmstrip: draws filmstrip
- Knob rendering → Inter fonts: uses typefaces
