# rodrichgk/bina architecture

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

- Interactive diagram: https://gitdiagram.com/rodrichgk/bina
- Repository: https://github.com/rodrichgk/bina

## Overview

Bina is a Qt desktop DAW: users arrange audio and note clips on tracks, edit notes in the piano roll, configure track sound, and play or save projects. The graph follows the documented project-model-centered design and highlights import, arrangement, editing, rendering, and persistence. Some subsystem links rely on README statements because their implementations were not sampled; unsampled details are not inferred.

Main entry points: [`src/mainwindow.cpp`](https://github.com/rodrichgk/bina/blob/master/src/mainwindow.cpp) (Main window), [`src/audio/instruments/instrumentapi.cpp`](https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/instrumentapi.cpp) (Instrument registry), [`src/core/projectmodel.cpp`](https://github.com/rodrichgk/bina/blob/master/src/core/projectmodel.cpp) (Project model), [`src/timeline/timelinewidget.cpp`](https://github.com/rodrichgk/bina/blob/master/src/timeline/timelinewidget.cpp) (Timeline arrangement)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Studio interface"]
  node_main["Main window<br/>[mainwindow.cpp]"]
  node_transport["Transport controls<br/>[transportdock.cpp]"]
end

subgraph group_project["Project editing"]
  node_timeline["Timeline arrangement<br/>[timelinewidget.cpp]"]
  node_clip["Clip regions<br/>[clipregion.cpp]"]
  node_tracksettings["Track settings"]
  node_pianoroll["Piano roll<br/>[pianoroll.cpp]"]
  node_model["Project model<br/>[projectmodel.cpp]"]
  node_projectfile["Project files<br/>[projectfile.cpp]"]
end

subgraph group_audio["Audio runtime"]
  node_decoder["Audio decoder<br/>[audiodecoder.cpp]"]
  node_audioengine["Audio engine<br/>[audioengine.cpp]"]
  node_output["Audio output device<br/>[audioiodevice.cpp]"]
end

subgraph group_sound["Sound processing"]
  node_effects["Track effects<br/>[effects.cpp]"]
  node_registry["Instrument registry<br/>[instrumentapi.cpp]"]
  node_synth["Synth<br/>[synth.cpp]"]
  node_sampler["Sampler<br/>[sampler.cpp]"]
  node_drumkit["Drum kit<br/>[drumkit.cpp]"]
  node_fmsynth["FM synth<br/>[fmsynth.cpp]"]
  node_pluck["Plucked strings<br/>[pluck.cpp]"]
end

subgraph group_support["Shared presentation"]
  node_theme["Theme and motion<br/>[theme.cpp]"]
end

node_user(("Studio user"))
node_ffmpeg["FFmpeg"]

node_user -->|"uses"| node_main
node_main -->|"opens"| node_timeline
node_main -->|"creates"| node_transport
node_main -->|"owns"| node_model
node_timeline -->|"edits"| node_model
node_timeline -->|"renders"| node_clip
node_timeline -->|"opens"| node_tracksettings
node_tracksettings -->|"updates"| node_model
node_main -->|"opens"| node_pianoroll
node_pianoroll -->|"edits notes"| node_model
node_main -->|"saves and opens"| node_projectfile
node_projectfile -->|"serializes"| node_model
node_main -->|"imports audio"| node_decoder
node_timeline -->|"accepts drops"| node_decoder
node_decoder -->|"decodes with"| node_ffmpeg
node_transport -->|"controls playback"| node_audioengine
node_audioengine -->|"renders snapshot"| node_model
node_audioengine -->|"processes bus"| node_effects
node_audioengine -->|"creates instruments"| node_registry
node_audioengine -->|"feeds output"| node_output
node_registry -.->|"registers"| node_synth
node_registry -.->|"registers"| node_sampler
node_registry -.->|"registers"| node_drumkit
node_registry -.->|"registers"| node_fmsynth
node_registry -.->|"registers"| node_pluck
node_main -->|"applies styling"| node_theme

click node_main "https://github.com/rodrichgk/bina/blob/master/src/mainwindow.cpp"
click node_timeline "https://github.com/rodrichgk/bina/blob/master/src/timeline/timelinewidget.cpp"
click node_clip "https://github.com/rodrichgk/bina/blob/master/src/timeline/clipregion.cpp"
click node_tracksettings "https://github.com/rodrichgk/bina/blob/master/src/timeline/tracksettingsdialog.cpp"
click node_pianoroll "https://github.com/rodrichgk/bina/blob/master/src/pianoroll/pianoroll.cpp"
click node_model "https://github.com/rodrichgk/bina/blob/master/src/core/projectmodel.cpp"
click node_projectfile "https://github.com/rodrichgk/bina/blob/master/src/core/projectfile.cpp"
click node_transport "https://github.com/rodrichgk/bina/blob/master/src/transportdock.cpp"
click node_decoder "https://github.com/rodrichgk/bina/blob/master/src/audio/audiodecoder.cpp"
click node_audioengine "https://github.com/rodrichgk/bina/blob/master/src/audio/audioengine.cpp"
click node_output "https://github.com/rodrichgk/bina/blob/master/src/audio/audioiodevice.cpp"
click node_effects "https://github.com/rodrichgk/bina/blob/master/src/audio/effects.cpp"
click node_registry "https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/instrumentapi.cpp"
click node_synth "https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/synth.cpp"
click node_sampler "https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/sampler.cpp"
click node_drumkit "https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/drumkit.cpp"
click node_fmsynth "https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/fmsynth.cpp"
click node_pluck "https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/pluck.cpp"
click node_theme "https://github.com/rodrichgk/bina/blob/master/src/theme.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_main,node_transport,node_user toneBlue
class node_timeline,node_clip,node_tracksettings,node_pianoroll,node_model,node_projectfile toneAmber
class node_decoder,node_audioengine,node_output toneMint
class node_effects,node_registry,node_synth,node_sampler,node_drumkit,node_fmsynth,node_pluck toneRose
class node_theme,node_ffmpeg toneIndigo
```

## Components

### Studio interface

- [Main window](https://github.com/rodrichgk/bina/blob/master/src/mainwindow.cpp): `src/mainwindow.cpp`
- [Transport controls](https://github.com/rodrichgk/bina/blob/master/src/transportdock.cpp): `src/transportdock.cpp`

### Project editing

- [Timeline arrangement](https://github.com/rodrichgk/bina/blob/master/src/timeline/timelinewidget.cpp): `src/timeline/timelinewidget.cpp`
- [Clip regions](https://github.com/rodrichgk/bina/blob/master/src/timeline/clipregion.cpp): `src/timeline/clipregion.cpp`
- [Track settings](https://github.com/rodrichgk/bina/blob/master/src/timeline/tracksettingsdialog.cpp): `src/timeline/tracksettingsdialog.cpp`
- [Piano roll](https://github.com/rodrichgk/bina/blob/master/src/pianoroll/pianoroll.cpp): `src/pianoroll/pianoroll.cpp`
- [Project model](https://github.com/rodrichgk/bina/blob/master/src/core/projectmodel.cpp): `src/core/projectmodel.cpp`
- [Project files](https://github.com/rodrichgk/bina/blob/master/src/core/projectfile.cpp): `src/core/projectfile.cpp`

### Audio runtime

- [Audio decoder](https://github.com/rodrichgk/bina/blob/master/src/audio/audiodecoder.cpp): `src/audio/audiodecoder.cpp`
- [Audio engine](https://github.com/rodrichgk/bina/blob/master/src/audio/audioengine.cpp): `src/audio/audioengine.cpp`
- [Audio output device](https://github.com/rodrichgk/bina/blob/master/src/audio/audioiodevice.cpp): `src/audio/audioiodevice.cpp`

### Sound processing

- [Track effects](https://github.com/rodrichgk/bina/blob/master/src/audio/effects.cpp): `src/audio/effects.cpp`
- [Instrument registry](https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/instrumentapi.cpp): `src/audio/instruments/instrumentapi.cpp`
- [Synth](https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/synth.cpp): `src/audio/instruments/synth.cpp`
- [Sampler](https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/sampler.cpp): `src/audio/instruments/sampler.cpp`
- [Drum kit](https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/drumkit.cpp): `src/audio/instruments/drumkit.cpp`
- [FM synth](https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/fmsynth.cpp): `src/audio/instruments/fmsynth.cpp`
- [Plucked strings](https://github.com/rodrichgk/bina/blob/master/src/audio/instruments/pluck.cpp): `src/audio/instruments/pluck.cpp`

### Shared presentation

- [Theme and motion](https://github.com/rodrichgk/bina/blob/master/src/theme.cpp): `src/theme.cpp`

### Other components

- **Studio user**
- **FFmpeg**

## Connections

- Studio user → Main window: uses (evidence: `README.md`)
- Main window → Timeline arrangement: opens (evidence: `src/mainwindow.cpp`)
- Main window → Transport controls: creates (evidence: `src/mainwindow.cpp`)
- Main window → Project model: owns (evidence: `src/mainwindow.cpp`)
- Timeline arrangement → Project model: edits (evidence: `src/timeline/timelinewidget.cpp`)
- Timeline arrangement → Clip regions: renders
- Timeline arrangement → Track settings: opens (evidence: `src/timeline/timelinewidget.cpp`)
- Track settings → Project model: updates (evidence: `src/timeline/tracksettingsdialog.cpp`)
- Main window → Piano roll: opens (evidence: `src/mainwindow.cpp`)
- Piano roll → Project model: edits notes (evidence: `README.md`)
- Main window → Project files: saves and opens (evidence: `src/mainwindow.cpp`)
- Project files → Project model: serializes (evidence: `README.md`)
- Main window → Audio decoder: imports audio (evidence: `src/mainwindow.cpp`)
- Timeline arrangement → Audio decoder: accepts drops (evidence: `src/timeline/timelinewidget.cpp`)
- Audio decoder → FFmpeg: decodes with (evidence: `README.md`)
- Transport controls → Audio engine: controls playback (evidence: `README.md`)
- Audio engine → Project model: renders snapshot (evidence: `README.md`)
- Audio engine → Track effects: processes bus (evidence: `src/audio/audioengine.cpp`)
- Audio engine → Instrument registry: creates instruments (evidence: `src/audio/audioengine.cpp`)
- Audio engine → Audio output device: feeds output (evidence: `src/audio/audioengine.cpp`)
- Instrument registry → Synth: registers (evidence: `README.md`)
- Instrument registry → Sampler: registers (evidence: `README.md`)
- Instrument registry → Drum kit: registers (evidence: `src/audio/instruments/drumkit.cpp`)
- Instrument registry → FM synth: registers (evidence: `README.md`)
- Instrument registry → Plucked strings: registers (evidence: `src/audio/instruments/pluck.cpp`)
- Main window → Theme and motion: applies styling
