[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: LilyPond parser as standalone

From: David Kastrup
Subject: Re: LilyPond parser as standalone
Date: Sun, 02 Nov 2014 17:27:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

address@hidden 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

That will not be really workable without changing the "Since I do not
know Scheme" bit.

David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]