lilypond-user
[Top][All Lists]
Advanced

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

Re: Treble clef with optional octavation?


From: Marc Hohl
Subject: Re: Treble clef with optional octavation?
Date: Thu, 17 Sep 2009 17:00:19 +0200
User-agent: Thunderbird 2.0.0.23 (X11/20090817)

Alexander Kobel schrieb:
Hi, all,

anyone knows how to write a G clef, like in
    \clef "treble_8"
but with the octavation "8" in parentheses? (It's for a staff with a solo voice sung by either alto or baritone, and thus the octavation is optional.)
This solution (with a callback created by Neil Puttock) works fine:

#(define-public (parenthesize-me grob)
 (let* ((font (ly:grob-default-font grob))
(open (stencil-whiteout (ly:font-get-glyph font "accidentals.leftparen"))) (close (stencil-whiteout (ly:font-get-glyph font "accidentals.rightparen")))
        (me (ly:text-interface::print grob)))
       (ly:stencil-combine-at-edge
        (ly:stencil-combine-at-edge
         me X LEFT open)
        X RIGHT close)))

test = \relative c, {
 \override Staff.OctavateEight #'stencil = #parenthesize-me
 \clef "treble_8"
 c4 d e f
 g a b c
}

\score { \test }

Marc


Thanks,
Alexander


_______________________________________________
lilypond-user mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/lilypond-user






reply via email to

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