# falktx/carla architecture

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

- Interactive diagram: https://gitdiagram.com/falktx/carla
- Repository: https://github.com/falktx/carla

## Overview

1. **What the repository is**
   Carla is an audio plugin host and plugin/application wrapper, not a single app. The repo builds multiple runtime targets: standalone host apps, JACK-specific host modes, a control app, a database/settings frontend, a REST server, bridge helpers, and exported plugin binaries in LV2/VST/AU/native forms.

2. **Top-level architecture**
   The system is split into a **frontend layer** for user interaction, a **backend/engine layer** for audio/MIDI processing and plugin lifecycle, and a set of **format/driver adapters** that connect Carla to external plugin ecosystems and audio runtimes. The main data path is: UI/control messages → host/backend state changes → engine graph scheduling → audio/MIDI I/O and plugin processing.

3. **Frontend subsystem**
   `source/frontend` contains the UI applications and shared GUI logic, with both C++ and Python implementations. It includes the main Carla host UI, rack/patchbay variants, JACK multi/single client launchers, plugin list dialogs, settings UI, and widgets/canvas code. The frontend is responsible for presenting plugin graphs, parameters, presets, and transport/control state, but it does not do DSP itself.

4. **Backend and engine subsystem**
   `source/backend` is the core host implementation. The engine layer under `source/backend/engine` manages audio/MIDI ports, plugin instances, engine graph topology, and runtime scheduling. Separate engine backends exist for JACK, native drivers, SDL, RtAudio, OSC, dummy mode, and internal/bridge use. This is the primary execution boundary for real-time processing.

5. **Plugin loading and format adapters**
   `source/backend/plugin` and `source/plugin` implement support for multiple plugin formats and host-plugin packaging. Carla can load LADSPA, DSSI, LV2, VST2, VST3, CLAP, AU, JSFX, SFZero, and internal/native plugins. These adapters normalize each format into Carla’s internal host model so the engine can treat them consistently.

6. **Bridge and isolation layers**
   `source/bridges-plugin`, `source/bridges-ui`, and `source/jackbridge` provide the process-boundary machinery for running plugins or UIs out-of-process. This is especially important for format compatibility and crash/isolation scenarios, such as bridged plugins or external UIs. The bridge layer acts as a proxy between the main host process and a separate plugin/UI process via pipes/shared protocol helpers.

7. **Native plugins and built-in effects/tools**
   `source/native-plugins` contains Carla’s bundled plugins: audio gain, bypass, MIDI utilities, MIDI file/pattern tools, note tools, XY controller, quad panner, and similar utilities. These are compiled into Carla’s own plugin ecosystem and can be used like regular plugins inside the host. They are a separate boundary from external third-party plugin scanning/loading.

8. **Standalone apps and entrypoints**
   The repo builds several executable front doors in `source/frontend` and `source/backend`, including `carla`, `carla-control`, `carla-jack-*`, `carla-rack`, `carla-patchbay`, `carla-plugin`, `carla-database`, `carla-settings`, and `carla-rest-frontend`. Packaging scripts under `data/` and launch wrappers select platform-specific drivers, GUI toolkits, and deployment formats.

9. **Remote control and service interfaces**
   Carla exposes non-GUI control paths through OSC and REST. The OSC engine code lives under `source/backend/engine/CarlaEngineOsc*`, and the REST server is in `source/rest`. These interfaces let external tools control host state, plugin parameters, and session operations without using the desktop UI.

10. **Plugin discovery, metadata, and persistence**
   `source/backend/utils` and `source/utils` contain plugin discovery, cached plugin indexing, state serialization, process helpers, ring buffers, IPC, and platform abstractions. This layer mediates between scanned plugin metadata, saved Carla projects, and runtime engine state. The database frontend also sits on top of this metadata/persistence pipeline.

