lilypond-devel
[Top][All Lists]
Advanced

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

Re: Universe of syntax possibilities, ONLY to skip over non-notes/chords


From: Carl Sorensen
Subject: Re: Universe of syntax possibilities, ONLY to skip over non-notes/chords
Date: Sat, 13 Nov 2010 03:12:40 -0700

On 11/12/10 7:11 AM, "Jeff Epstein" <address@hidden> wrote:

> I am writing a very-simplified LilyPond parser, just to analyze the notes,
> chords and rests/silences within a particular { }-block of LY code. I want
> to completely ignore all non-note (and non-chords and non-rest/silence)
> elements.
> 
> I am trying to understand all of the (at least most common) possibilities
> of syntax that can happen within LY blocks--that is, the inner-most
> blocks in which notes can be written (not score or book blocks, for
> example).

Well, the best advice I can give is that there is a parser, and you can get
the information from the parser.

Appendix C of the Notation Reference lists the lilypond grammar, as
extracted from the parser.

> Again, my only purpose is to skip everything but notes. I don't need
> to parse or understand any of it.

An easier approach might be to write an engraver that listens for notes and
rests, and then writes the information you need to a file.  You could also
write an engraver that acknowledges note heads and rests, and writes the
information you need to a file.

The difference between listening and acknowledging is that listening
captures stream events, and acknowledging captures grobs.

In either case, I think you'll spend much less time writing a custom
engraver to do this job than you would spend writing a simplified lilypond
parser.

Hope this helps,

Carl
> 
> PS. I wish this gmane-posting-form would just chop my lines for me,
> instead of the "You have lines longer than 80 characters. Fix that."
> error.  :(

You and me both!  I try to never use gmane to post if I can help it.




reply via email to

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