[email protected] writes: > Hello, > > i have a question concerning the parser of LilyPond. I would like to > use it as standalone, so I can do some analysis on its AST > representation (i.e. the music expression tree): > > From the received AST I would like to read out all notation relevant > data e.g. notes, durations, beginnings and endings of slurs, > articulations, dynamics, etc. in order to do some analysis on this > data. > > The analysis is something like "find all exact repetitions of notes of > length 5". Then I would like to adapt the AST, i.e. change note > durations etc., and to serialize the modified AST back into LilyPond. > > Since I do not know scheme and the documentation of the parser and its > code are quite limited I just want to know whether it is easy to use > the parser in a standalone analysis or whether the music expression or > context tree is not suited for such a procedure?
The syntax has lexical tie-ins; the parser cannot be used independently of the interpretation. However, there is a number of top-level hooks that gets called for processing scores, markups, music, layout definitions and other stuff at top level. So by replacing all those hooks, you usually arrive at the expressions you want to be dealing with. That will not be really workable without changing the "Since I do not know Scheme" bit. -- David Kastrup _______________________________________________ lilypond-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-devel
