# charlesneimog/openscofo architecture

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

- Interactive diagram: https://gitdiagram.com/charlesneimog/openscofo
- Repository: https://github.com/charlesneimog/openscofo

## Overview

OpenScofo is a real-time score-following library for contemporary music, with host integrations and tools for score authoring and model training. The principal workflow is audio blocks and a score entering the follower, which estimates musical state and produces score-following descriptions for an application. The repository also includes a score-language parser/editor and an extended-technique model-training path. README statements establish the product capabilities; several internal runtime calls and wrapper-to-core links are not shown in the excerpts, so those links are marked unverified rather than asserted as confirmed calls.

Main entry points: [`Sources/OpenScofo/OpenScofo.cpp`](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/OpenScofo.cpp) (Score Follower), [`Resources/Score-Editor/src/core/OpenScofoOnlineEditor.js`](https://github.com/charlesneimog/openscofo/blob/main/Resources/Score-Editor/src/core/OpenScofoOnlineEditor.js) (Online Score Editor), [`Sources/OpenScofo/OpenScofo.hpp`](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/OpenScofo.hpp) (Audio Blocks), [`Sources/OpenScofo/score.cpp`](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/score.cpp) (Score State)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Following Runtime"]
  node_audio["Audio Blocks<br/>[OpenScofo.hpp]"]
  node_score["Score State<br/>[score.cpp]"]
  node_follower["Score Follower<br/>[OpenScofo.cpp]"]
  node_forward["Forward Algorithm<br/>[forward.cpp]"]
  node_audiofeatures["Audio Features<br/>[mir.cpp]"]
  node_techdetect["Technique Inference<br/>[onnx.cpp]"]
  node_lua["Lua Scripting<br/>[lua.cpp]"]
  node_description["Following Description<br/>[OpenScofo.hpp]"]
end

subgraph group_interfaces["Host Interfaces"]
  node_pd["Pure Data Object<br/>[openscofo~.cpp]"]
  node_max["Max Object<br/>[openscofo~.cpp]"]
  node_python["Python Package<br/>[PyOpenScofo.cpp]"]
  node_csound["Csound Plugin<br/>[OpenScofo.cpp]"]
  node_supercollider["SuperCollider Plugin<br/>[OpenScofo.cpp]"]
  node_vamp["Vamp Plugin<br/>[VampOpenScofo.cpp]"]
  node_wasm["WebAssembly Interface<br/>[OpenScofo.cpp]"]
  node_pythonapi["Python API<br/>[__init__.py]"]
end

subgraph group_language["Score Language Tools"]
  node_editor["Online Score Editor"]
  node_scoreservice["Score Import / Export<br/>[score-service.js]"]
  node_parserintegration["Editor Parser Integration"]
  node_treeparser["Tree-sitter Parser<br/>[parser.c]"]
end

subgraph group_models["Model Training"]
  node_webtrainer["Web Training UI<br/>[app.py]"]
  node_trainer["Classifier Trainer<br/>[train.py]"]
end

node_musician(("Musician / App"))

node_musician -.->|"provides audio"| node_audio
node_musician -.->|"provides score"| node_score
node_audio -.->|"processes blocks"| node_follower
node_score -.->|"follows score"| node_follower
node_follower -.->|"uses algorithm"| node_forward
node_follower -.->|"analyzes pitch"| node_audiofeatures
node_follower -.->|"uses inference"| node_techdetect
node_follower -.->|"supports scripting"| node_lua
node_follower -.->|"returns state"| node_description
node_pd -.->|"wraps library"| node_follower
node_max -.->|"wraps library"| node_follower
node_python -.->|"wraps library"| node_follower
node_csound -.->|"wraps library"| node_follower
node_supercollider -.->|"wraps library"| node_follower
node_vamp -.->|"wraps library"| node_follower
node_wasm -.->|"wraps library"| node_follower
node_editor -->|"initializes parser"| node_parserintegration
node_editor -->|"delegates score I/O"| node_scoreservice
node_parserintegration -.->|"parses score"| node_treeparser
node_webtrainer -.->|"configures training"| node_trainer
node_pythonapi -->|"loads trainer"| node_trainer
node_musician -->|"uploads recordings"| node_webtrainer

click node_audio "https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/OpenScofo.hpp"
click node_score "https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/score.cpp"
click node_follower "https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/OpenScofo.cpp"
click node_forward "https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/forward.cpp"
click node_audiofeatures "https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/mir.cpp"
click node_techdetect "https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/onnx.cpp"
click node_lua "https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/lua.cpp"
click node_description "https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/OpenScofo.hpp"
click node_pd "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/PureData/openscofo~.cpp"
click node_max "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Max/openscofo~.cpp"
click node_python "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Python/PyOpenScofo.cpp"
click node_csound "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/CSound/OpenScofo.cpp"
click node_supercollider "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/SuperCollider/OpenScofo.cpp"
click node_vamp "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Vamp/VampOpenScofo.cpp"
click node_wasm "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Wasm/OpenScofo.cpp"
click node_editor "https://github.com/charlesneimog/openscofo/blob/main/Resources/Score-Editor/src/core/OpenScofoOnlineEditor.js"
click node_scoreservice "https://github.com/charlesneimog/openscofo/blob/main/Resources/Score-Editor/src/services/score-service.js"
click node_parserintegration "https://github.com/charlesneimog/openscofo/blob/main/Resources/Score-Editor/src/parser/parser-integration.js"
click node_treeparser "https://github.com/charlesneimog/openscofo/blob/main/Sources/Language/src/parser.c"
click node_webtrainer "https://github.com/charlesneimog/openscofo/blob/main/Resources/WebTrainer/app.py"
click node_trainer "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Python/OpenScofo/train.py"
click node_pythonapi "https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Python/OpenScofo/__init__.py"

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_audio,node_score,node_follower,node_forward,node_audiofeatures,node_techdetect,node_lua,node_description toneBlue
class node_pd,node_max,node_python,node_csound,node_supercollider,node_vamp,node_wasm,node_pythonapi toneAmber
class node_editor,node_scoreservice,node_parserintegration,node_treeparser toneMint
class node_webtrainer,node_trainer toneRose
class node_musician toneIndigo
```

## Components

### Following Runtime

- [Audio Blocks](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/OpenScofo.hpp): `Sources/OpenScofo/OpenScofo.hpp`
- [Score State](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/score.cpp): `Sources/OpenScofo/score.cpp`
- [Score Follower](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/OpenScofo.cpp): `Sources/OpenScofo/OpenScofo.cpp`
- [Forward Algorithm](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/forward.cpp): `Sources/OpenScofo/forward.cpp`
- [Audio Features](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/mir.cpp): `Sources/OpenScofo/mir.cpp`
- [Technique Inference](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/onnx.cpp): `Sources/OpenScofo/onnx.cpp`
- [Lua Scripting](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/lua.cpp): `Sources/OpenScofo/lua.cpp`
- [Following Description](https://github.com/charlesneimog/openscofo/blob/main/Sources/OpenScofo/OpenScofo.hpp): `Sources/OpenScofo/OpenScofo.hpp`

### Host Interfaces

- [Pure Data Object](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/PureData/openscofo~.cpp): `Sources/Wrappers/PureData/openscofo~.cpp`
- [Max Object](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Max/openscofo~.cpp): `Sources/Wrappers/Max/openscofo~.cpp`
- [Python Package](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Python/PyOpenScofo.cpp): `Sources/Wrappers/Python/PyOpenScofo.cpp`
- [Csound Plugin](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/CSound/OpenScofo.cpp): `Sources/Wrappers/CSound/OpenScofo.cpp`
- [SuperCollider Plugin](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/SuperCollider/OpenScofo.cpp): `Sources/Wrappers/SuperCollider/OpenScofo.cpp`
- [Vamp Plugin](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Vamp/VampOpenScofo.cpp): `Sources/Wrappers/Vamp/VampOpenScofo.cpp`
- [WebAssembly Interface](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Wasm/OpenScofo.cpp): `Sources/Wrappers/Wasm/OpenScofo.cpp`
- [Python API](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Python/OpenScofo/__init__.py): `Sources/Wrappers/Python/OpenScofo/__init__.py`

### Score Language Tools

- [Online Score Editor](https://github.com/charlesneimog/openscofo/blob/main/Resources/Score-Editor/src/core/OpenScofoOnlineEditor.js): `Resources/Score-Editor/src/core/OpenScofoOnlineEditor.js`
- [Score Import / Export](https://github.com/charlesneimog/openscofo/blob/main/Resources/Score-Editor/src/services/score-service.js): `Resources/Score-Editor/src/services/score-service.js`
- [Editor Parser Integration](https://github.com/charlesneimog/openscofo/blob/main/Resources/Score-Editor/src/parser/parser-integration.js): `Resources/Score-Editor/src/parser/parser-integration.js`
- [Tree-sitter Parser](https://github.com/charlesneimog/openscofo/blob/main/Sources/Language/src/parser.c): `Sources/Language/src/parser.c`

### Model Training

- [Web Training UI](https://github.com/charlesneimog/openscofo/blob/main/Resources/WebTrainer/app.py): `Resources/WebTrainer/app.py`
- [Classifier Trainer](https://github.com/charlesneimog/openscofo/blob/main/Sources/Wrappers/Python/OpenScofo/train.py): `Sources/Wrappers/Python/OpenScofo/train.py`

### Other components

- **Musician / App**

## Connections

- Musician / App → Audio Blocks: provides audio
- Musician / App → Score State: provides score
- Audio Blocks → Score Follower: processes blocks
- Score State → Score Follower: follows score
- Score Follower → Forward Algorithm: uses algorithm
- Score Follower → Audio Features: analyzes pitch
- Score Follower → Technique Inference: uses inference
- Score Follower → Lua Scripting: supports scripting
- Score Follower → Following Description: returns state
- Pure Data Object → Score Follower: wraps library
- Max Object → Score Follower: wraps library
- Python Package → Score Follower: wraps library
- Csound Plugin → Score Follower: wraps library
- SuperCollider Plugin → Score Follower: wraps library
- Vamp Plugin → Score Follower: wraps library
- WebAssembly Interface → Score Follower: wraps library
- Online Score Editor → Editor Parser Integration: initializes parser (evidence: `Resources/Score-Editor/src/core/OpenScofoOnlineEditor.js`)
- Online Score Editor → Score Import / Export: delegates score I/O (evidence: `Resources/Score-Editor/src/core/OpenScofoOnlineEditor.js`)
- Editor Parser Integration → Tree-sitter Parser: parses score (evidence: `Resources/Score-Editor/src/parser/parser-integration.js`)
- Web Training UI → Classifier Trainer: configures training (evidence: `Resources/WebTrainer/app.py`)
- Python API → Classifier Trainer: loads trainer (evidence: `Sources/Wrappers/Python/OpenScofo/__init__.py`)
- Musician / App → Web Training UI: uploads recordings (evidence: `Resources/WebTrainer/app.py`)
