# keitagame/midi architecture

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

- Interactive diagram: https://gitdiagram.com/keitagame/midi
- Repository: https://github.com/keitagame/midi

## Overview

1. **Overall shape**
   - This is a **static, browser-based project** centered on MIDI/audio experimentation.
   - There is **no server-side application** in the repository; the architecture is almost entirely **client-side HTML pages plus static assets**.

2. **Entry points**
   - The repository uses **multiple standalone HTML files** as top-level entry points:
     - `index.html`
     - `midi.html`
     - `sf.html`
     - `wav.html`
     - `io.html`
     - `ff.html`
     - `pi.html`
     - `dev.html`
   - Each page likely represents a different feature area or demo rather than a single routed SPA.

3. **Primary functional boundary**
   - The project appears to split concerns by file/page:
     - **MIDI-related functionality** in `midi.html`
     - **SoundFont handling** in `sf.html`
     - **WAV/audio export or playback** in `wav.html`
     - **I/O or file handling** in `io.html`
     - Additional specialized/demo pages in `ff.html`, `pi.html`, and `dev.html`
   - This suggests a **page-per-feature** structure rather than shared app routing.

4. **Audio asset**
   - `GM.sf2` is a bundled **General MIDI SoundFont** asset.
   - Architecturally, this is a key static dependency for any browser-side synthesis or rendering path that needs instrument samples.

5. **Likely data flow**
   - User interaction happens in the browser on one of the HTML pages.
   - The page reads or generates MIDI/audio data.
   - Where sound rendering is involved, the page likely uses `GM.sf2` as a local asset.
   - Outputs are probably either **audible playback**, **downloadable audio files**, or **file-based import/export**.

6. **Static hosting model**
   - The presence of only HTML files, a SoundFont file, and a GitHub Actions workflow implies the repo is meant to be **served as static content**.
   - There is no evidence of a backend API, database, or runtime service dependency.

7. **CI / deployment**
   - `.github/workflows/static.yml` indicates a **GitHub Actions pipeline** for building or publishing the static site.
   - That workflow is likely the deployment boundary for the project, with the repo contents shipped directly to a static host.

8. **Technology implications**
   - The app is likely implemented with **vanilla browser technologies**: HTML and client-side JavaScript embedded in or loaded by those pages.
   - The architecture is therefore dominated by **browser APIs** and static file loading rather than framework-managed application state.

9. **Subsystem boundaries to draw**
   - A useful diagram would show:
     - **Browser UI pages** as separate front-end modules
     - A shared **audio/MIDI asset layer** containing `GM.sf2`
     - A **static hosting/deployment layer** driven by GitHub Actions
   - The page set and asset set are the main architectural units.

10. **What not to infer**
   - Do not assume microservices, authentication, or a database.
   - Do not assume a single-page app architecture; the file structure strongly suggests **multiple independent HTML entry points** instead.

11. **Concise architectural summary**
   - This repository is best described as a **static MIDI/audio toolkit or demo site**: independent HTML pages implement features in the browser, `GM.sf2` supplies a shared sound source, and GitHub Actions handles static publishing.

