lilypond-user
[Top][All Lists]
Advanced

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

Re: chords as markups?


From: address@hidden
Subject: Re: chords as markups?
Date: Thu, 6 Sep 2012 07:41:43 +0200

On 6 sept. 2012, at 00:11, luis jure <address@hidden> wrote:

> 
> i've been asked to typeset in lilypond a couple of chords with some
> non-standard notation (please see the attached image).
> 
> i wouldn't know how to tweak the chord mode in lilypond to achieve
> this, so i was thinking of using \markup's. but elsewhere i'm using
> \chords, and the results are very different in both cases (spacing between
> characters, height of superscript, etc).
> 
> i'd need some help to either:
> 
> 1) tweak the chord notation in chord mode to obtain something like the
> attached image,
> 
> or
> 
> 2) tweak the \markup properties to look reasonable similar to something
> written in chord mode.
> 
> i'd be very grateful for any pointers.
> 
> 
> best,
> 
> 
> lj<chords.png>_______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user


not pretty, but effective...

#(define (kludge grob)
 (ly:grob-set-property! grob 'text "foo")
 (ly:text-interface::print grob))

\new ChordNames \chordmode {
 a b c:7
 \once \override ChordNames . ChordName #'stencil =
#(ly:make-unpure-pure-container kludge (lambda (grob b e) (kludge grob)))
 d
}

The reason we can't just override the text property is because it is junked and 
reset internally in LilyPond.
The unpure-pure-container makes sure that the chord is taken into account in 
horizontal spacing calculations.  Anytime you override a stencil, try to use an 
unpure-pure-container.

Cheers,
MS


reply via email to

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