How jaynik-s/pianoannotations works
Piano Annotations converts MIDI into normalized note events, onset-based chord groups, RH/LH labels, and a JSON payload; a separate rendering stage loads that JSON, quantizes note starts onto shared time columns, and produces aligned ASCII and/or HTML. The graph follows the CLI-owned calls and shared layout used by both renderers. README documents these capabilities; sampled source supports the wiring shown, while details of any unsampled implementation are not inferred.
Main entry points: main.py CLI pipelines · midi_parser.py MIDI parser · quantizer.py Grid quantizer · renderer.py ASCII renderer
Components 18
MIDI analysis
- CLI pipelines
src/main.py - MIDI parser
src/midi_parser.py - Note normalization
src/midi_parser.py - Chord grouping
src/chord_grouping.py - Hand inference
src/hand_inference.py - JSON export
src/exporter.py
Annotation rendering
- JSON loader
src/quantizer.py - Grid quantizer
src/quantizer.py - Shared layout
src/renderer.py - ASCII renderer
src/renderer.py - HTML renderer
src/html_renderer.py
Shared models
- Note schemas
src/note_schema.py
Other components
- MIDI user
- Stage-one JSON
- ASCII annotation
- HTML annotation
- MIDI file
- pretty_midi
Connections 24
- MIDI user → CLI pipelines: invokes
- MIDI user → MIDI file: provides
- CLI pipelines → MIDI parser: parses via
- MIDI parser → MIDI file: reads
- MIDI parser → pretty_midi: loads with
- MIDI parser → Note normalization: normalizes
- Note normalization → Chord grouping: feeds notes
- CLI pipelines → Chord grouping: builds groups
- CLI pipelines → Hand inference: infers hands
- CLI pipelines → JSON export: builds payload
- JSON export → Stage-one JSON: writes JSON
- CLI pipelines → Stage-one JSON: writes via exporter
- CLI pipelines → JSON loader: loads for rendering
- JSON loader → Stage-one JSON: reads
- JSON loader → Grid quantizer: passes payload
- CLI pipelines → Grid quantizer: quantizes via loader
- CLI pipelines → ASCII renderer: renders ASCII
- CLI pipelines → HTML renderer: renders HTML
- ASCII renderer → Shared layout: builds systems
- HTML renderer → Shared layout: builds systems
- Grid quantizer → ASCII renderer: provides score
- Grid quantizer → HTML renderer: provides score
- ASCII renderer → ASCII annotation: writes output
- HTML renderer → HTML annotation: writes output