# aivandelindt/chronobent architecture

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

- Interactive diagram: https://gitdiagram.com/aivandelindt/chronobent
- Repository: https://github.com/aivandelindt/chronobent

## Overview

ChronoBent is a local audio time-and-pitch processing product: a C/C++ SDK powers an Instrument, an audio-track FX plugin, and the macOS Lab. The main user workflow is to supply audio, set pitch/time/timbre and analysis options, then play or render transformed audio; the Instrument adds sample preparation and MIDI voices, while FX can capture and replay a passage. Note Studio analyzes monophonic audio, exposes note edits, and produces corrected audio. The tree and excerpts support the SDK and plugin internals; Lab implementation details are sparsely sampled, so its internal wiring is left unspecified.

Main entry points: [`plugin/ChronoBentPlugin.cpp`](https://github.com/aivandelindt/chronobent/blob/main/plugin/ChronoBentPlugin.cpp) (Instrument plugin), [`host`](https://github.com/aivandelindt/chronobent/tree/main/host) (Lab workspace), [`include/chronobent/chronobent.hpp`](https://github.com/aivandelindt/chronobent/blob/main/include/chronobent/chronobent.hpp) (C/C++ API), [`plugin/fx/ChronoBentFX.cpp`](https://github.com/aivandelindt/chronobent/blob/main/plugin/fx/ChronoBentFX.cpp) (FX plugin)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["DSP SDK"]
  node_sdk_api["C/C++ API<br/>[chronobent.hpp]"]
  node_sdk_processor["Processor<br/>[processor.cpp]"]
  node_sdk_vocoder["Vocoder DSP<br/>[vocoder.cpp]"]
end

subgraph group_instrument["Instrument"]
  node_instrument_ui["Instrument controls<br/>[script.js]"]
  node_instrument_plugin["Instrument plugin"]
  node_sample_prep["Sample preparation<br/>[instrument.cpp]"]
  node_instrument_engine["Voice rendering<br/>[instrument.cpp]"]
end

subgraph group_fx["FX"]
  node_fx_ui["FX controls<br/>[script.js]"]
  node_fx_plugin["FX plugin<br/>[ChronoBentFX.cpp]"]
  node_fx_engine["Live and capture engine<br/>[effect.cpp]"]
end

subgraph group_lab["Lab"]
  node_lab_workspace["Lab workspace"]
  node_lab_controls["Lab controls<br/>[mac_controls.hpp]"]
  node_lab_wav["WAV export<br/>[mac_wav_export.hpp]"]
end

subgraph group_tuning["Note Studio"]
  node_sdk_tuning_api["Tuning API<br/>[tuning.hpp]"]
  node_tuner["Pitch analysis<br/>[tuning.cpp]"]
  node_tuning_session["Tuning session<br/>[tuning_session.cpp]"]
end

node_musician(("Musician"))
node_audio_source["Audio source"]
node_daw(("DAW host"))
node_sound_out(("Audio output"))

node_musician -->|"sets controls"| node_instrument_ui
node_instrument_ui -->|"sends controls"| node_instrument_plugin
node_daw -->|"hosts"| node_instrument_plugin
node_audio_source -->|"loads sample"| node_instrument_plugin
node_instrument_plugin -->|"prepares sample"| node_sample_prep
node_sample_prep -->|"publishes prepared data"| node_instrument_engine
node_instrument_plugin -->|"starts voices"| node_instrument_engine
node_instrument_engine -->|"renders audio"| node_sdk_api
node_sdk_api -->|"dispatches processing"| node_sdk_processor
node_sdk_processor -->|"processes frames"| node_sdk_vocoder
node_instrument_plugin -->|"opens Note Studio"| node_tuning_session
node_fx_ui -->|"sends controls"| node_fx_plugin
node_daw -->|"hosts audio"| node_fx_plugin
node_fx_plugin -->|"processes blocks"| node_fx_engine
node_fx_engine -->|"renders audio"| node_sdk_api
node_fx_plugin -->|"opens Note Studio"| node_tuning_session
node_musician -->|"explores audio"| node_lab_workspace
node_audio_source -->|"loads audio"| node_lab_workspace
node_lab_workspace -->|"provides controls"| node_lab_controls
node_lab_workspace -->|"exports audio"| node_lab_wav
node_lab_workspace -->|"processes audio"| node_sdk_api
node_tuning_session -->|"analyzes and edits"| node_sdk_tuning_api
node_sdk_tuning_api -->|"dispatches analysis"| node_tuner
node_tuning_session -.->|"accepts source audio"| node_audio_source
node_sdk_api -->|"returns processed audio"| node_sound_out

click node_sdk_api "https://github.com/aivandelindt/chronobent/blob/main/include/chronobent/chronobent.hpp"
click node_sdk_processor "https://github.com/aivandelindt/chronobent/blob/main/src/processor.cpp"
click node_sdk_vocoder "https://github.com/aivandelindt/chronobent/blob/main/src/vocoder.cpp"
click node_sdk_tuning_api "https://github.com/aivandelindt/chronobent/blob/main/include/chronobent/tuning.hpp"
click node_tuner "https://github.com/aivandelindt/chronobent/blob/main/src/tuning.cpp"
click node_tuning_session "https://github.com/aivandelindt/chronobent/blob/main/host/tuning_session.cpp"
click node_instrument_ui "https://github.com/aivandelindt/chronobent/blob/main/plugin/resources/web/script.js"
click node_instrument_plugin "https://github.com/aivandelindt/chronobent/blob/main/plugin/ChronoBentPlugin.cpp"
click node_sample_prep "https://github.com/aivandelindt/chronobent/blob/main/plugin/instrument.cpp"
click node_instrument_engine "https://github.com/aivandelindt/chronobent/blob/main/plugin/instrument.cpp"
click node_fx_ui "https://github.com/aivandelindt/chronobent/blob/main/plugin/fx/resources/web/script.js"
click node_fx_plugin "https://github.com/aivandelindt/chronobent/blob/main/plugin/fx/ChronoBentFX.cpp"
click node_fx_engine "https://github.com/aivandelindt/chronobent/blob/main/plugin/effect.cpp"
click node_lab_workspace "https://github.com/aivandelindt/chronobent/tree/main/host"
click node_lab_controls "https://github.com/aivandelindt/chronobent/blob/main/host/mac_controls.hpp"
click node_lab_wav "https://github.com/aivandelindt/chronobent/blob/main/host/mac_wav_export.hpp"

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_sdk_api,node_sdk_processor,node_sdk_vocoder toneBlue
class node_instrument_ui,node_instrument_plugin,node_sample_prep,node_instrument_engine toneAmber
class node_fx_ui,node_fx_plugin,node_fx_engine toneMint
class node_lab_workspace,node_lab_controls,node_lab_wav toneRose
class node_sdk_tuning_api,node_tuner,node_tuning_session,node_musician,node_audio_source,node_daw,node_sound_out toneIndigo
```

## Components

### DSP SDK

- [C/C++ API](https://github.com/aivandelindt/chronobent/blob/main/include/chronobent/chronobent.hpp): `include/chronobent/chronobent.hpp`
- [Processor](https://github.com/aivandelindt/chronobent/blob/main/src/processor.cpp): `src/processor.cpp`
- [Vocoder DSP](https://github.com/aivandelindt/chronobent/blob/main/src/vocoder.cpp): `src/vocoder.cpp`

### Instrument

- [Instrument controls](https://github.com/aivandelindt/chronobent/blob/main/plugin/resources/web/script.js): `plugin/resources/web/script.js`
- [Instrument plugin](https://github.com/aivandelindt/chronobent/blob/main/plugin/ChronoBentPlugin.cpp): `plugin/ChronoBentPlugin.cpp`
- [Sample preparation](https://github.com/aivandelindt/chronobent/blob/main/plugin/instrument.cpp): `plugin/instrument.cpp`
- [Voice rendering](https://github.com/aivandelindt/chronobent/blob/main/plugin/instrument.cpp): `plugin/instrument.cpp`

### FX

- [FX controls](https://github.com/aivandelindt/chronobent/blob/main/plugin/fx/resources/web/script.js): `plugin/fx/resources/web/script.js`
- [FX plugin](https://github.com/aivandelindt/chronobent/blob/main/plugin/fx/ChronoBentFX.cpp): `plugin/fx/ChronoBentFX.cpp`
- [Live and capture engine](https://github.com/aivandelindt/chronobent/blob/main/plugin/effect.cpp): `plugin/effect.cpp`

### Lab

- [Lab workspace](https://github.com/aivandelindt/chronobent/tree/main/host): `host`
- [Lab controls](https://github.com/aivandelindt/chronobent/blob/main/host/mac_controls.hpp): `host/mac_controls.hpp`
- [WAV export](https://github.com/aivandelindt/chronobent/blob/main/host/mac_wav_export.hpp): `host/mac_wav_export.hpp`

### Note Studio

- [Tuning API](https://github.com/aivandelindt/chronobent/blob/main/include/chronobent/tuning.hpp): `include/chronobent/tuning.hpp`
- [Pitch analysis](https://github.com/aivandelindt/chronobent/blob/main/src/tuning.cpp): `src/tuning.cpp`
- [Tuning session](https://github.com/aivandelindt/chronobent/blob/main/host/tuning_session.cpp): `host/tuning_session.cpp`

### Other components

- **Musician**
- **Audio source**
- **DAW host**
- **Audio output**

## Connections

- Musician → Instrument controls: sets controls
- Instrument controls → Instrument plugin: sends controls
- DAW host → Instrument plugin: hosts
- Audio source → Instrument plugin: loads sample
- Instrument plugin → Sample preparation: prepares sample
- Sample preparation → Voice rendering: publishes prepared data
- Instrument plugin → Voice rendering: starts voices
- Voice rendering → C/C++ API: renders audio
- C/C++ API → Processor: dispatches processing
- Processor → Vocoder DSP: processes frames
- Instrument plugin → Tuning session: opens Note Studio
- FX controls → FX plugin: sends controls
- DAW host → FX plugin: hosts audio
- FX plugin → Live and capture engine: processes blocks
- Live and capture engine → C/C++ API: renders audio
- FX plugin → Tuning session: opens Note Studio
- Musician → Lab workspace: explores audio
- Audio source → Lab workspace: loads audio
- Lab workspace → Lab controls: provides controls
- Lab workspace → WAV export: exports audio
- Lab workspace → C/C++ API: processes audio
- Tuning session → Tuning API: analyzes and edits
- Tuning API → Pitch analysis: dispatches analysis
- Tuning session → Audio source: accepts source audio
- C/C++ API → Audio output: returns processed audio
