# akustikrausch/protracker4 architecture

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

- Interactive diagram: https://gitdiagram.com/akustikrausch/protracker4
- Repository: https://github.com/akustikrausch/protracker4

## Overview

ProTracker is an Amiga music tracker: users edit patterns, tracks, and samples, then play songs or save them in supported formats. Its major product areas are the editor and sampler, playback engine, file operations, and machine-specific display and audio support. The README documents these capabilities and broad source areas, but no source excerpts were provided, so the graph shows only documented relationships; it does not infer internal call chains.

Main entry points: [`src/ui/edit.asm`](https://github.com/akustikrausch/protracker4/blob/main/src/ui/edit.asm) (Pattern editor), [`src/engine/replayer.asm`](https://github.com/akustikrausch/protracker4/blob/main/src/engine/replayer.asm) (Replayer), [`src/sys/init.asm`](https://github.com/akustikrausch/protracker4/blob/main/src/sys/init.asm) (System detection), [`src/ui/sampler.asm`](https://github.com/akustikrausch/protracker4/blob/main/src/ui/sampler.asm) (Sample editor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_editing["Editing and UI"]
  node_pattern_editor["Pattern editor<br/>[edit.asm]"]
  node_pattern_view["Pattern view<br/>[patview.asm]"]
  node_pattern_tools["Pattern tools<br/>[patops.asm]"]
  node_playlist["Song position list<br/>[plst.asm]"]
  node_sample_editor["Sample editor<br/>[sampler.asm]"]
  node_sample_tools["Sample operations<br/>[smpops.asm]"]
  node_filter_editor["Filter editor<br/>[filter41.asm]"]
  node_setup_ui["Setup pages<br/>[setup41.asm]"]
end

subgraph group_playback["Playback engine"]
  node_replayer["Replayer<br/>[replayer.asm]"]
  node_song_control["Song control<br/>[songctl.asm]"]
  node_mixer["Audio mixers<br/>[mixer.asm]"]
  node_mix_it["MIX IT rendering<br/>[mixit.asm]"]
end

subgraph group_files["File operations"]
  node_disk_operations["Disk operations<br/>[diskop.asm]"]
  node_file_io["File load and save<br/>[fileio.asm]"]
  node_format_support["Module formats<br/>[formats.asm]"]
end

subgraph group_platform["Platform services"]
  node_system_setup["System detection<br/>[init.asm]"]
  node_ahi["AHI audio<br/>[ahi.asm]"]
  node_rtg["RTG display<br/>[rtg.asm]"]
  node_scopes["Scopes and meters<br/>[scope.asm]"]
end

node_user(("Musician"))

node_user -->|"edits music"| node_pattern_editor
node_user -->|"edits samples"| node_sample_editor
node_user -->|"configures"| node_setup_ui
node_pattern_editor -->|"edits patterns"| node_pattern_view
node_pattern_editor -->|"uses edit tools"| node_pattern_tools
node_pattern_editor -->|"edits song positions"| node_playlist
node_sample_editor -->|"applies operations"| node_sample_tools
node_replayer -->|"plays tracks"| node_mixer
node_user -->|"plays song"| node_replayer
node_mix_it -->|"renders tracks"| node_mixer
node_disk_operations -->|"saves and loads"| node_file_io
node_file_io -->|"supports formats"| node_format_support
node_setup_ui -->|"configures detection"| node_system_setup
node_system_setup -->|"detects audio"| node_ahi
node_system_setup -->|"detects graphics"| node_rtg
node_ahi -->|"switches during playback"| node_replayer
node_replayer -.->|"shows track activity"| node_scopes

click node_pattern_editor "https://github.com/akustikrausch/protracker4/blob/main/src/ui/edit.asm"
click node_pattern_view "https://github.com/akustikrausch/protracker4/blob/main/src/ui/patview.asm"
click node_pattern_tools "https://github.com/akustikrausch/protracker4/blob/main/src/ui/patops.asm"
click node_playlist "https://github.com/akustikrausch/protracker4/blob/main/src/ui/plst.asm"
click node_sample_editor "https://github.com/akustikrausch/protracker4/blob/main/src/ui/sampler.asm"
click node_sample_tools "https://github.com/akustikrausch/protracker4/blob/main/src/ui/smpops.asm"
click node_filter_editor "https://github.com/akustikrausch/protracker4/blob/main/src/ui/filter41.asm"
click node_setup_ui "https://github.com/akustikrausch/protracker4/blob/main/src/ui/setup41.asm"
click node_replayer "https://github.com/akustikrausch/protracker4/blob/main/src/engine/replayer.asm"
click node_song_control "https://github.com/akustikrausch/protracker4/blob/main/src/engine/songctl.asm"
click node_mixer "https://github.com/akustikrausch/protracker4/blob/main/src/engine/mixer.asm"
click node_mix_it "https://github.com/akustikrausch/protracker4/blob/main/src/engine/mixit.asm"
click node_disk_operations "https://github.com/akustikrausch/protracker4/blob/main/src/io/diskop.asm"
click node_file_io "https://github.com/akustikrausch/protracker4/blob/main/src/io/fileio.asm"
click node_format_support "https://github.com/akustikrausch/protracker4/blob/main/src/io/formats.asm"
click node_system_setup "https://github.com/akustikrausch/protracker4/blob/main/src/sys/init.asm"
click node_ahi "https://github.com/akustikrausch/protracker4/blob/main/src/sys/ahi.asm"
click node_rtg "https://github.com/akustikrausch/protracker4/blob/main/src/sys/rtg.asm"
click node_scopes "https://github.com/akustikrausch/protracker4/blob/main/src/ui/scope.asm"

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_pattern_editor,node_pattern_view,node_pattern_tools,node_playlist,node_sample_editor,node_sample_tools,node_filter_editor,node_setup_ui toneBlue
class node_replayer,node_song_control,node_mixer,node_mix_it toneAmber
class node_disk_operations,node_file_io,node_format_support toneMint
class node_system_setup,node_ahi,node_rtg,node_scopes toneRose
class node_user toneIndigo
```

## Components

### Editing and UI

- [Pattern editor](https://github.com/akustikrausch/protracker4/blob/main/src/ui/edit.asm): `src/ui/edit.asm`
- [Pattern view](https://github.com/akustikrausch/protracker4/blob/main/src/ui/patview.asm): `src/ui/patview.asm`
- [Pattern tools](https://github.com/akustikrausch/protracker4/blob/main/src/ui/patops.asm): `src/ui/patops.asm`
- [Song position list](https://github.com/akustikrausch/protracker4/blob/main/src/ui/plst.asm): `src/ui/plst.asm`
- [Sample editor](https://github.com/akustikrausch/protracker4/blob/main/src/ui/sampler.asm): `src/ui/sampler.asm`
- [Sample operations](https://github.com/akustikrausch/protracker4/blob/main/src/ui/smpops.asm): `src/ui/smpops.asm`
- [Filter editor](https://github.com/akustikrausch/protracker4/blob/main/src/ui/filter41.asm): `src/ui/filter41.asm`
- [Setup pages](https://github.com/akustikrausch/protracker4/blob/main/src/ui/setup41.asm): `src/ui/setup41.asm`

### Playback engine

- [Replayer](https://github.com/akustikrausch/protracker4/blob/main/src/engine/replayer.asm): `src/engine/replayer.asm`
- [Song control](https://github.com/akustikrausch/protracker4/blob/main/src/engine/songctl.asm): `src/engine/songctl.asm`
- [Audio mixers](https://github.com/akustikrausch/protracker4/blob/main/src/engine/mixer.asm): `src/engine/mixer.asm`
- [MIX IT rendering](https://github.com/akustikrausch/protracker4/blob/main/src/engine/mixit.asm): `src/engine/mixit.asm`

### File operations

- [Disk operations](https://github.com/akustikrausch/protracker4/blob/main/src/io/diskop.asm): `src/io/diskop.asm`
- [File load and save](https://github.com/akustikrausch/protracker4/blob/main/src/io/fileio.asm): `src/io/fileio.asm`
- [Module formats](https://github.com/akustikrausch/protracker4/blob/main/src/io/formats.asm): `src/io/formats.asm`

### Platform services

- [System detection](https://github.com/akustikrausch/protracker4/blob/main/src/sys/init.asm): `src/sys/init.asm`
- [AHI audio](https://github.com/akustikrausch/protracker4/blob/main/src/sys/ahi.asm): `src/sys/ahi.asm`
- [RTG display](https://github.com/akustikrausch/protracker4/blob/main/src/sys/rtg.asm): `src/sys/rtg.asm`
- [Scopes and meters](https://github.com/akustikrausch/protracker4/blob/main/src/ui/scope.asm): `src/ui/scope.asm`

### Other components

- **Musician**

## Connections

- Musician → Pattern editor: edits music (evidence: `README.md`)
- Musician → Sample editor: edits samples (evidence: `README.md`)
- Musician → Setup pages: configures (evidence: `README.md`)
- Pattern editor → Pattern view: edits patterns (evidence: `README.md`)
- Pattern editor → Pattern tools: uses edit tools (evidence: `README.md`)
- Pattern editor → Song position list: edits song positions (evidence: `README.md`)
- Sample editor → Sample operations: applies operations (evidence: `README.md`)
- Replayer → Audio mixers: plays tracks (evidence: `README.md`)
- Musician → Replayer: plays song (evidence: `README.md`)
- MIX IT rendering → Audio mixers: renders tracks (evidence: `README.md`)
- Disk operations → File load and save: saves and loads (evidence: `README.md`)
- File load and save → Module formats: supports formats (evidence: `README.md`)
- Setup pages → System detection: configures detection (evidence: `README.md`)
- System detection → AHI audio: detects audio (evidence: `README.md`)
- System detection → RTG display: detects graphics (evidence: `README.md`)
- AHI audio → Replayer: switches during playback (evidence: `README.md`)
- Replayer → Scopes and meters: shows track activity
