# flarkflarkflark/stemperator architecture

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

- Interactive diagram: https://gitdiagram.com/flarkflarkflark/stemperator
- Repository: https://github.com/flarkflarkflark/stemperator

## Overview

STEMperator is a set of REAPER scripts for AI stem separation, not the historical JUCE plugin retained under `legacy/`. A user selects an item or time range, chooses a separation action, and gets WAV stems alongside the source; scripts can also route stems to tracks or replace items. The README documents the workflow and script capabilities. The REAPER script implementations were not excerpted, so edges below rely on those documented relationships; the sampled Python backend file does not establish its caller.

Main entry points: [`scripts/reaper`](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper) (Script actions), [`scripts/reaper/audio_separator_process.py`](https://github.com/flarkflarkflark/stemperator/blob/main/scripts/reaper/audio_separator_process.py) (Separation runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reaper["REAPER Workflow"]
  node_actions["Script actions"]
  node_selection["Item and time selection"]
  node_dialog["Separation dialog"]
  node_quickactions["Stem presets"]
  node_batch["Batch processing"]
  node_toolbar["Toolbar setup"]
end

subgraph group_separation["Stem Separation"]
  node_runner["Separation runner"]
  node_backend["AI separator"]
  node_models["Demucs models"]
  node_gpu["GPU acceleration"]
end

subgraph group_results["Stem Results"]
  node_stems["WAV stems"]
  node_tracks["Routed tracks"]
  node_replacement["In-place replacement"]
  node_source["Original audio"]
end

node_user(("REAPER user"))

node_user -->|"runs"| node_actions
node_actions -->|"reads selection"| node_selection
node_actions -->|"opens"| node_dialog
node_actions -->|"dispatches"| node_quickactions
node_actions -->|"offers"| node_batch
node_actions -->|"offers"| node_toolbar
node_dialog -->|"starts separation"| node_runner
node_quickactions -->|"starts separation"| node_runner
node_batch -->|"processes files"| node_runner
node_runner -.->|"requests separation"| node_backend
node_dialog -->|"selects model"| node_models
node_backend -->|"may use"| node_gpu
node_backend -->|"writes"| node_stems
node_runner -->|"preserves"| node_source
node_stems -->|"routes"| node_tracks
node_stems -->|"replaces item"| node_replacement

click node_actions "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_selection "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_dialog "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_quickactions "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_batch "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_toolbar "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_runner "https://github.com/flarkflarkflark/stemperator/blob/main/scripts/reaper/audio_separator_process.py"
click node_models "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_gpu "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_stems "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_tracks "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"
click node_replacement "https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper"

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_actions,node_selection,node_dialog,node_quickactions,node_batch,node_toolbar,node_user toneBlue
class node_runner,node_backend,node_models,node_gpu toneAmber
class node_stems,node_tracks,node_replacement,node_source toneMint
```

## Components

### REAPER Workflow

- [Script actions](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- [Item and time selection](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- [Separation dialog](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- [Stem presets](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- [Batch processing](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- [Toolbar setup](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`

### Stem Separation

- [Separation runner](https://github.com/flarkflarkflark/stemperator/blob/main/scripts/reaper/audio_separator_process.py): `scripts/reaper/audio_separator_process.py`
- **AI separator**
- [Demucs models](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- [GPU acceleration](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`

### Stem Results

- [WAV stems](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- [Routed tracks](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- [In-place replacement](https://github.com/flarkflarkflark/stemperator/tree/main/scripts/reaper): `scripts/reaper`
- **Original audio**

### Other components

- **REAPER user**

## Connections

- REAPER user → Script actions: runs (evidence: `README.md`)
- Script actions → Item and time selection: reads selection (evidence: `README.md`)
- Script actions → Separation dialog: opens (evidence: `README.md`)
- Script actions → Stem presets: dispatches (evidence: `README.md`)
- Script actions → Batch processing: offers (evidence: `README.md`)
- Script actions → Toolbar setup: offers (evidence: `README.md`)
- Separation dialog → Separation runner: starts separation (evidence: `README.md`)
- Stem presets → Separation runner: starts separation (evidence: `README.md`)
- Batch processing → Separation runner: processes files (evidence: `README.md`)
- Separation runner → AI separator: requests separation
- Separation dialog → Demucs models: selects model (evidence: `README.md`)
- AI separator → GPU acceleration: may use (evidence: `README.md`)
- AI separator → WAV stems: writes (evidence: `README.md`)
- Separation runner → Original audio: preserves (evidence: `README.md`)
- WAV stems → Routed tracks: routes (evidence: `README.md`)
- WAV stems → In-place replacement: replaces item (evidence: `README.md`)
