# nyanneaw/teto-relay architecture

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

- Interactive diagram: https://gitdiagram.com/nyanneaw/teto-relay
- Repository: https://github.com/nyanneaw/teto-relay

## Overview

Teto Relay is a live speech-to-singing voice changer with a control panel, song-making Studio, tuning tools, and a community Market. The main workflow captures a held-to-talk phrase, transcribes and pitch-tracks it, turns words and melody into an OpenUtau project, renders audio, and plays it to a selected output. Studio extends this with recorded takes and editing; Tune and Market provide separate customization and sharing capabilities. Some subsystem links are based on README descriptions or the SOURCE INDEX because their implementation excerpts were not supplied.

Main entry points: [`teto_relay/app.py`](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/app.py) (Live pipeline), [`teto_relay/webui.py`](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/webui.py) (Studio panel), [`teto_relay/notes.py`](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/notes.py) (Note generation), [`teto_relay/ustx.py`](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/ustx.py) (OpenUtau project)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_live["Live singing"]
  node_capture["Audio capture<br/>[capture.py]"]
  node_orchestrator["Live pipeline<br/>[app.py]"]
  node_transcription["Speech recognition<br/>[stt.py]"]
  node_pitch["Pitch tracking<br/>[pitch.py]"]
  node_notes["Note generation<br/>[notes.py]"]
end

subgraph group_synthesis["Synthesis"]
  node_language["Language conversion<br/>[translit.py]"]
  node_voicebank["Voicebanks<br/>[voicebank.py]"]
  node_project["OpenUtau project<br/>[ustx.py]"]
  node_renderer["OpenUtau renderer<br/>[openutau.py]"]
  node_playback["Audio playback<br/>[playback.py]"]
  node_devices["Audio devices<br/>[devices.py]"]
end

subgraph group_studio["Studio"]
  node_studio["Studio panel<br/>[webui.py]"]
  node_takes["Take recording<br/>[takes.py]"]
  node_music["Backing tracks<br/>[music.py]"]
  node_library[("Project library<br/>[library.py]")]
end

subgraph group_custom["Tune and setup"]
  node_tuning[("Tuning presets<br/>[presets.py]")]
  node_effects["Voice effects<br/>[effects.py]"]
  node_config["Configuration<br/>[config.py]"]
end

subgraph group_market["Market"]
  node_marketui["Market panel<br/>[market.py]"]
  node_marketapi["Market service<br/>[worker.js]"]
  node_accounts[("Market accounts<br/>[accounts.js]")]
end

node_singer(("Speaker"))
node_marketuser(("Market user"))
node_output(("Audio output"))

node_singer -->|"speaks into"| node_capture
node_capture -->|"feeds audio"| node_orchestrator
node_orchestrator -->|"transcribes"| node_transcription
node_orchestrator -->|"tracks pitch"| node_pitch
node_orchestrator -->|"builds notes"| node_notes
node_transcription -->|"timed words"| node_notes
node_notes -->|"uses contour"| node_pitch
node_notes -->|"converts lyrics"| node_language
node_notes -->|"writes notes"| node_project
node_voicebank -->|"supplies singer"| node_project
node_project -->|"renders project"| node_renderer
node_renderer -->|"returns audio"| node_playback
node_playback -->|"selects output"| node_devices
node_playback -->|"plays audio"| node_output
node_studio -->|"records takes"| node_takes
node_studio -->|"manages tracks"| node_music
node_studio -->|"manages projects"| node_library
node_studio -.->|"starts singing"| node_orchestrator
node_studio -.->|"edits project"| node_project
node_tuning -.->|"saves settings"| node_config
node_effects -.->|"shapes sound"| node_orchestrator
node_marketuser -->|"browses and shares"| node_marketui
node_marketui -.->|"requests listings"| node_marketapi
node_marketapi -->|"uses accounts"| node_accounts

