# poke19962008/mash-up architecture

> Architecture diagram of the GitHub repository poke19962008/mash-up, 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/poke19962008/mash-up
- Repository: https://github.com/poke19962008/mash-up

## Overview

Mash Up is a small command-line audio mixer: running main.py loads the song definitions, analyzes one incoming and one outgoing song, selects a transition region, adjusts tempo, crossfades the segments, and exports final.mp3. The implementation keeps these stages in one class rather than separate modules. The README also describes future chroma-based song selection, but marks it as under construction; it is not implemented in the sampled source. Only main.py was sampled, so the graph shows relationships visible there and in the README.

Main entry points: [`main.py`](https://github.com/poke19962008/mash-up/blob/master/main.py) (Mash workflow), [`songs.json`](https://github.com/poke19962008/mash-up/blob/master/songs.json) (Song definitions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Mash generation"]
  node_song_config["Song definitions<br/>[songs.json]"]
  node_mash["Mash workflow<br/>[main.py]"]
  node_audio_files["Input audio"]
  node_segment["Audio segmentation<br/>[main.py]"]
  node_speed["Segment speed adjustment<br/>[main.py]"]
  node_crossfade["Crossfade assembly<br/>[main.py]"]
  node_cache[("Audio cache<br/>[main.py]")]
  node_output["final.mp3"]
end

subgraph group_analysis["Audio analysis"]
  node_audio_analysis["Tempo and beats<br/>[main.py]"]
  node_otac["Tempo adjustment<br/>[main.py]"]
  node_fade_region["Fade region scoring<br/>[main.py]"]
end

node_user(("User"))
node_librosa["Librosa"]
node_pydub["PyDub"]

node_user -->|"runs"| node_mash
node_mash -->|"reads"| node_song_config
node_mash -->|"loads"| node_audio_files
node_mash -->|"reads and writes"| node_cache
node_mash -->|"analyzes"| node_audio_analysis
node_audio_analysis -->|"tracks beats"| node_librosa
node_audio_analysis -->|"computes"| node_otac
node_audio_analysis -->|"scores"| node_fade_region
node_fade_region -->|"uses beat data"| node_audio_analysis
node_mash -->|"segments"| node_segment
node_segment -->|"loads audio"| node_pydub
node_mash -->|"adjusts tempo"| node_speed
node_mash -->|"assembles"| node_crossfade
node_crossfade -->|"exports"| node_output

click node_song_config "https://github.com/poke19962008/mash-up/blob/master/songs.json"
click node_mash "https://github.com/poke19962008/mash-up/blob/master/main.py"
click node_audio_analysis "https://github.com/poke19962008/mash-up/blob/master/main.py"
click node_otac "https://github.com/poke19962008/mash-up/blob/master/main.py"
click node_fade_region "https://github.com/poke19962008/mash-up/blob/master/main.py"
click node_segment "https://github.com/poke19962008/mash-up/blob/master/main.py"
click node_speed "https://github.com/poke19962008/mash-up/blob/master/main.py"
click node_crossfade "https://github.com/poke19962008/mash-up/blob/master/main.py"
click node_cache "https://github.com/poke19962008/mash-up/blob/master/main.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_song_config,node_mash,node_audio_files,node_segment,node_speed,node_crossfade,node_cache,node_output,node_user toneBlue
class node_audio_analysis,node_otac,node_fade_region toneAmber
class node_librosa,node_pydub toneIndigo
```

## Components

### Mash generation

- [Song definitions](https://github.com/poke19962008/mash-up/blob/master/songs.json): `songs.json`
- [Mash workflow](https://github.com/poke19962008/mash-up/blob/master/main.py): `main.py`
- **Input audio**
- [Audio segmentation](https://github.com/poke19962008/mash-up/blob/master/main.py): `main.py`
- [Segment speed adjustment](https://github.com/poke19962008/mash-up/blob/master/main.py): `main.py`
- [Crossfade assembly](https://github.com/poke19962008/mash-up/blob/master/main.py): `main.py`
- [Audio cache](https://github.com/poke19962008/mash-up/blob/master/main.py): `main.py`
- **final.mp3**

### Audio analysis

- [Tempo and beats](https://github.com/poke19962008/mash-up/blob/master/main.py): `main.py`
- [Tempo adjustment](https://github.com/poke19962008/mash-up/blob/master/main.py): `main.py`
- [Fade region scoring](https://github.com/poke19962008/mash-up/blob/master/main.py): `main.py`

### Other components

- **User**
- **Librosa**
- **PyDub**

## Connections

- User → Mash workflow: runs (evidence: `main.py`)
- Mash workflow → Song definitions: reads (evidence: `main.py`)
- Mash workflow → Input audio: loads (evidence: `main.py`)
- Mash workflow → Audio cache: reads and writes (evidence: `main.py`)
- Mash workflow → Tempo and beats: analyzes (evidence: `main.py`)
- Tempo and beats → Librosa: tracks beats (evidence: `main.py`)
- Tempo and beats → Tempo adjustment: computes (evidence: `main.py`)
- Tempo and beats → Fade region scoring: scores (evidence: `main.py`)
- Fade region scoring → Tempo and beats: uses beat data (evidence: `main.py`)
- Mash workflow → Audio segmentation: segments (evidence: `main.py`)
- Audio segmentation → PyDub: loads audio (evidence: `main.py`)
- Mash workflow → Segment speed adjustment: adjusts tempo (evidence: `main.py`)
- Mash workflow → Crossfade assembly: assembles (evidence: `main.py`)
- Crossfade assembly → final.mp3: exports (evidence: `main.py`)
