lilypond-devel
[Top][All Lists]
Advanced

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

Re: print transposed guitar chords on piano sheets (issue4626094)


From: Carl Sorensen
Subject: Re: print transposed guitar chords on piano sheets (issue4626094)
Date: Thu, 7 Jul 2011 17:23:03 -0600

On 7/7/11 12:26 PM, "Neil Puttock" <address@hidden> wrote:

> On 7 July 2011 19:09, Wols Lists <address@hidden> wrote:
> 
>> Which I probably didn't understand :-) BUT from what I remember did you
>> think that feeding a chord of, say, C into the formatter should chuck
>> out A as its result? Which is NOT what this does - it has to chuck out
>> both C *and* A. Bear in mind - that for EVERY chord the formatter has to
>> be run TWICE, so modifying all the formatters to loop will be a pain,
>> then anybody writing a new formatter has to remember to make it loop,
>> etc etc.

There's another way -- have the grob stencil call the formatter twice.  Then
the formatter doesn't have to be changed.  It just gets called twice.  I
think that's not particularly hard.

> 
> Why don't you apply the patch first before jumping to conclusions?

here's a permalink to the patch:

http://lilypond-frogs.2124236.n2.nabble.com/chord-name-engraver-plus-capo-sc
hemeing-away-tp5470055p5473400.html


> 
>> I really can't understand why having to modify EVERY formatter is better
>> than having to modify ONE engraver.
> 
> We don't manupulate markup in engravers unless it's trivial (e.g.,
> centring the octavation on a clef in the Clef_engraver).

I think I finally understand the point Neil was trying to make before.  Let
me try to explain it.

The engraver creates a grob, ChordName.  That grob can have any display
characteristics you want it to have.  The display characteristics are
defined by the scheme procedure that is the grob's stencil.

If the grob has a capoPitch property and a capoVertical property, then the
stencil procedure (responsible for creating the output stencil for the grob)
can easily call the chord formatter procedure twice and glue the two
stencils together appropriately.  So there's no reason to modify the
engraver.

I know that I'm really slow on this, but I think I finally got it.  The
engraver is *not* responsible for generating the printed output.  It *is*
responsible for creating a grob and setting any necessary/desired properties
for the grob, which will allow the stencil procedure to properly do the work
of generating the printed output.

HTH,

Carl




reply via email to

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