# c22516126/fyp architecture

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

- Interactive diagram: https://gitdiagram.com/c22516126/fyp
- Repository: https://github.com/c22516126/fyp

## Overview

This repository is a music-transcription project: audio is submitted through a web interface or CLI, processed into note events, and written as MIDI. Its main runtime separates model inference, window stitching, note extraction, and MIDI generation. A CQT experiment provides an alternate model path. Evaluation scripts measure transcription against paired audio/MIDI data and explore parameter settings. The README documents starting the backend and frontend, but the server and upload excerpts do not show their HTTP contract; those links are therefore marked unverified. Evaluation relationships are based on the shown excerpts and source index.

Main entry points: [`Code/src/transcribe.py`](https://github.com/c22516126/fyp/blob/main/Code/src/transcribe.py) (Transcriber), [`Code/src/cqtExperiment.py`](https://github.com/c22516126/fyp/blob/main/Code/src/cqtExperiment.py) (CQT transcriber), [`Code/evaluation/gridSearch.py`](https://github.com/c22516126/fyp/blob/main/Code/evaluation/gridSearch.py) (Parameter search), [`Code/evaluation/eval.py`](https://github.com/c22516126/fyp/blob/main/Code/evaluation/eval.py) (Transcription evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_app["App shell<br/>[App.jsx]"]
  node_body["Transcription view<br/>[Body.jsx]"]
  node_upload["Audio upload<br/>[Upload.jsx]"]
  node_player["MIDI player<br/>[MidiPlayer.jsx]"]
  node_server["Backend server<br/>[server.py]"]
end

subgraph group_transcription["Transcription runtime"]
  node_cli["CLI adapter<br/>[CLI.py]"]
  node_transcriber["Transcriber<br/>[transcribe.py]"]
  node_config["Runtime config<br/>[config.py]"]
  node_model["Model loader<br/>[loadModel.py]"]
  node_inference["Window inference<br/>[inference.py]"]
  node_stitch["Window stitching<br/>[stitch.py]"]
  node_notes["Note extraction<br/>[noteCreation.py]"]
  node_midi["MIDI generation<br/>[generateMIDI.py]"]
end

subgraph group_experiments["Model experiments"]
  node_cqt["CQT transcriber<br/>[cqtExperiment.py]"]
  node_model2["Model architecture<br/>[model2.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_dataset["Evaluation dataset<br/>[getMidiData.py]"]
  node_eval["Transcription evaluation<br/>[eval.py]"]
  node_grid["Parameter search<br/>[gridSearch.py]"]
  node_experiment["Pipeline experiment<br/>[experimentVer1.py]"]
  node_plots["Evaluation plots<br/>[plot.py]"]
end

node_user(("User"))
node_midi_result["MIDI file"]

node_user -->|"uses"| node_app
node_app -->|"renders"| node_body
node_body -->|"renders"| node_upload
node_body -->|"renders"| node_player
node_user -.->|"selects audio"| node_upload
node_upload -.->|"submits audio"| node_server
node_server -->|"invokes"| node_transcriber
node_cli -->|"delegates"| node_transcriber
node_transcriber -->|"reads settings"| node_config
node_transcriber -->|"loads model"| node_model
node_transcriber -->|"runs inference"| node_inference
node_transcriber -->|"stitches windows"| node_stitch
node_transcriber -->|"extracts notes"| node_notes
node_transcriber -->|"writes notes"| node_midi
node_midi -->|"writes MIDI"| node_midi_result
node_player -.->|"plays file"| node_midi_result
node_cqt -->|"builds model"| node_model2
node_cqt -->|"reads settings"| node_config
node_cqt -->|"stitches windows"| node_stitch
node_cqt -->|"extracts notes"| node_notes
node_cqt -->|"writes MIDI"| node_midi
node_eval -->|"loads references"| node_dataset
node_eval -->|"runs inference"| node_transcriber
node_eval -->|"converts predictions"| node_notes
node_eval -->|"plots metrics"| node_plots
node_grid -->|"builds dataset"| node_dataset
node_grid -->|"runs inference"| node_transcriber
node_grid -->|"converts predictions"| node_notes
node_grid -->|"scores results"| node_eval
node_grid -->|"plots search"| node_plots
node_experiment -->|"creates notes"| node_notes
node_experiment -->|"generates MIDI"| node_midi
node_experiment -->|"stitches output"| node_stitch
node_experiment -->|"reads settings"| node_config

click node_app "https://github.com/c22516126/fyp/blob/main/Code/frontend/src/App.jsx"
click node_body "https://github.com/c22516126/fyp/blob/main/Code/frontend/src/Body.jsx"
click node_upload "https://github.com/c22516126/fyp/blob/main/Code/frontend/src/Upload.jsx"
click node_player "https://github.com/c22516126/fyp/blob/main/Code/frontend/src/MidiPlayer.jsx"
click node_server "https://github.com/c22516126/fyp/blob/main/Code/backend/server.py"
click node_cli "https://github.com/c22516126/fyp/blob/main/Code/src/CLI/CLI.py"
click node_transcriber "https://github.com/c22516126/fyp/blob/main/Code/src/transcribe.py"
click node_config "https://github.com/c22516126/fyp/blob/main/Code/src/config.py"
click node_model "https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/loadModel.py"
click node_inference "https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/inference.py"
click node_stitch "https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/stitch.py"
click node_notes "https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/noteCreation.py"
click node_midi "https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/generateMIDI.py"
click node_cqt "https://github.com/c22516126/fyp/blob/main/Code/src/cqtExperiment.py"
click node_model2 "https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/model2.py"
click node_dataset "https://github.com/c22516126/fyp/blob/main/Code/evaluation/getMidiData.py"
click node_eval "https://github.com/c22516126/fyp/blob/main/Code/evaluation/eval.py"
click node_grid "https://github.com/c22516126/fyp/blob/main/Code/evaluation/gridSearch.py"
click node_experiment "https://github.com/c22516126/fyp/blob/main/Code/evaluation/experimentVer1.py"
click node_plots "https://github.com/c22516126/fyp/blob/main/Code/evaluation/plot.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_app,node_body,node_upload,node_player,node_server,node_user toneBlue
class node_cli,node_transcriber,node_config,node_model,node_inference,node_stitch,node_notes,node_midi toneAmber
class node_cqt,node_model2 toneMint
class node_dataset,node_eval,node_grid,node_experiment,node_plots toneRose
class node_midi_result toneIndigo
```

## Components

### Web interface

- [App shell](https://github.com/c22516126/fyp/blob/main/Code/frontend/src/App.jsx): `Code/frontend/src/App.jsx`
- [Transcription view](https://github.com/c22516126/fyp/blob/main/Code/frontend/src/Body.jsx): `Code/frontend/src/Body.jsx`
- [Audio upload](https://github.com/c22516126/fyp/blob/main/Code/frontend/src/Upload.jsx): `Code/frontend/src/Upload.jsx`
- [MIDI player](https://github.com/c22516126/fyp/blob/main/Code/frontend/src/MidiPlayer.jsx): `Code/frontend/src/MidiPlayer.jsx`
- [Backend server](https://github.com/c22516126/fyp/blob/main/Code/backend/server.py): `Code/backend/server.py`

### Transcription runtime

- [CLI adapter](https://github.com/c22516126/fyp/blob/main/Code/src/CLI/CLI.py): `Code/src/CLI/CLI.py`
- [Transcriber](https://github.com/c22516126/fyp/blob/main/Code/src/transcribe.py): `Code/src/transcribe.py`
- [Runtime config](https://github.com/c22516126/fyp/blob/main/Code/src/config.py): `Code/src/config.py`
- [Model loader](https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/loadModel.py): `Code/src/pipeline/loadModel.py`
- [Window inference](https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/inference.py): `Code/src/pipeline/inference.py`
- [Window stitching](https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/stitch.py): `Code/src/pipeline/stitch.py`
- [Note extraction](https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/noteCreation.py): `Code/src/pipeline/noteCreation.py`
- [MIDI generation](https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/generateMIDI.py): `Code/src/pipeline/generateMIDI.py`

### Model experiments

- [CQT transcriber](https://github.com/c22516126/fyp/blob/main/Code/src/cqtExperiment.py): `Code/src/cqtExperiment.py`
- [Model architecture](https://github.com/c22516126/fyp/blob/main/Code/src/pipeline/model2.py): `Code/src/pipeline/model2.py`

### Evaluation

- [Evaluation dataset](https://github.com/c22516126/fyp/blob/main/Code/evaluation/getMidiData.py): `Code/evaluation/getMidiData.py`
- [Transcription evaluation](https://github.com/c22516126/fyp/blob/main/Code/evaluation/eval.py): `Code/evaluation/eval.py`
- [Parameter search](https://github.com/c22516126/fyp/blob/main/Code/evaluation/gridSearch.py): `Code/evaluation/gridSearch.py`
- [Pipeline experiment](https://github.com/c22516126/fyp/blob/main/Code/evaluation/experimentVer1.py): `Code/evaluation/experimentVer1.py`
- [Evaluation plots](https://github.com/c22516126/fyp/blob/main/Code/evaluation/plot.py): `Code/evaluation/plot.py`

### Other components

- **User**
- **MIDI file**

## Connections

- User → App shell: uses (evidence: `README.md`)
- App shell → Transcription view: renders (evidence: `Code/frontend/src/App.jsx`)
- Transcription view → Audio upload: renders (evidence: `Code/frontend/src/Body.jsx`)
- Transcription view → MIDI player: renders (evidence: `Code/frontend/src/Body.jsx`)
- User → Audio upload: selects audio
- Audio upload → Backend server: submits audio
- Backend server → Transcriber: invokes (evidence: `Code/backend/server.py`)
- CLI adapter → Transcriber: delegates (evidence: `Code/src/CLI/CLI.py`)
- Transcriber → Runtime config: reads settings (evidence: `Code/src/transcribe.py`)
- Transcriber → Model loader: loads model (evidence: `Code/src/transcribe.py`)
- Transcriber → Window inference: runs inference (evidence: `Code/src/transcribe.py`)
- Transcriber → Window stitching: stitches windows (evidence: `Code/src/transcribe.py`)
- Transcriber → Note extraction: extracts notes (evidence: `Code/src/transcribe.py`)
- Transcriber → MIDI generation: writes notes (evidence: `Code/src/transcribe.py`)
- MIDI generation → MIDI file: writes MIDI (evidence: `Code/src/pipeline/generateMIDI.py`)
- MIDI player → MIDI file: plays file
- CQT transcriber → Model architecture: builds model (evidence: `Code/src/cqtExperiment.py`)
- CQT transcriber → Runtime config: reads settings (evidence: `Code/src/cqtExperiment.py`)
- CQT transcriber → Window stitching: stitches windows (evidence: `Code/src/cqtExperiment.py`)
- CQT transcriber → Note extraction: extracts notes (evidence: `Code/src/cqtExperiment.py`)
- CQT transcriber → MIDI generation: writes MIDI (evidence: `Code/src/cqtExperiment.py`)
- Transcription evaluation → Evaluation dataset: loads references (evidence: `Code/evaluation/eval.py`)
- Transcription evaluation → Transcriber: runs inference (evidence: `Code/evaluation/eval.py`)
- Transcription evaluation → Note extraction: converts predictions (evidence: `Code/evaluation/eval.py`)
- Transcription evaluation → Evaluation plots: plots metrics (evidence: `Code/evaluation/eval.py`)
- Parameter search → Evaluation dataset: builds dataset (evidence: `Code/evaluation/gridSearch.py`)
- Parameter search → Transcriber: runs inference (evidence: `Code/evaluation/gridSearch.py`)
- Parameter search → Note extraction: converts predictions (evidence: `Code/evaluation/gridSearch.py`)
- Parameter search → Transcription evaluation: scores results (evidence: `Code/evaluation/gridSearch.py`)
- Parameter search → Evaluation plots: plots search (evidence: `Code/evaluation/gridSearch.py`)
- Pipeline experiment → Note extraction: creates notes (evidence: `Code/evaluation/experimentVer1.py`)
- Pipeline experiment → MIDI generation: generates MIDI (evidence: `Code/evaluation/experimentVer1.py`)
- Pipeline experiment → Window stitching: stitches output (evidence: `Code/evaluation/experimentVer1.py`)
- Pipeline experiment → Runtime config: reads settings (evidence: `Code/evaluation/experimentVer1.py`)
