# edoardomor/lars architecture

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

- Interactive diagram: https://gitdiagram.com/edoardomor/lars
- Repository: https://github.com/edoardomor/lars

## Overview

LARS is a JUCE audio plug-in for separating a stereo drum mix into kick, snare, toms, hi-hat and cymbal stems. A producer loads audio in the editor, runs separation, previews the input or stems, and exports stems as WAV files or by drag-and-drop. The sampled code shows editor-to-processor access and Python separation/model components, but not the complete C++ model-loading path; that connection is marked unverified. The Python separator is a distinct implementation path, not confirmed as called by the plug-in.

Main entry points: [`drums_demix/src/PluginEditor.cpp`](https://github.com/edoardomor/lars/blob/main/drums_demix/src/PluginEditor.cpp) (Editor workflow), [`drums_demix/net/separator.py`](https://github.com/edoardomor/lars/blob/main/drums_demix/net/separator.py) (Python separator), [`drums_demix/src/PluginProcessor.cpp`](https://github.com/edoardomor/lars/blob/main/drums_demix/src/PluginProcessor.cpp) (Audio processor), [`drums_demix/src/ClickableArea.h`](https://github.com/edoardomor/lars/blob/main/drums_demix/src/ClickableArea.h) (Waveform controls)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plug-in runtime"]
  node_editor["Editor workflow<br/>[PluginEditor.cpp]"]
  node_processor["Audio processor"]
  node_waveform["Waveform controls<br/>[ClickableArea.h]"]
  node_stems["Five drum stems<br/>[PluginEditor.cpp]"]
end

subgraph group_separation["Separation models"]
  node_neuralcpp["Neural network utility<br/>[NeuralNetwork.cpp]"]
  node_pythonsep["Python separator<br/>[separator.py]"]
  node_unet["U-Net model<br/>[unet.py]"]
  node_scripted["Scripted stem models"]
  node_modelmap["Model configuration<br/>[saved_models.yaml]"]
  node_scriptbuild["Model scripting<br/>[script_modules.py]"]
end

subgraph group_audio["Audio utilities"]
  node_audiohelpers["Audio transforms<br/>[utils.py]"]
  node_cpputils["C++ audio utilities<br/>[Utils.cpp]"]
end

node_producer(("Producer"))
node_daw["DAW host"]
node_input["Drum mix"]
node_wav["WAV stems"]

node_producer -->|"operates"| node_editor
node_daw -->|"hosts"| node_processor
node_producer -->|"loads"| node_input
node_editor -->|"accesses transports"| node_processor
node_processor -->|"creates"| node_editor
node_editor -->|"uses controls"| node_waveform
node_editor -->|"opens audio"| node_input
node_editor -.->|"separates audio"| node_stems
node_editor -->|"writes stems"| node_wav
node_waveform -->|"drags files"| node_wav
node_stems -->|"previews"| node_producer
node_pythonsep -->|"reads paths"| node_modelmap
node_pythonsep -->|"instantiates"| node_unet
node_pythonsep -->|"uses transforms"| node_audiohelpers
node_scriptbuild -->|"scripts model"| node_unet
node_pythonsep -->|"returns stems"| node_stems
node_neuralcpp -->|"implements forward"| node_neuralcpp
node_cpputils -.->|"parallel utility"| node_audiohelpers

click node_editor "https://github.com/edoardomor/lars/blob/main/drums_demix/src/PluginEditor.cpp"
click node_processor "https://github.com/edoardomor/lars/blob/main/drums_demix/src/PluginProcessor.cpp"
click node_waveform "https://github.com/edoardomor/lars/blob/main/drums_demix/src/ClickableArea.h"
click node_stems "https://github.com/edoardomor/lars/blob/main/drums_demix/src/PluginEditor.cpp"
click node_neuralcpp "https://github.com/edoardomor/lars/blob/main/drums_demix/src/NeuralNetwork.cpp"
click node_pythonsep "https://github.com/edoardomor/lars/blob/main/drums_demix/net/separator.py"
click node_unet "https://github.com/edoardomor/lars/blob/main/drums_demix/net/unet.py"
click node_scripted "https://github.com/edoardomor/lars/tree/main/drums_demix/Resources"
click node_modelmap "https://github.com/edoardomor/lars/blob/main/drums_demix/net/saved_models.yaml"
click node_scriptbuild "https://github.com/edoardomor/lars/blob/main/drums_demix/net/script_modules.py"
click node_audiohelpers "https://github.com/edoardomor/lars/blob/main/drums_demix/net/utils.py"
click node_cpputils "https://github.com/edoardomor/lars/blob/main/drums_demix/src/Utils.cpp"

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_editor,node_processor,node_waveform,node_stems toneBlue
class node_neuralcpp,node_pythonsep,node_unet,node_scripted,node_modelmap,node_scriptbuild toneAmber
class node_audiohelpers,node_cpputils toneMint
class node_producer,node_daw,node_input,node_wav toneIndigo
```

## Components

### Plug-in runtime

- [Editor workflow](https://github.com/edoardomor/lars/blob/main/drums_demix/src/PluginEditor.cpp): `drums_demix/src/PluginEditor.cpp`
- [Audio processor](https://github.com/edoardomor/lars/blob/main/drums_demix/src/PluginProcessor.cpp): `drums_demix/src/PluginProcessor.cpp`
- [Waveform controls](https://github.com/edoardomor/lars/blob/main/drums_demix/src/ClickableArea.h): `drums_demix/src/ClickableArea.h`
- [Five drum stems](https://github.com/edoardomor/lars/blob/main/drums_demix/src/PluginEditor.cpp): `drums_demix/src/PluginEditor.cpp`

### Separation models

- [Neural network utility](https://github.com/edoardomor/lars/blob/main/drums_demix/src/NeuralNetwork.cpp): `drums_demix/src/NeuralNetwork.cpp`
- [Python separator](https://github.com/edoardomor/lars/blob/main/drums_demix/net/separator.py): `drums_demix/net/separator.py`
- [U-Net model](https://github.com/edoardomor/lars/blob/main/drums_demix/net/unet.py): `drums_demix/net/unet.py`
- [Scripted stem models](https://github.com/edoardomor/lars/tree/main/drums_demix/Resources): `drums_demix/Resources`
- [Model configuration](https://github.com/edoardomor/lars/blob/main/drums_demix/net/saved_models.yaml): `drums_demix/net/saved_models.yaml`
- [Model scripting](https://github.com/edoardomor/lars/blob/main/drums_demix/net/script_modules.py): `drums_demix/net/script_modules.py`

### Audio utilities

- [Audio transforms](https://github.com/edoardomor/lars/blob/main/drums_demix/net/utils.py): `drums_demix/net/utils.py`
- [C++ audio utilities](https://github.com/edoardomor/lars/blob/main/drums_demix/src/Utils.cpp): `drums_demix/src/Utils.cpp`

### Other components

- **Producer**
- **DAW host**
- **Drum mix**
- **WAV stems**

## Connections

- Producer → Editor workflow: operates (evidence: `README.md`)
- DAW host → Audio processor: hosts (evidence: `README.md`)
- Producer → Drum mix: loads (evidence: `README.md`)
- Editor workflow → Audio processor: accesses transports (evidence: `drums_demix/src/PluginEditor.cpp`)
- Audio processor → Editor workflow: creates (evidence: `drums_demix/src/PluginProcessor.cpp`)
- Editor workflow → Waveform controls: uses controls
- Editor workflow → Drum mix: opens audio (evidence: `drums_demix/src/PluginEditor.cpp`)
- Editor workflow → Five drum stems: separates audio (evidence: `drums_demix/src/PluginEditor.cpp`)
- Editor workflow → WAV stems: writes stems (evidence: `README.md`)
- Waveform controls → WAV stems: drags files (evidence: `drums_demix/src/ClickableArea.h`)
- Five drum stems → Producer: previews (evidence: `README.md`)
- Python separator → Model configuration: reads paths (evidence: `drums_demix/net/separator.py`)
- Python separator → U-Net model: instantiates (evidence: `drums_demix/net/separator.py`)
- Python separator → Audio transforms: uses transforms (evidence: `drums_demix/net/separator.py`)
- Model scripting → U-Net model: scripts model (evidence: `drums_demix/net/script_modules.py`)
- Python separator → Five drum stems: returns stems (evidence: `drums_demix/net/separator.py`)
- Neural network utility → Neural network utility: implements forward (evidence: `drums_demix/src/NeuralNetwork.cpp`)
- C++ audio utilities → Audio transforms: parallel utility