click node_capture "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/capture.py"
click node_orchestrator "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/app.py"
click node_transcription "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/stt.py"
click node_pitch "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/pitch.py"
click node_notes "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/notes.py"
click node_language "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/translit.py"
click node_voicebank "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/voicebank.py"
click node_project "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/ustx.py"
click node_renderer "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/render/openutau.py"
click node_playback "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/playback.py"
click node_devices "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/devices.py"
click node_studio "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/webui.py"
click node_takes "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/takes.py"
click node_music "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/music.py"
click node_library "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/library.py"
click node_tuning "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/presets.py"
click node_effects "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/effects.py"
click node_config "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/config.py"
click node_marketui "https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/market.py"
click node_marketapi "https://github.com/nyanneaw/teto-relay/blob/main/market-server/src/worker.js"
click node_accounts "https://github.com/nyanneaw/teto-relay/blob/main/market-server/src/accounts.js"

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_capture,node_orchestrator,node_transcription,node_pitch,node_notes,node_marketuser toneBlue
class node_language,node_voicebank,node_project,node_renderer,node_playback,node_devices toneAmber
class node_studio,node_takes,node_music,node_library toneMint
class node_tuning,node_effects,node_config toneRose
class node_marketui,node_marketapi,node_accounts,node_singer,node_output toneIndigo
```

## Components

### Live singing

- [Audio capture](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/capture.py): `teto_relay/capture.py`
- [Live pipeline](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/app.py): `teto_relay/app.py`
- [Speech recognition](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/stt.py): `teto_relay/stt.py`
- [Pitch tracking](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/pitch.py): `teto_relay/pitch.py`
- [Note generation](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/notes.py): `teto_relay/notes.py`

### Synthesis

- [Language conversion](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/translit.py): `teto_relay/translit.py`
- [Voicebanks](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/voicebank.py): `teto_relay/voicebank.py`
- [OpenUtau project](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/ustx.py): `teto_relay/ustx.py`
- [OpenUtau renderer](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/render/openutau.py): `teto_relay/render/openutau.py`
- [Audio playback](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/playback.py): `teto_relay/playback.py`
- [Audio devices](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/devices.py): `teto_relay/devices.py`

### Studio

- [Studio panel](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/webui.py): `teto_relay/webui.py`
- [Take recording](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/takes.py): `teto_relay/takes.py`
- [Backing tracks](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/music.py): `teto_relay/music.py`
- [Project library](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/library.py): `teto_relay/library.py`

### Tune and setup

- [Tuning presets](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/presets.py): `teto_relay/presets.py`
- [Voice effects](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/effects.py): `teto_relay/effects.py`
- [Configuration](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/config.py): `teto_relay/config.py`

### Market

- [Market panel](https://github.com/nyanneaw/teto-relay/blob/main/teto_relay/market.py): `teto_relay/market.py`
- [Market service](https://github.com/nyanneaw/teto-relay/blob/main/market-server/src/worker.js): `market-server/src/worker.js`
- [Market accounts](https://github.com/nyanneaw/teto-relay/blob/main/market-server/src/accounts.js): `market-server/src/accounts.js`

### Other components

- **Speaker**
- **Market user**
- **Audio output**

## Connections

- Speaker → Audio capture: speaks into
- Audio capture → Live pipeline: feeds audio (evidence: `teto_relay/app.py`)
- Live pipeline → Speech recognition: transcribes (evidence: `teto_relay/app.py`)
- Live pipeline → Pitch tracking: tracks pitch (evidence: `teto_relay/app.py`)
- Live pipeline → Note generation: builds notes (evidence: `teto_relay/app.py`)
- Speech recognition → Note generation: timed words (evidence: `teto_relay/notes.py`)
- Note generation → Pitch tracking: uses contour (evidence: `teto_relay/notes.py`)
- Note generation → Language conversion: converts lyrics (evidence: `teto_relay/notes.py`)
- Note generation → OpenUtau project: writes notes (evidence: `teto_relay/ustx.py`)
- Voicebanks → OpenUtau project: supplies singer (evidence: `teto_relay/ustx.py`)
- OpenUtau project → OpenUtau renderer: renders project (evidence: `teto_relay/render/openutau.py`)
- OpenUtau renderer → Audio playback: returns audio
- Audio playback → Audio devices: selects output (evidence: `teto_relay/playback.py`)
- Audio playback → Audio output: plays audio
- Studio panel → Take recording: records takes (evidence: `teto_relay/webui.py`)
- Studio panel → Backing tracks: manages tracks (evidence: `teto_relay/webui.py`)
- Studio panel → Project library: manages projects (evidence: `teto_relay/webui.py`)
- Studio panel → Live pipeline: starts singing (evidence: `teto_relay/webui.py`)
- Studio panel → OpenUtau project: edits project
- Tuning presets → Configuration: saves settings (evidence: `teto_relay/presets.py`)
- Voice effects → Live pipeline: shapes sound (evidence: `teto_relay/app.py`)
- Market user → Market panel: browses and shares
- Market panel → Market service: requests listings
- Market service → Market accounts: uses accounts (evidence: `market-server/src/worker.js`)
