I have a lot of lilypond files each representing a single musical piece. There are many kinds of instrumentations in the lilypond files.
I want to get some simple statistics from a single lilypond file as:
- number of systems (which instruments are involved?)
- higest note in each system
- lowest note in each system
- shortest note in each system
- number of bars in the piece
- length of audio-file produces by lilypond
A sample output could be:
piece: silent night system 1: - instrument: trumpet - transposition: bes (for trumpet in Bb) - clef: treble - key: e-flat major - key signature: es (3x b) - lowest note: c1 - highest note: d2 - shortest note: 4 (quarter note) - max-chord: 1 (1 note at a time) system 2: - instrument: piano - transposition: c - clef: treble/bass - key: e-flat major - key signature: es (3x b) - lowest note: c1 - highest note: d2 - shortest note: 4 (quarter note) - max-chord: 4 (4 notes at a time)
I a looking for a script that takes a lilypond source file
.ly as input and outputs the analysis data in structured format (JSON, YML,...).
There seems to be no easy way to achieve this. I found Music21 but it is not directly related to Lilypond and that approach seems overly complex for my simple analysis.