# darinchau/automasher architecture

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

- Interactive diagram: https://gitdiagram.com/darinchau/automasher
- Repository: https://github.com/darinchau/automasher

## Overview

Auto Masher accepts a user song and searches a prepared song dataset for a compatible segment, then generates a mashup. Its domain stages include audio acquisition and dataset access, beat/chord analysis, candidate matching, stem separation, and audio alignment and mixing. The README describes the end-to-end capability; the excerpts show dataset audio access and the app’s slice-preparation work. Some orchestration details are omitted from the sampled app source, so those links are marked unverified rather than presented as confirmed calls.

Main entry points: [`fyp/app/core.py`](https://github.com/darinchau/automasher/blob/main/fyp/app/core.py) (Mashup app), [`fyp/audio/dataset/base.py`](https://github.com/darinchau/automasher/blob/main/fyp/audio/dataset/base.py) (Song dataset), [`fyp/audio/mix/mashup.py`](https://github.com/darinchau/automasher/blob/main/fyp/audio/mix/mashup.py) (Mashup assembly), [`fyp/audio/analysis/beat.py`](https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/beat.py) (Beat analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Mashup workflow"]
  node_app["Mashup app<br/>[core.py]"]
  node_dataset[("Song dataset<br/>[base.py]")]
  node_matching["Mashability matching<br/>[align.py]"]
  node_mashup["Mashup assembly<br/>[mashup.py]"]
end

subgraph group_analysis["Music analysis"]
  node_beat_analysis["Beat analysis<br/>[beat.py]"]
  node_chord_analysis["Chord analysis<br/>[chord.py]"]
  node_chroma["Chroma analysis<br/>[chroma.py]"]
  node_feature_base["Feature primitives<br/>[base.py]"]
  node_beat_model["Beat models<br/>[modules.py]"]
  node_beat_tracker["Beat tracker<br/>[tracker.py]"]
  node_chord_model["Chord models<br/>[chord_modules.py]"]
end

subgraph group_audio["Audio processing"]
  node_audio_obj["Audio handling<br/>[audio.py]"]
  node_collection["Stem collections"]
  node_separation["Stem separation<br/>[demucs.py]"]
  node_hpss["HPSS separation<br/>[hpss.py]"]
  node_mastering["Mastering<br/>[mastering.py]"]
  node_manipulation["Audio effects<br/>[base.py]"]
end

subgraph group_support["Shared support"]
  node_url["YouTube URLs<br/>[url.py]"]
  node_loading["Audio loading<br/>[load.py]"]
  node_notes["Note utilities<br/>[note.py]"]
end

node_user(("User"))

node_user -->|"submits song"| node_app
node_app -->|"accesses songs"| node_dataset
node_dataset -->|"loads audio"| node_audio_obj
node_app -.->|"requests analysis"| node_beat_analysis
node_app -.->|"requests analysis"| node_chord_analysis
node_app -.->|"searches candidates"| node_matching
node_app -.->|"requests stems"| node_separation
node_app -.->|"builds mashup"| node_mashup
node_beat_analysis -->|"uses model"| node_beat_model
node_beat_analysis -->|"uses tracker"| node_beat_tracker
node_chord_analysis -->|"uses model"| node_chord_model
node_chord_analysis -->|"maps chords"| node_notes
node_beat_analysis -->|"uses features"| node_feature_base
node_chord_analysis -->|"uses features"| node_feature_base
node_matching -->|"scores dataset"| node_dataset
node_matching -->|"compares features"| node_feature_base
node_mashup -->|"combines audio"| node_audio_obj
node_mashup -->|"applies mastering"| node_mastering
node_mashup -->|"applies effects"| node_manipulation
node_separation -->|"creates stems"| node_collection
node_hpss -->|"creates stems"| node_collection
node_dataset -->|"uses URL type"| node_url
node_audio_obj -->|"loads files"| node_loading
node_dataset -->|"loads parts"| node_separation

click node_app "https://github.com/darinchau/automasher/blob/main/fyp/app/core.py"
click node_dataset "https://github.com/darinchau/automasher/blob/main/fyp/audio/dataset/base.py"
click node_audio_obj "https://github.com/darinchau/automasher/blob/main/fyp/audio/base/audio.py"
click node_collection "https://github.com/darinchau/automasher/blob/main/fyp/audio/base/audio_collection.py"
click node_beat_analysis "https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/beat.py"
click node_chord_analysis "https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/chord.py"
click node_chroma "https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/chroma.py"
click node_feature_base "https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/base.py"
click node_beat_model "https://github.com/darinchau/automasher/blob/main/fyp/model/beats/modules.py"
click node_beat_tracker "https://github.com/darinchau/automasher/blob/main/fyp/model/beats/tracker.py"
click node_chord_model "https://github.com/darinchau/automasher/blob/main/fyp/model/chord/chord_modules.py"
click node_matching "https://github.com/darinchau/automasher/blob/main/fyp/audio/mix/align.py"
click node_separation "https://github.com/darinchau/automasher/blob/main/fyp/audio/separation/demucs.py"
click node_hpss "https://github.com/darinchau/automasher/blob/main/fyp/audio/separation/hpss.py"
click node_mashup "https://github.com/darinchau/automasher/blob/main/fyp/audio/mix/mashup.py"
click node_mastering "https://github.com/darinchau/automasher/blob/main/fyp/audio/mix/mastering.py"
click node_manipulation "https://github.com/darinchau/automasher/blob/main/fyp/audio/manipulation/base.py"
click node_url "https://github.com/darinchau/automasher/blob/main/fyp/util/url.py"
click node_loading "https://github.com/darinchau/automasher/blob/main/fyp/util/load.py"
click node_notes "https://github.com/darinchau/automasher/blob/main/fyp/util/note.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_dataset,node_matching,node_mashup,node_user toneBlue
class node_beat_analysis,node_chord_analysis,node_chroma,node_feature_base,node_beat_model,node_beat_tracker,node_chord_model toneAmber
class node_audio_obj,node_collection,node_separation,node_hpss,node_mastering,node_manipulation toneMint
class node_url,node_loading,node_notes toneRose
```

## Components

### Mashup workflow

- [Mashup app](https://github.com/darinchau/automasher/blob/main/fyp/app/core.py): `fyp/app/core.py`
- [Song dataset](https://github.com/darinchau/automasher/blob/main/fyp/audio/dataset/base.py): `fyp/audio/dataset/base.py`
- [Mashability matching](https://github.com/darinchau/automasher/blob/main/fyp/audio/mix/align.py): `fyp/audio/mix/align.py`
- [Mashup assembly](https://github.com/darinchau/automasher/blob/main/fyp/audio/mix/mashup.py): `fyp/audio/mix/mashup.py`

### Music analysis

- [Beat analysis](https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/beat.py): `fyp/audio/analysis/beat.py`
- [Chord analysis](https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/chord.py): `fyp/audio/analysis/chord.py`
- [Chroma analysis](https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/chroma.py): `fyp/audio/analysis/chroma.py`
- [Feature primitives](https://github.com/darinchau/automasher/blob/main/fyp/audio/analysis/base.py): `fyp/audio/analysis/base.py`
- [Beat models](https://github.com/darinchau/automasher/blob/main/fyp/model/beats/modules.py): `fyp/model/beats/modules.py`
- [Beat tracker](https://github.com/darinchau/automasher/blob/main/fyp/model/beats/tracker.py): `fyp/model/beats/tracker.py`
- [Chord models](https://github.com/darinchau/automasher/blob/main/fyp/model/chord/chord_modules.py): `fyp/model/chord/chord_modules.py`

### Audio processing

- [Audio handling](https://github.com/darinchau/automasher/blob/main/fyp/audio/base/audio.py): `fyp/audio/base/audio.py`
- [Stem collections](https://github.com/darinchau/automasher/blob/main/fyp/audio/base/audio_collection.py): `fyp/audio/base/audio_collection.py`
- [Stem separation](https://github.com/darinchau/automasher/blob/main/fyp/audio/separation/demucs.py): `fyp/audio/separation/demucs.py`
- [HPSS separation](https://github.com/darinchau/automasher/blob/main/fyp/audio/separation/hpss.py): `fyp/audio/separation/hpss.py`
- [Mastering](https://github.com/darinchau/automasher/blob/main/fyp/audio/mix/mastering.py): `fyp/audio/mix/mastering.py`
- [Audio effects](https://github.com/darinchau/automasher/blob/main/fyp/audio/manipulation/base.py): `fyp/audio/manipulation/base.py`

### Shared support

- [YouTube URLs](https://github.com/darinchau/automasher/blob/main/fyp/util/url.py): `fyp/util/url.py`
- [Audio loading](https://github.com/darinchau/automasher/blob/main/fyp/util/load.py): `fyp/util/load.py`
- [Note utilities](https://github.com/darinchau/automasher/blob/main/fyp/util/note.py): `fyp/util/note.py`

### Other components

- **User**

## Connections

- User → Mashup app: submits song
- Mashup app → Song dataset: accesses songs (evidence: `fyp/app/core.py`)
- Song dataset → Audio handling: loads audio (evidence: `fyp/audio/dataset/base.py`)
- Mashup app → Beat analysis: requests analysis
- Mashup app → Chord analysis: requests analysis (evidence: `fyp/app/core.py`)
- Mashup app → Mashability matching: searches candidates
- Mashup app → Stem separation: requests stems
- Mashup app → Mashup assembly: builds mashup
- Beat analysis → Beat models: uses model
- Beat analysis → Beat tracker: uses tracker
- Chord analysis → Chord models: uses model (evidence: `fyp/audio/analysis/chord.py`)
- Chord analysis → Note utilities: maps chords (evidence: `fyp/audio/analysis/chord.py`)
- Beat analysis → Feature primitives: uses features (evidence: `fyp/audio/analysis/__init__.py`)
- Chord analysis → Feature primitives: uses features (evidence: `fyp/audio/analysis/chord.py`)
- Mashability matching → Song dataset: scores dataset (evidence: `fyp/audio/mix/align.py`)
- Mashability matching → Feature primitives: compares features (evidence: `fyp/audio/mix/align.py`)
- Mashup assembly → Audio handling: combines audio (evidence: `fyp/audio/mix/mashup.py`)
- Mashup assembly → Mastering: applies mastering (evidence: `fyp/audio/mix/mashup.py`)
- Mashup assembly → Audio effects: applies effects (evidence: `fyp/audio/mix/mashup.py`)
- Stem separation → Stem collections: creates stems (evidence: `fyp/audio/separation/__init__.py`)
- HPSS separation → Stem collections: creates stems (evidence: `fyp/audio/separation/__init__.py`)
- Song dataset → YouTube URLs: uses URL type (evidence: `fyp/audio/dataset/base.py`)
- Audio handling → Audio loading: loads files (evidence: `fyp/audio/base/audio.py`)
- Song dataset → Stem separation: loads parts (evidence: `fyp/audio/dataset/base.py`)