Main entry points: [`index.html`](https://github.com/keitagame/midi/blob/main/index.html) (Home), [`GM.sf2`](https://github.com/keitagame/midi/blob/main/GM.sf2) (GM.sf2), [`.github/workflows/static.yml`](https://github.com/keitagame/midi/blob/main/.github/workflows/static.yml) (Static CI), [`midi.html`](https://github.com/keitagame/midi/blob/main/midi.html) (MIDI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_pages["Browser pages"]
  node_index["Home<br/>html entrypoint<br/>[index.html]"]
  node_midi["MIDI<br/>html entrypoint<br/>[midi.html]"]
  node_sf["SoundFont<br/>html entrypoint<br/>[sf.html]"]
  node_wav["WAV<br/>html entrypoint<br/>[wav.html]"]
  node_io["I/O<br/>html entrypoint<br/>[io.html]"]
  node_ff["FF<br/>html entrypoint<br/>[ff.html]"]
  node_pi["PI<br/>html entrypoint<br/>[pi.html]"]
  node_dev["Dev<br/>html entrypoint<br/>[dev.html]"]
end

subgraph group_assets["Shared assets"]
  node_gm_sf2["GM.sf2<br/>soundfont asset<br/>[GM.sf2]"]
end

subgraph group_ci["Deployment"]
  node_static_workflow["Static CI<br/>github actions workflow<br/>[static.yml]"]
end

node_index -.->|"launches"| node_midi
node_index -.->|"launches"| node_sf
node_index -.->|"launches"| node_wav
node_index -.->|"launches"| node_io
node_index -.->|"launches"| node_ff
node_index -.->|"launches"| node_pi
node_index -.->|"launches"| node_dev
node_midi -->|"uses"| node_gm_sf2
node_sf -->|"uses"| node_gm_sf2
node_wav -->|"uses"| node_gm_sf2
node_static_workflow -->|"publishes"| node_index
node_static_workflow -->|"publishes"| node_gm_sf2

click node_index "https://github.com/keitagame/midi/blob/main/index.html"
click node_midi "https://github.com/keitagame/midi/blob/main/midi.html"
click node_sf "https://github.com/keitagame/midi/blob/main/sf.html"
click node_wav "https://github.com/keitagame/midi/blob/main/wav.html"
click node_io "https://github.com/keitagame/midi/blob/main/io.html"
click node_ff "https://github.com/keitagame/midi/blob/main/ff.html"
click node_pi "https://github.com/keitagame/midi/blob/main/pi.html"
click node_dev "https://github.com/keitagame/midi/blob/main/dev.html"
click node_gm_sf2 "https://github.com/keitagame/midi/blob/main/GM.sf2"
click node_static_workflow "https://github.com/keitagame/midi/blob/main/.github/workflows/static.yml"

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_index,node_midi,node_sf,node_wav,node_io,node_ff,node_pi,node_dev toneBlue
class node_gm_sf2 toneAmber
class node_static_workflow toneMint
```

## Components

### Browser pages

Standalone HTML entry points that provide separate MIDI/audio tools and demos.

- [Home](https://github.com/keitagame/midi/blob/main/index.html): html entrypoint · Landing page and likely feature launcher. · `index.html`
- [MIDI](https://github.com/keitagame/midi/blob/main/midi.html): html entrypoint · MIDI-focused browser page. · `midi.html`
- [SoundFont](https://github.com/keitagame/midi/blob/main/sf.html): html entrypoint · SoundFont handling page. · `sf.html`
- [WAV](https://github.com/keitagame/midi/blob/main/wav.html): html entrypoint · Audio export or playback page. · `wav.html`
- [I/O](https://github.com/keitagame/midi/blob/main/io.html): html entrypoint · File import/export and data handling page. · `io.html`
- [FF](https://github.com/keitagame/midi/blob/main/ff.html): html entrypoint · Specialized demo or feature page. · `ff.html`
- [PI](https://github.com/keitagame/midi/blob/main/pi.html): html entrypoint · Specialized demo or feature page. · `pi.html`
- [Dev](https://github.com/keitagame/midi/blob/main/dev.html): html entrypoint · Developer-oriented page. · `dev.html`

### Shared assets

Static media used by the browser pages.

- [GM.sf2](https://github.com/keitagame/midi/blob/main/GM.sf2): soundfont asset · Bundled General MIDI sound source used for synthesis and rendering. · `GM.sf2`

### Deployment

Static publishing via GitHub Actions.

- [Static CI](https://github.com/keitagame/midi/blob/main/.github/workflows/static.yml): github actions workflow · Static site build or publish pipeline. · `.github/workflows/static.yml`

## Connections

- Home → MIDI: launches · Landing page navigation to the MIDI toolset.
- Home → SoundFont: launches · Landing page navigation to SoundFont tooling.
- Home → WAV: launches · Landing page navigation to audio export/playback.
- Home → I/O: launches · Landing page navigation to import/export utilities.
- Home → FF: launches · Landing page navigation to a specialized demo.
- Home → PI: launches · Landing page navigation to a specialized demo.
- Home → Dev: launches · Landing page navigation to developer tools.
- MIDI → GM.sf2: uses · MIDI work can render through the shared SoundFont asset.
- SoundFont → GM.sf2: uses · SoundFont page centers on the bundled GM sound source.
- WAV → GM.sf2: uses · Audio generation or rendering may depend on the shared sound source.
- Static CI → Home: publishes · GitHub Actions deploys the static site entry points.
- Static CI → GM.sf2: publishes · Deployment includes the bundled asset.
