lilypond-user
[Top][All Lists]
Advanced

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

Re: Creating LilyPond Object Models


From: David Nalesnik
Subject: Re: Creating LilyPond Object Models
Date: Thu, 23 Apr 2015 08:22:31 -0500



On Thu, Apr 23, 2015 at 3:25 AM, Johannes Rohrer <address@hidden> wrote:
* 2015-04-23 01:29 +0200:
> Translators are program elements that convert music expressions to output.
>  Engravers are translators that create printed output.  Performers are
> translators that create midi output.
>
> Translators examine the music expressions that are contained in the
> context, and create output elements.  For the case of engravers (which
> create graphical output), the output elements are grobs.  The grobs have
> properties that are used to create their appearance on the page.

This is very simplified. Translators do not operate on music expressions
directly, and music expressions are not themselves contained in
contexts. This level of understanding may get you relatively far as a
user, but is not even sufficient for reading the Internals Reference.

It has been a while since I last tried to wrap my head around this, but
from memory:

Program elements called Iterators turn music expressions into a
time-ordered stream of Events sorted into contexts. The different types
of Events produced at this stage are listed here:

<http://lilypond.org/doc/v2.18/Documentation/internals/music-expressions>


The structure of LilyPond in this regard is thoroughly confusing, and the Internals Reference does not clarify the relationships.  The naming is particularly unhelpful for trying to figure out what's going on.  (I don't want to go into that as it will confuse the goal of this thread!)  

Lately, I've had occasion to try to piece together what's going on, so I'd like to amend part of your helpful description.

This list you link to above not what is produced by iterators.  It represents what is *fed* to the iterators, which convert music events, like NoteEvent, DynamicEvent, etc., into stream events.  Stream events are what is sent along to the translators, as you describe,  The list at 

<http://lilypond.org/doc/v2.18/Documentation/internals/music-classes>

lists the various sorts of stream events which are input for translators.

There is a (admirably well-hidden)  section of the Contributor's Guide which touches on this.  See

http://lilypond.org/doc/v2.19/Documentation/contributor/articulations-on-eventchord

If you look at the output of
\displayMusic { c' }
or
#(display #{ { c' } #})

you will see (as I understand it) the output of the parser.  In it you will see NoteEvent.  It is this sort of _expression_ which forms the input at the iteration stage, which will derive stream-events which will be sent to relevant contexts (created at this stage, if necessary).

Caveat: This all is mostly of interest from a developer's perspective!  It is not something which a user need know to use LilyPond effectively. 
  
--David

reply via email to

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