# blacksnowmartin/project-m architecture

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

- Interactive diagram: https://gitdiagram.com/blacksnowmartin/project-m
- Repository: https://github.com/blacksnowmartin/project-m

## Overview

Project-M is a loosely assembled music-creation toolkit centered on extracting a melody from audio, then refining or sequencing musical material. The sampled GUI loads or accepts a dropped audio file, extracts pitches, converts them to MIDI values, plots the pitches, and can save either output. A separate Python sequencer supports grid-based playback and pattern save/load and JSON import/export; the tree also contains a web sequencer and Spleeter materials. These appear as separate capabilities: sampled code does not establish connections between them. Several listed tools are unsampled, so their internal behavior and wiring are omitted.

Main entry points: [`melody_extractor_gui.py`](https://github.com/blacksnowmartin/project-m/blob/main/melody_extractor_gui.py) (Melody GUI), [`MSequencer.py`](https://github.com/blacksnowmartin/project-m/blob/main/MSequencer.py) (Desktop sequencer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_melody["Melody Extraction"]
  node_extractor["Melody GUI"]
  node_pitch["Pitch output"]
  node_midi["MIDI output"]
  node_quantize["Note quantization<br/>[quantize.py]"]
  node_melody_script["Pitch plotting script<br/>[Melody.py]"]
end

subgraph group_sequencing["Sequencing"]
  node_sequencer["Desktop sequencer<br/>[MSequencer.py]"]
  node_patterns[("Saved patterns<br/>[MSequencer.py]")]
  node_synth["Note synthesizer<br/>[MSequencer.py]"]
  node_web_sequencer["Web sequencer<br/>[index.html]"]
end

subgraph group_audio["Audio Tools"]
  node_spleeter["Spleeter materials<br/>[Spleeter.md]"]
end

node_user(("Audio creator"))

node_user -->|"loads audio"| node_extractor
node_extractor -->|"saves pitches"| node_pitch
node_extractor -->|"saves MIDI"| node_midi
node_user -->|"edits patterns"| node_sequencer
node_sequencer -->|"reads and writes"| node_patterns

click node_extractor "https://github.com/blacksnowmartin/project-m/blob/main/melody_extractor_gui.py"
click node_pitch "https://github.com/blacksnowmartin/project-m/blob/main/melody_extractor_gui.py"
click node_midi "https://github.com/blacksnowmartin/project-m/blob/main/melody_extractor_gui.py"
click node_quantize "https://github.com/blacksnowmartin/project-m/blob/main/quantize.py"
click node_melody_script "https://github.com/blacksnowmartin/project-m/blob/main/Melody.py"
click node_sequencer "https://github.com/blacksnowmartin/project-m/blob/main/MSequencer.py"
click node_patterns "https://github.com/blacksnowmartin/project-m/blob/main/MSequencer.py"
click node_synth "https://github.com/blacksnowmartin/project-m/blob/main/MSequencer.py"
click node_web_sequencer "https://github.com/blacksnowmartin/project-m/blob/main/Music-Grid-Sequencer/index.html"
click node_spleeter "https://github.com/blacksnowmartin/project-m/blob/main/Spleeter/Spleeter.md"

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_extractor,node_pitch,node_midi,node_quantize,node_melody_script toneBlue
class node_sequencer,node_patterns,node_synth,node_web_sequencer toneAmber
class node_spleeter toneMint
class node_user toneIndigo
```

## Components

### Melody Extraction

- [Melody GUI](https://github.com/blacksnowmartin/project-m/blob/main/melody_extractor_gui.py): `melody_extractor_gui.py`
- [Pitch output](https://github.com/blacksnowmartin/project-m/blob/main/melody_extractor_gui.py): `melody_extractor_gui.py`
- [MIDI output](https://github.com/blacksnowmartin/project-m/blob/main/melody_extractor_gui.py): `melody_extractor_gui.py`
- [Note quantization](https://github.com/blacksnowmartin/project-m/blob/main/quantize.py): `quantize.py`
- [Pitch plotting script](https://github.com/blacksnowmartin/project-m/blob/main/Melody.py): `Melody.py`

### Sequencing

- [Desktop sequencer](https://github.com/blacksnowmartin/project-m/blob/main/MSequencer.py): `MSequencer.py`
- [Saved patterns](https://github.com/blacksnowmartin/project-m/blob/main/MSequencer.py): `MSequencer.py`
- [Note synthesizer](https://github.com/blacksnowmartin/project-m/blob/main/MSequencer.py): `MSequencer.py`
- [Web sequencer](https://github.com/blacksnowmartin/project-m/blob/main/Music-Grid-Sequencer/index.html): `Music-Grid-Sequencer/index.html`

### Audio Tools

- [Spleeter materials](https://github.com/blacksnowmartin/project-m/blob/main/Spleeter/Spleeter.md): `Spleeter/Spleeter.md`

### Other components

- **Audio creator**

## Connections

- Audio creator → Melody GUI: loads audio (evidence: `melody_extractor_gui.py`)
- Melody GUI → Pitch output: saves pitches (evidence: `melody_extractor_gui.py`)
- Melody GUI → MIDI output: saves MIDI (evidence: `melody_extractor_gui.py`)
- Audio creator → Desktop sequencer: edits patterns (evidence: `MSequencer.py`)
- Desktop sequencer → Saved patterns: reads and writes (evidence: `MSequencer.py`)
