0

I need to extract the Score part from a Lilypond file (example .ly file here) with separated voices.

My idea is to read the Lilypond grammar from a file and create a PHP parser using the PHP builtin features for parsers.

My question is how to read the Lilypond grammar?

I did not find a standard EBNF grammar source for Lilypond. And the Lilypond parser written in BIson on Github does not help much.

WeSee
  • 3,158
  • 2
  • 30
  • 58
  • Perhaps you could consider using the [Abjad](https://abjad.github.io/) package for Python? It does have a quite advanced parser from what I can understand (check the class `LilyPondParser`, which is described in the Abjad API in the link above). Writing a parser yourself would be quite a task, as Josiah from Abjad [describes](https://groups.google.com/d/msg/music21list/50vR0VYQB4E/6qfw7FTKEvcJ). – gilbertohasnofb Mar 27 '20 at 14:07
  • @gilbertohasnofb: I don't want to go down to notes, just extract voices in ly-format. That's enough. I'll recombine them later e.g. with different pitches, different arrangements. So, I don't need a full ly-file parser, just a little bit of it. – WeSee Mar 27 '20 at 14:30

0 Answers0