DesmosMIDI
Convert Standard MIDI Files into a prefilled Desmos graph that plays piano music via tone() synthesis—unbounded polyphony, sustain pedal, decay on gain, beat-proportional timeline, optional keyroll/amplitude viz.
V1 is not MIDI2Desmos-style Audio Trace; it uses documented tone(frequency, gain) with a global beat variable T.
Install
PyPI (after the first release is published):
pip install desmosmidi
desmosmidi setup
From a GitHub Release: download desmosmidi-*-py3-none-any.whl, then pip install desmosmidi-*.whl.
Development (this repo):
python3 -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
Cutting releases: docs/releasing.md.
Quickstart
See Quickstart.md for the full walkthrough.
desmosmidi setup
desmosmidi # terminal UI
desmosmidi play path/to/song.mid # build + open browser
Or build only: desmosmidi path/to/song.mid (writes dist/<song-name>/).
Keyroll + waveform (optional): desmosmidi path/to/song.mid --viz
Requirements
- Python 3.11+
- Desmos API key for embedded HTML player
- Modern browser with Web Audio (user gesture required for sound)
- Static HTTP server for exports that load
expr/chunks (notfile://)
Commands
| Command | Purpose |
|---|---|
desmosmidi setup |
Save API key to .env |
desmosmidi FILE.mid |
Build player under dist/ |
desmosmidi play FILE.mid |
Build + open in browser |
desmosmidi check FILE.mid |
Preview file info |
See docs/cli.md for flags (--viz, chunking, piano gate).
Output layout
dist/prelude/
player.html # Jinja player; inlined song.meta.json
song.meta.json # tempo map, duration, audio_only, viz pointers
expr/
manifest.json # chunk list + folder specs
chunk-0000.json # batched expressions
viz-data.json # keyroll table (only with --viz)
expressions.json # folder-ordered list (setState / primary load)
viz/notes.json # pitch range, pcm viewport (only with --viz)
expressions.md # paste fallback for desmos.com
song.report.json
song.report.md
Folders (collapsed by default in Desmos): clock (T, B, D, optional V), MIDI helpers (F_*, G_*), audio (tone_*), optional viz.
Player: Play/Stop, Bass (default 1.6×), Decay (default 3.65×), Output master gain. With --viz: Keyroll / Amplitude and No render. Details: docs/viz.md, docs/desmos-playback.md.
Documentation
| Doc | Contents |
|---|---|
| docs/README.md | Topic index |
| docs/viz.md | Keyroll, amplitude, player UX |
| docs/desmos-playback.md | tone(), clocks, API player |
| docs/tempo-map.md | Beats, BPM, ticker recipe |
| Quickstart.md | Setup and first export |
Status
V1 — CLI, MIDI parse, piano gate, sustain/reattack, unlimited voice lanes, chunked tone() export, HTML player, default audio-only export. pytest: 20 tests.
License
Apache License 2.0. See LICENSE and NOTICE (Desmos API disclaimer).
Metadata
Release files for desmosmidi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| desmosmidi-0.1.0.tar.gz | 51.6 kB | With provenance | Details for desmosmidi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| desmosmidi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for desmosmidi-0.1.0-py3-none-any.whl |
Total release size: 100.0 kB
Release files / desmosmidi-0.1.0.tar.gz
| Download URL | desmosmidi-0.1.0.tar.gz |
|---|---|
| Size | 51.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
53c046f99b77d1994475df2df402c64311bb11dea0ad33a1ebda9518e3517d57
|
|
BLAKE2b-256 checksum How to use checksums |
572fa54332ada982c25cee3077b109b54a7ebeb1c9be1c8a3854ee5011bcb573
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 22, 2026.
Transparency logRelease files / desmosmidi-0.1.0-py3-none-any.whl
| Download URL | desmosmidi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 48.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb8473507308bc2d9d0a0f9cfb55b638d5c245241cb20825a3a182643d4c79bd
|
|
BLAKE2b-256 checksum How to use checksums |
611923f2b50dd7aafdeb3a48f4e5153df2477d1d3fcbbf50aaeac4fef21a53c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 22, 2026.
Transparency logSecurity for desmosmidi 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for desmosmidi-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.