# paxy484/paxm architecture

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

- Interactive diagram: https://gitdiagram.com/paxy484/paxm
- Repository: https://github.com/paxy484/paxm

## Overview

PAXM is a small C library for creating, editing, and reading or writing a fixed-layout MIDI-like sequence format. The main workflow is to create a sequence, add events or route notes through production-mode mapping, then save it as a .paxm file; loading reconstructs a sequence from that file. The public format structures and API are declared in paxm.h, while runtime behavior is implemented in paxm.c. The README also describes deathcore and speed-metal modes; their sampled routing appears in the note-insertion implementation.

Main entry points: [`paxm.c`](https://github.com/paxy484/paxm/blob/main/paxm.c) (Sequence Lifecycle), [`paxm.h`](https://github.com/paxy484/paxm/blob/main/paxm.h) (Binary Format)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_client(("Library Client"))
node_sequence["Sequence Lifecycle<br/>[paxm.c]"]
node_format["Binary Format<br/>[paxm.h]"]
node_events["Event Buffer<br/>[paxm.c]"]
node_routing["Production Routing<br/>[paxm.c]"]
node_file["PAXM File"]

node_client -.->|"uses API"| node_sequence
node_sequence -->|"initializes"| node_format
node_routing -->|"appends events"| node_events
node_sequence -->|"reads or writes"| node_file
node_format -->|"defines layout"| node_events

click node_sequence "https://github.com/paxy484/paxm/blob/main/paxm.c"
click node_format "https://github.com/paxy484/paxm/blob/main/paxm.h"
click node_events "https://github.com/paxy484/paxm/blob/main/paxm.c"
click node_routing "https://github.com/paxy484/paxm/blob/main/paxm.c"

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_client toneBlue
class node_sequence,node_format,node_events,node_routing toneTeal
class node_file toneIndigo
```

## Components

### Other components

- **Library Client**
- [Sequence Lifecycle](https://github.com/paxy484/paxm/blob/main/paxm.c): `paxm.c`
- [Binary Format](https://github.com/paxy484/paxm/blob/main/paxm.h): `paxm.h`
- [Event Buffer](https://github.com/paxy484/paxm/blob/main/paxm.c): `paxm.c`
- [Production Routing](https://github.com/paxy484/paxm/blob/main/paxm.c): `paxm.c`
- **PAXM File**

## Connections

- Library Client → Sequence Lifecycle: uses API
- Sequence Lifecycle → Binary Format: initializes (evidence: `paxm.c`)
- Production Routing → Event Buffer: appends events (evidence: `paxm.c`)
- Sequence Lifecycle → PAXM File: reads or writes (evidence: `paxm.c`)
- Binary Format → Event Buffer: defines layout (evidence: `paxm.h`)
