10.12.2 Translation process

The outer loop is in Global_context::iterate (). At each timestep in the music, translation proceeds by calling the following methods in turn:

  1. start_translation_timestep () is called before any user information enters the translators, i.e., no property operations (\set, \override, etc.) or events have been processed. In the timestep in which a translator is initialized, it does not receive this call, because the timestep starts before the translator is initialized.
  2. Music iterators do various things in an order that depends on the user’s music. Some of them call translator methods and others are less direct.
    • listen_… () is called when the iterator broadcasts an event, e.g., listen_note () for note-event.
    • initialize () is called when the translator’s context is created.
    • The context hierarchy may be rearranged in other ways.
    • Context properties may be changed.
  3. pre_process_music () is called to do work that should occur regardless of Score.skipTypesetting.
  4. process_music () is called unless Score.skipTypesetting is true. This is the earliest stage of the timestep where the engraver may create a grob.
  5. acknowledge_… () is called for each newly created grob, e.g., acknowledge_note_column () for NoteColumn.
  6. process_acknowledged () is normally called at least once, but is skipped entirely when Score.skipTypesetting is true. Engravers may create more grobs at this stage, causing additional calls to acknowledgers, and again to this method (iteratively, not recursively).
  7. stop_translation_timestep () is called after all user information has been processed, before beginning the translation for the next timestep. Engravers are not allowed to create any more grobs at this stage – they would not be acknowledged – though it is not unusual to set properties of grobs that were created earlier.

LilyPond Contributor’s Guide v2.27.1 (development-branch).