# jeanpruski/audio-follower architecture

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

- Interactive diagram: https://gitdiagram.com/jeanpruski/audio-follower
- Repository: https://github.com/jeanpruski/audio-follower

## Overview

Audio Follower est une application locale de suivi rythmique : le musicien fournit le tempo maître via un microphone, et le moteur ajuste la lecture d’une piste source pour la suivre. Le parcours principal va de l’analyse et du choix du BPM source, aux attaques live, à l’estimation/lissage du tempo, puis au contrôle du ratio et au time-stretch audio. L’interface web orchestre aussi l’analyse, les commandes live et la simulation. Les liens reflètent les appels visibles dans les extraits ou les relations documentées ; les connexions internes des composants non échantillonnés ne sont pas supposées.

Main entry points: [`audio_follower/audio/live_engine.py`](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/audio/live_engine.py) (Moteur live), [`audio_follower/ui/server.py`](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/ui/server.py) (Serveur HTTP), [`audio_follower/simulate.py`](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/simulate.py) (CLI simulation), [`audio_follower/analysis/tempo_estimator.py`](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/tempo_estimator.py) (Estimation tempo)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Interface locale"]
  node_ui["Serveur HTTP<br/>[server.py]"]
  node_frontend["Interface web<br/>[app.js]"]
end

subgraph group_source["Analyse source"]
  node_analyzer["Analyse source<br/>[source_analyzer.py]"]
  node_source_model["Métadonnées source<br/>[source_info.py]"]
  node_tempo_resolver["Résolution BPM"]
  node_source_candidates["Candidats tempo"]
end

subgraph group_live["Suivi live"]
  node_onset["Détection d’attaques<br/>[onset_detector.py]"]
  node_estimator["Estimation tempo<br/>[tempo_estimator.py]"]
  node_tempo_model["État tempo<br/>[tempo_state.py]"]
  node_phase_tracker["Suivi de phase<br/>[phase_tracker.py]"]
  node_engine["Moteur live<br/>[live_engine.py]"]
end

subgraph group_control["Synchronisation et audio"]
  node_smoother["Lissage tempo<br/>[tempo_smoother.py]"]
  node_follower["Follower tempo<br/>[tempo_follower.py]"]
  node_pll["PLL phase<br/>[pll.py]"]
  node_limiter["Limiteur ratio<br/>[rate_limiter.py]"]
  node_stretcher["Time-stretch<br/>[granular_engine.py]"]
end

subgraph group_simulation["Simulation"]
  node_sim_cli["CLI simulation<br/>[simulate.py]"]
  node_beat_gen["Générateur de beats<br/>[beat_generator.py]"]
  node_rhythm_gen["Générateur de motifs"]
end

node_musician(("Musicien"))
node_browser(("Navigateur local"))
node_audio_devices["Entrée et sortie audio"]

node_browser -->|"utilise"| node_frontend
node_frontend -->|"envoie requêtes"| node_ui
node_ui -->|"analyse piste"| node_analyzer
node_analyzer -->|"produit métadonnées"| node_source_model
node_ui -->|"résout BPM"| node_tempo_resolver
node_ui -->|"charge piste"| node_engine
node_ui -->|"lance simulation"| node_sim_cli
node_musician -->|"joue au micro"| node_audio_devices
node_audio_devices -.->|"fournit audio"| node_engine
node_engine -->|"détecte attaques"| node_onset
node_engine -->|"ajoute événements"| node_estimator
node_estimator -->|"calcule hypothèses"| node_source_candidates
node_estimator -->|"retourne estimation"| node_tempo_model
node_engine -->|"lisse tempo"| node_smoother
node_engine -->|"calcule ratio tempo"| node_follower
node_engine -->|"suit phase"| node_phase_tracker
node_engine -->|"corrige phase"| node_pll
node_follower -->|"limite variation"| node_limiter
node_engine -->|"rend ratio"| node_stretcher
node_stretcher -.->|"sort audio"| node_audio_devices
node_sim_cli -->|"génère événements"| node_beat_gen
node_sim_cli -->|"estime tempo"| node_estimator
node_sim_cli -->|"lisse tempo"| node_smoother
node_sim_cli -->|"calcule ratio"| node_follower
node_rhythm_gen -->|"utilise beats"| node_beat_gen

