lilypond-user
[Top][All Lists]
Advanced

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

Re: trill spanner with "fancy" markup


From: Nicolas Sceaux
Subject: Re: trill spanner with "fancy" markup
Date: Sun, 04 Jan 2004 13:18:44 +0100
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3 (gnu/linux)

Sat, 03 Jan 2004 16:55:00 +0100, Vaclav a dit : 

 > Hello,
 > I need to typeset a trill with the "tr" at the beginning and moreover
 > being enclosed in parentheses, like this : "(tr~~~~~~~~~)".

 > I only need to concatenate two markups when setting edge-text, for the
 > first argument of #cons; for simple "tr~~~" this is

 > \property Voice.TextSpanner \set #'edge-text = #(cons
 > (make-musicglyph-markup "scripts-trill")  "").

 > So I tried

 > #(cons
 >     (combine-markup
 >         (make-musicglyph-markup "accidentals-leftparen")
 >         (make-musicglyph-markup "scripts-trill"))
 >     (make-musicglyph-markup "accidentals-rightparen"))

 > but this does not work (ERROR: In procedure car: ERROR: Wrong type
 > argument in position 1: () ). I am not sure if combine-markup is the
 > function I need, is there another one or should I do it in another way
 > altogether?

 > Thanks for suggestions.

 > Vaclav

Here are two suggestions. (I'm using LilyPond 2.0.1)
First, using temporary variables and the markup notation:
--------------------------
beginTrill=\markup { 
    \musicglyph #"accidentals-leftparen"
    \translate #(cons 0.5 -0.7) \musicglyph #"scripts-trill" 
    " " }

endTrill=\markup { \musicglyph #"accidentals-rightparen" }

\score {
    \notes {
        \property Voice.TextSpanner \set #'edge-text = #(cons beginTrill 
endTrill)
        c2\startTextSpan b c\stopTextSpan a
    }
}
--------------------------

The second, in plain scheme:
--------------------------
#(use-modules (ice-9 optargs) (lilypond markups))
\score {
    \notes {
        \property Voice.TextSpanner \set #'edge-text = 
          #(cons (markup (#:musicglyph "accidentals-leftparen")
                         (#:translate (cons 0.5 -0.7) (#:musicglyph 
"scripts-trill")))
                 (markup (#:musicglyph "accidentals-rightparen")))
        c2\startTextSpan b c\stopTextSpan a
    }
}
--------------------------
but this one requires an extra scheme lib that enables you to write
markups in scheme, in a way that looks like regular LilyPond markup
notation: http://nicolas.sceaux.free.fr/schemingly/markups.html
Ie, the LilyPond markup notation ---> scheme markup translation is
straight-forward.

nicolas





reply via email to

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