lilypond-user
[Top][All Lists]
Advanced

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

Re: Passing \tweak-s to engravers


From: Urs Liska
Subject: Re: Passing \tweak-s to engravers
Date: Wed, 4 Jul 2018 23:17:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0



Am 14.06.2018 um 15:45 schrieb David Kastrup:
Urs Liska <address@hidden> writes:

Am 14.06.2018 um 13:32 schrieb David Kastrup:

  From the Engraver tutorial in the Contributor's Guide (Acknowledging grobs):

         Acknowledge functions are called in the order engravers are
      ‘\consist’-ed (the only exception is if you set ‘must-be-last’ to ‘#t’).

         There will always be a call to ‘process-acknowledged ()’ whenever
      grobs have been created, and _reading_ stuff from grobs should be
      delayed until then since other acknowledgers might _write_ stuff into a
      grob even after your acknowledger has been called.  So the basic
      workflow is to use the various acknowledgers to _record_ the grobs you
      are interested in and _write_ stuff into them (or do read/write stuff
      that more or less is accumulative and/or really unrelated to other
      engravers), and then use the ‘process-acknowledged ()’ hook for
      processing (including _reading_) the grobs you had recorded.

         You can create new grobs in ‘process-acknowledged ()’.  That will
      lead to a new cycle of ‘acknowledger ()’ calls followed by a new cycle
      of ‘process-acknowledged ()’ calls.

Note that tweaks are applied by the acknowledger in the Tweak_engraver.
OK, this seems to be the culprit. Do I get this right that the tweaks
are applied to a grob only *after* my grob acknowledger sees the grob?
Then it is relevant that ...

I repeat my advice to read the Engraver tutorial.  Really.  In this
case, the central paragraph I quoted is very, very relevant.
... I did read that but it didn't help me. Nowhere did *I* write into
grobs or even created new ones, so I couldn't actually know these
paragraphs are relevant to my case.
Come again?

         There will always be a call to ‘process-acknowledged ()’ whenever
      grobs have been created, and _reading_ stuff from grobs should be
      delayed until then
You are reading stuff from grobs, so this should be delayed to the
process-acknowledged stage.  It says you should do this for _reading_.
Not for creating grobs or writing into grobs.  For _reading_.

This is just another point for the case I'm often making that much of
our documentation on that level is too complicated insofar as you're
only getting to the point of understanding it when you don't really
need it anymore.
I'll readily admit that Scheme engravers are underdocumented.  But the
engraver tutorial here, once you get pointed to it, is very clear about
the order of things and what to do when.

Can you point to anything that could be clearer here?

Unfortunately not, right now. It's not unclear, but I'd say it's a typical case of our documentation that you will only be able to understand when you've reached the level where you don't really need it anymore (at least not more than as an occasional reminder). I *think* I have now more or less understood what that section says, but only after your repeated hints and some experience with my own code - which I wouldn't have been able to make without your help, i.e. only from reading the docs. I think what would be useful (necessary) is significantly more verbosity and slow pace, but that's presumably out of scope of the reference manual.

Best
Urs



reply via email to

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