click node_ui "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/ui/server.py"
click node_frontend "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/ui/static/app.js"
click node_analyzer "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/source_analyzer.py"
click node_source_model "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/models/source_info.py"
click node_tempo_resolver "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/source_tempo_resolver.py"
click node_source_candidates "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/tempo_candidates.py"
click node_onset "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/onset_detector.py"
click node_estimator "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/tempo_estimator.py"
click node_tempo_model "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/models/tempo_state.py"
click node_phase_tracker "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/phase_tracker.py"
click node_engine "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/audio/live_engine.py"
click node_smoother "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/sync/tempo_smoother.py"
click node_follower "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/sync/tempo_follower.py"
click node_pll "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/sync/pll.py"
click node_limiter "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/sync/rate_limiter.py"
click node_stretcher "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/stretch/granular_engine.py"
click node_sim_cli "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/simulate.py"
click node_beat_gen "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/simulation/beat_generator.py"
click node_rhythm_gen "https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/simulation/rhythm_generator.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_ui,node_frontend toneBlue
class node_analyzer,node_source_model,node_tempo_resolver,node_source_candidates toneAmber
class node_onset,node_estimator,node_tempo_model,node_phase_tracker,node_engine toneMint
class node_smoother,node_follower,node_pll,node_limiter,node_stretcher toneRose
class node_sim_cli,node_beat_gen,node_rhythm_gen,node_musician,node_browser,node_audio_devices toneIndigo
```

## Components

### Interface locale

- [Serveur HTTP](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/ui/server.py): `audio_follower/ui/server.py`
- [Interface web](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/ui/static/app.js): `audio_follower/ui/static/app.js`

### Analyse source

- [Analyse source](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/source_analyzer.py): `audio_follower/analysis/source_analyzer.py`
- [Métadonnées source](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/models/source_info.py): `audio_follower/models/source_info.py`
- [Résolution BPM](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/source_tempo_resolver.py): `audio_follower/analysis/source_tempo_resolver.py`
- [Candidats tempo](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/tempo_candidates.py): `audio_follower/analysis/tempo_candidates.py`

### Suivi live

- [Détection d’attaques](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/onset_detector.py): `audio_follower/analysis/onset_detector.py`
- [Estimation tempo](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/tempo_estimator.py): `audio_follower/analysis/tempo_estimator.py`
- [État tempo](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/models/tempo_state.py): `audio_follower/models/tempo_state.py`
- [Suivi de phase](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/analysis/phase_tracker.py): `audio_follower/analysis/phase_tracker.py`
- [Moteur live](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/audio/live_engine.py): `audio_follower/audio/live_engine.py`

### Synchronisation et audio

- [Lissage tempo](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/sync/tempo_smoother.py): `audio_follower/sync/tempo_smoother.py`
- [Follower tempo](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/sync/tempo_follower.py): `audio_follower/sync/tempo_follower.py`
- [PLL phase](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/sync/pll.py): `audio_follower/sync/pll.py`
- [Limiteur ratio](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/sync/rate_limiter.py): `audio_follower/sync/rate_limiter.py`
- [Time-stretch](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/stretch/granular_engine.py): `audio_follower/stretch/granular_engine.py`

### Simulation

- [CLI simulation](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/simulate.py): `audio_follower/simulate.py`
- [Générateur de beats](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/simulation/beat_generator.py): `audio_follower/simulation/beat_generator.py`
- [Générateur de motifs](https://github.com/jeanpruski/audio-follower/blob/master/audio_follower/simulation/rhythm_generator.py): `audio_follower/simulation/rhythm_generator.py`

### Other components

- **Musicien**
- **Navigateur local**
- **Entrée et sortie audio**

## Connections

- Navigateur local → Interface web: utilise (evidence: `README.md`)
- Interface web → Serveur HTTP: envoie requêtes (evidence: `README.md`)
- Serveur HTTP → Analyse source: analyse piste (evidence: `audio_follower/ui/server.py`)
- Analyse source → Métadonnées source: produit métadonnées (evidence: `audio_follower/analysis/source_analyzer.py`)
- Serveur HTTP → Résolution BPM: résout BPM (evidence: `audio_follower/ui/server.py`)
- Serveur HTTP → Moteur live: charge piste (evidence: `audio_follower/ui/server.py`)
- Serveur HTTP → CLI simulation: lance simulation (evidence: `audio_follower/ui/server.py`)
- Musicien → Entrée et sortie audio: joue au micro (evidence: `README.md`)
- Entrée et sortie audio → Moteur live: fournit audio
- Moteur live → Détection d’attaques: détecte attaques (evidence: `audio_follower/audio/live_engine.py`)
- Moteur live → Estimation tempo: ajoute événements (evidence: `audio_follower/audio/live_engine.py`)
- Estimation tempo → Candidats tempo: calcule hypothèses (evidence: `audio_follower/analysis/tempo_estimator.py`)
- Estimation tempo → État tempo: retourne estimation (evidence: `audio_follower/analysis/tempo_estimator.py`)
- Moteur live → Lissage tempo: lisse tempo (evidence: `audio_follower/audio/live_engine.py`)
- Moteur live → Follower tempo: calcule ratio tempo (evidence: `audio_follower/audio/live_engine.py`)
- Moteur live → Suivi de phase: suit phase (evidence: `audio_follower/audio/live_engine.py`)
- Moteur live → PLL phase: corrige phase (evidence: `audio_follower/audio/live_engine.py`)
- Follower tempo → Limiteur ratio: limite variation (evidence: `audio_follower/sync/tempo_follower.py`)
- Moteur live → Time-stretch: rend ratio (evidence: `audio_follower/audio/live_engine.py`)
- Time-stretch → Entrée et sortie audio: sort audio
- CLI simulation → Générateur de beats: génère événements (evidence: `audio_follower/simulate.py`)
- CLI simulation → Estimation tempo: estime tempo (evidence: `audio_follower/simulate.py`)
- CLI simulation → Lissage tempo: lisse tempo (evidence: `audio_follower/simulate.py`)
- CLI simulation → Follower tempo: calcule ratio (evidence: `audio_follower/simulate.py`)
- Générateur de motifs → Générateur de beats: utilise beats (evidence: `audio_follower/simulation/rhythm_generator.py`)
