jdxi_editor.midi.music.pdf_export
Export a MIDI file to sheet music PDF (music21 + LilyPond) for use by the app menu. Uses the same logic as piano.py for consistent LilyPond behavior.
Functions
|
Abbreviation for staff label (e.g. 'Piano' -> 'Pno.', long names truncated). |
|
Export a MIDI file to a PDF in the same directory (stem.pdf). |
|
Minimal cleanup with safe quantization. |
|
|
|
Ensure every part has at least one Measure so LilyPond export does not hit context bugs. |
|
|
|
|
|
Remove any parts that have no notes, chords, or rests. |
Module Contents
- jdxi_editor.midi.music.pdf_export.short_name(name: str, max_len: int = 12) str[source]
Abbreviation for staff label (e.g. ‘Piano’ -> ‘Pno.’, long names truncated).
- jdxi_editor.midi.music.pdf_export.export_midi_to_pdf(midi_path: str | pathlib.Path) str | None[source]
Export a MIDI file to a PDF in the same directory (stem.pdf). Mirrors piano.main() for consistent LilyPond behavior. Returns the PDF path or None on failure.
- jdxi_editor.midi.music.pdf_export.cleanup_score(score: music21.stream.Score | music21.stream.Part | music21.stream.Opus) music21.stream.Stream[music21.Music21Object | Any] | None[source]
Minimal cleanup with safe quantization.
- jdxi_editor.midi.music.pdf_export.annotate_staffs(score: music21.stream.Score | music21.stream.Part | music21.stream.Opus, track_names: list[str])[source]
- jdxi_editor.midi.music.pdf_export._ensure_parts_have_measures(score: music21.stream.Score) None[source]
Ensure every part has at least one Measure so LilyPond export does not hit context bugs.
- jdxi_editor.midi.music.pdf_export.export_score(midi_file: pathlib.Path, midi_file_stem: str, score) tuple[pathlib.Path, pathlib.Path][source]