11. **Vendored runtime dependencies**
   `source/modules` and `source/includes` bundle major third-party libraries and SDK headers Carla depends on: DPF/Distrho, dgl UI toolkit, Lilv/LV2 stack, RtAudio, RtMidi, zita-resampler, water/JUCE-like utilities, Ableton Link, Asio, and plugin SDK headers for LADSPA/DSSI/LV2/CLAP/Vestige. These dependencies are integral to the architecture because they enable cross-format hosting, audio I/O, GUI rendering, and transport sync.

12. **User interface rendering stack**
   Carla’s custom UI stack is built around the `dgl` module and canvas/widget code in the frontend. Resource files in `resources/` and `.ui` definitions in `resources/ui` are compiled into platform-specific GUI assets. The UI layer is therefore a mix of generated Qt forms, custom canvas widgets, and shared cross-platform rendering primitives.

13. **Cross-platform deployment and platform-specific adapters**
   The repo has explicit support for Linux, macOS, Windows, and Haiku packaging under `data/`, with platform launchers, plist/desktop files, Windows unzip/bootstrap logic, and build scripts. Runtime adapter code in `source/utils`, `source/backend/engine`, and `source/modules/dgl` handles differences in audio drivers, windowing systems, and process launching.

14. **Build, CI, and release structure**
   Build orchestration is split across Makefiles, CMake, and CI workflows. The `.github/workflows` and `.travis*` files show a matrix over platforms and packaging targets. This matters architecturally because the repo is assembled into many binaries and plugin artifacts rather than one monolith, and the release process is part of the product design.

Main entry points: [`source/frontend/C++`](https://github.com/falktx/carla/tree/main/source/frontend/C++) (GUI core), [`source/backend`](https://github.com/falktx/carla/tree/main/source/backend) (Host API), [`source/backend/plugin`](https://github.com/falktx/carla/tree/main/source/backend/plugin) (Plugin core), [`source/frontend`](https://github.com/falktx/carla/tree/main/source/frontend) (Host apps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_group_frontend["Frontend"]
  node_frontend_apps["Host apps<br/>entrypoints"]
  node_frontend_gui["GUI core<br/>shared-ui"]
  node_frontend_canvas["Canvas UI<br/>rendering"]
  node_frontend_dialogs["Dialogs"]
end

subgraph group_group_backend["Backend"]
  node_backend_api["Host API<br/>host-core"]
  node_engine_core["Engine core<br/>rt-engine"]
  node_engine_jacks["Runtime engines<br/>io-backends"]
  node_rest_iface["REST API<br/>remote-control"]
  node_discovery["Discovery<br/>scan-index"]
  node_utils_core["Utils<br/>shared-runtime"]
end

subgraph group_group_adapters["Adapters"]
  node_plugin_core["Plugin core<br/>plugin-host"]
  node_format_plugins["Formats"]
  node_bridge_plugin["Plugin bridge<br/>isolation"]
  node_bridge_ui["UI bridge<br/>isolation"]
  node_jackbridge["Jack bridge<br/>compat-layer"]
  node_native_plugins["Built-ins<br/>native-plugins"]
end

subgraph group_group_modules["Modules"]
  node_modules_dgl["DGL<br/>ui-toolkit"]
  node_modules_lilv["Lilv stack<br/>lv2-stack"]
  node_modules_audio["Audio libs<br/>io-libs"]
  node_modules_gui["GUI deps<br/>support-libs"]
end

subgraph group_group_deploy["Deployment"]
  node_deploy_assets["Deploy<br/>packaging"]
  node_resources_ui["Resources<br/>assets"]
  node_build_ci["Build/CI<br/>build-system<br/>[.github]"]
end

node_frontend_apps -->|"uses"| node_frontend_gui
node_frontend_gui -->|"renders"| node_frontend_canvas
node_frontend_gui -->|"opens"| node_frontend_dialogs
node_frontend_apps -->|"calls"| node_backend_api
node_backend_api -->|"configures"| node_engine_core
node_engine_core -->|"runs on"| node_engine_jacks
node_engine_core -->|"hosts"| node_plugin_core
node_plugin_core -->|"adapts"| node_format_plugins
node_plugin_core -->|"bridges"| node_bridge_plugin
node_bridge_plugin -->|"pairs with"| node_bridge_ui
node_bridge_plugin -->|"leverages"| node_jackbridge
node_backend_api -->|"exposes"| node_rest_iface
node_backend_api -->|"indexes"| node_discovery
node_discovery -->|"depends on"| node_utils_core
node_plugin_core -->|"bundles"| node_native_plugins
node_frontend_gui -->|"uses"| node_utils_core
node_frontend_gui -->|"loads"| node_resources_ui
node_frontend_canvas -->|"built on"| node_modules_dgl
node_frontend_gui -->|"built on"| node_modules_dgl
node_backend_api -->|"uses"| node_modules_audio
node_plugin_core -->|"uses"| node_modules_lilv
node_frontend_gui -->|"uses"| node_modules_gui
node_deploy_assets -->|"launches"| node_frontend_apps
node_deploy_assets -->|"packages"| node_native_plugins
node_build_ci -->|"packages"| node_deploy_assets
node_build_ci -->|"builds"| node_modules_lilv
node_build_ci -->|"builds"| node_frontend_apps

click node_frontend_apps "https://github.com/falktx/carla/tree/main/source/frontend"
click node_frontend_gui "https://github.com/falktx/carla/tree/main/source/frontend/C++"
click node_frontend_canvas "https://github.com/falktx/carla/tree/main/source/frontend/patchcanvas"
click node_frontend_dialogs "https://github.com/falktx/carla/tree/main/source/frontend/dialogs"
click node_backend_api "https://github.com/falktx/carla/tree/main/source/backend"
click node_engine_core "https://github.com/falktx/carla/tree/main/source/backend/engine"
click node_engine_jacks "https://github.com/falktx/carla/tree/main/source/backend/engine"
click node_plugin_core "https://github.com/falktx/carla/tree/main/source/backend/plugin"
click node_format_plugins "https://github.com/falktx/carla/tree/main/source/plugin"
click node_bridge_plugin "https://github.com/falktx/carla/tree/main/source/bridges-plugin"
click node_bridge_ui "https://github.com/falktx/carla/tree/main/source/bridges-ui"
click node_jackbridge "https://github.com/falktx/carla/tree/main/source/jackbridge"
click node_rest_iface "https://github.com/falktx/carla/tree/main/source/rest"
click node_native_plugins "https://github.com/falktx/carla/tree/main/source/native-plugins"
click node_discovery "https://github.com/falktx/carla/tree/main/source/discovery"
click node_utils_core "https://github.com/falktx/carla/tree/main/source/utils"
click node_modules_dgl "https://github.com/falktx/carla/tree/main/source/modules/dgl"
click node_modules_lilv "https://github.com/falktx/carla/tree/main/source/modules/lilv"
click node_modules_audio "https://github.com/falktx/carla/tree/main/source/modules"
click node_modules_gui "https://github.com/falktx/carla/tree/main/source/modules"
click node_deploy_assets "https://github.com/falktx/carla/tree/main/data"
click node_resources_ui "https://github.com/falktx/carla/tree/main/resources"
click node_build_ci "https://github.com/falktx/carla/blob/main/.github"

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_frontend_apps,node_frontend_gui,node_frontend_canvas,node_frontend_dialogs toneBlue
class node_backend_api,node_engine_core,node_engine_jacks,node_rest_iface,node_discovery,node_utils_core toneAmber
class node_plugin_core,node_format_plugins,node_bridge_plugin,node_bridge_ui,node_jackbridge,node_native_plugins toneMint
class node_modules_dgl,node_modules_lilv,node_modules_audio,node_modules_gui toneRose
class node_deploy_assets,node_resources_ui,node_build_ci toneIndigo
```

## Components

### Frontend

User-facing hosts, control apps, dialogs, widgets, and shared GUI code.

- [Host apps](https://github.com/falktx/carla/tree/main/source/frontend): entrypoints · Standalone UI entrypoints and front doors for Carla host, rack, patchbay, settings, database, and control modes. · `source/frontend`
- [GUI core](https://github.com/falktx/carla/tree/main/source/frontend/C++): shared-ui · Shared C++/Python frontend logic, host/control glue, settings, skinning, and widget composition. · `source/frontend/C++`
- [Canvas UI](https://github.com/falktx/carla/tree/main/source/frontend/patchcanvas): rendering · Custom patchbay canvas, widgets, and interactive editor/rendering primitives. · `source/frontend/patchcanvas`
- [Dialogs](https://github.com/falktx/carla/tree/main/source/frontend/dialogs): ui-dialogs · Dialogs for plugin listing, JACK app setup, about boxes, and parameter/settings editing. · `source/frontend/dialogs`

### Backend

Core host state, engine scheduling, plugin lifecycle, and runtime I/O.

- [Host API](https://github.com/falktx/carla/tree/main/source/backend): host-core · Public host/backend interfaces and stand-alone host wiring used by frontends and runtime targets. · `source/backend`
- [Engine core](https://github.com/falktx/carla/tree/main/source/backend/engine): rt-engine · Real-time engine graph, ports, runner, data flow, and scheduling boundary. · `source/backend/engine`
- [Runtime engines](https://github.com/falktx/carla/tree/main/source/backend/engine): io-backends · Concrete engine backends for JACK, native, SDL, RtAudio, OSC, dummy, bridge, and internal modes. · `source/backend/engine`
- [REST API](https://github.com/falktx/carla/tree/main/source/rest): remote-control · HTTP service and REST frontend for controlling host state and sessions remotely. · `source/rest`
- [Discovery](https://github.com/falktx/carla/tree/main/source/discovery): scan-index · Plugin scanning, discovery, cached indexing, and metadata extraction utilities. · `source/discovery`
- [Utils](https://github.com/falktx/carla/tree/main/source/utils): shared-runtime · Cross-cutting process, IPC, ring buffer, state, platform, and plugin helper utilities. · `source/utils`

### Adapters

Plugin-format wrappers, bridges, discovery, and out-of-process helpers.

- [Plugin core](https://github.com/falktx/carla/tree/main/source/backend/plugin): plugin-host · Internal plugin model and format-specific adapters that normalize external plugins into Carla's host model. · `source/backend/plugin`
- [Formats](https://github.com/falktx/carla/tree/main/source/plugin): plugin-formats · Support for LADSPA, DSSI, LV2, VST2, VST3, CLAP, AU, JSFX, SFZero, FluidSynth, and native plugins. · `source/plugin`
- [Plugin bridge](https://github.com/falktx/carla/tree/main/source/bridges-plugin): isolation · Out-of-process plugin execution and bridge helpers for crash isolation and compatibility. · `source/bridges-plugin`
- [UI bridge](https://github.com/falktx/carla/tree/main/source/bridges-ui): isolation · External UI and toolkit bridge layer for proxying plugin UIs across process boundaries. · `source/bridges-ui`
- [Jack bridge](https://github.com/falktx/carla/tree/main/source/jackbridge): compat-layer · JACK bridging implementation used to integrate host and bridged plugin/client behavior. · `source/jackbridge`
- [Built-ins](https://github.com/falktx/carla/tree/main/source/native-plugins): native-plugins · Bundled Carla plugins such as audio gain, bypass, MIDI utilities, note tools, XY controller, and panner. · `source/native-plugins`

### Modules

Vendored libraries and SDKs that provide audio, MIDI, GUI, network, and metadata primitives.

- [DGL](https://github.com/falktx/carla/tree/main/source/modules/dgl): ui-toolkit · Custom cross-platform widget and OpenGL/NanoVG UI toolkit used by Carla's frontend and plugin UIs. · `source/modules/dgl`
- [Lilv stack](https://github.com/falktx/carla/tree/main/source/modules/lilv): lv2-stack · Vendored LV2 ecosystem libraries for RDF, metadata, and plugin state handling. · `source/modules/lilv`
- [Audio libs](https://github.com/falktx/carla/tree/main/source/modules): io-libs · Vendored audio/MIDI runtime libraries including RtAudio, RtMidi, resampler, mempool, decoder, and SFZero/YSFX support. · `source/modules`
- [GUI deps](https://github.com/falktx/carla/tree/main/source/modules): support-libs · Bundled DPF/Distrho, Water, Hylia/Link, and related SDK or utility dependencies. · `source/modules`

### Deployment

Packaging, launch scripts, resources, and platform-specific distribution assets.

- [Deploy](https://github.com/falktx/carla/tree/main/data): packaging · Desktop files, launch scripts, plist resources, icons, bundles, and platform packaging assets. · `data`
- [Resources](https://github.com/falktx/carla/tree/main/resources): assets · Compiled UI forms, icons, bitmaps, themes, and other generated or packaged interface assets. · `resources`
- [Build/CI](https://github.com/falktx/carla/blob/main/.github): build-system · Makefiles, CMake, GitHub Actions, Travis scripts, and release automation for many targets. · `.github`

## Connections

- Host apps → GUI core: uses · Entry points assemble shared frontend logic and host control surfaces.
- GUI core → Canvas UI: renders · Shared frontend logic builds patchbay and editor canvas views.
- GUI core → Dialogs: opens · GUI core opens plugin, settings, and host configuration dialogs.
- Host apps → Host API: calls · UI entrypoints drive host/backend operations through the host API.
- Host API → Engine core: configures · Host API constructs and controls the real-time engine core.
- Engine core → Runtime engines: runs on · Core scheduling executes through concrete runtime engine backends.
- Engine core → Plugin core: hosts · The engine instantiates plugins through the plugin model layer.
- Plugin core → Formats: adapts · Format adapters normalize third-party and native plugin formats into one model.
- Plugin core → Plugin bridge: bridges · Bridge-capable plugins can be proxied into separate processes.
- Plugin bridge → UI bridge: pairs with · Out-of-process plugin execution is coordinated with external UI bridges.
- Plugin bridge → Jack bridge: leverages · Bridge execution uses JACK-specific compatibility and proxy machinery.
- Host API → REST API: exposes · Host state and control operations are also exposed through REST.
- Host API → Discovery: indexes · Backend utilities feed plugin discovery and cached metadata generation.
- Discovery → Utils: depends on · Discovery and caching build on common utility and IPC helpers.
- Plugin core → Built-ins: bundles · Carla's built-in plugin set is packaged alongside the host model.
- GUI core → Utils: uses · Frontends share state, process, and UI helpers from the utility layer.
- GUI core → Resources: loads · GUI code consumes compiled forms, icons, and theme assets.
- Canvas UI → DGL: built on · Custom canvas and widgets sit on top of the DGL rendering toolkit.
- GUI core → DGL: built on · Shared UI code relies on the custom cross-platform widget toolkit.
- Host API → Audio libs: uses · Host/runtime code uses audio I/O, resampling, MIDI, and decoding libraries.
- Plugin core → Lilv stack: uses · LV2 metadata and RDF handling are backed by the Lilv stack.
- GUI core → GUI deps: uses · Frontend and plugin UI code depend on bundled GUI/support libraries.
- Deploy → Host apps: launches · Deployment scripts and desktop/plist entries start the various app front doors.
- Deploy → Built-ins: packages · Packaging includes native plugin bundles and related assets.
- Build/CI → Deploy: packages · Build and release automation assemble platform-specific deployment artifacts.
- Build/CI → Lilv stack: builds · CI and build scripts compile bundled third-party dependencies.
- Build/CI → Host apps: builds · The build matrix produces the many frontend and standalone binaries.
