lilypond-devel
[Top][All Lists]

## Re: Some newbie troubles, especially with text

 From: Stephen Subject: Re: Some newbie troubles, especially with text Date: Mon, 20 Mar 2006 10:18:53 -0600

From: "Mats Bengtsson" <address@hidden>
Sent: Monday, March 20, 2006 5:00 AM


Please send usage questions like these to the lilypond-user mailing

list. Also, please always tell what LilyPond version you use, to be sure to get a relevant answer.



Main problem: I can't seem to figure out how to make even simple text look decent. There seem to be 7000 different options for dealing with text, all of them confusing. In this case, I just want simple "Fine" and "D.S. al Fine", but I really can't figure out how to make it work right. The example given in the docs, using \mark, doesn't work, and that seems like a nasty hack anyways.


Exactly what doesn't work? Are you sure that you read in the version of the manual corresponding to the version you use? I think there has been a bug in some 2.7.x versions so that the alignment of \mark didn't work correctly. Maybe that's what you have noticed?


I _think_ what I want is for the end of the D.S. al Fine to line up with the _right_ side of the last note in the piece, but I could only get it to line up with the _left_ side (using ^).
Try something like
\once \override TextScript #'self-alignment-X = #RIGHT



Fine should be right-aligned with the following barline, not a note. That is what makes it difficult. This is a small example of how I do it, but it does not line up perfectly. The only way to line up text to the barline now is to use Rehearsal Marks. I agree that we need a better way to line up text like "D.C. al fine" to the barline, or rather right aligned.

global = {
#(define-public (my-format-metronome-markup event context)
(let*
((dur  (ly:music-property event 'tempo-unit))
(count (ly:music-property event 'metronome-count))
(note-mark (make-smaller-markup
(make-note-by-number-markup (ly:duration-log dur)
(ly:duration-dot-count dur)
1))))
(make-line-markup
(list
(make-general-align-markup Y DOWN note-mark)
(make-simple-markup  "=")
(make-simple-markup (number->string count))

))))

\set Score.metronomeMarkFormatter = #my-format-metronome-markup
\override Score.MetronomeMark #'extra-offset = #'(-3.2 . 0)
%\override Staff.StaffSymbol #'color = #'blue

\set Staff.midiInstrument = "trumpet"
#(override-auto-beam-setting '(end 1 16 4 4) 1 2 'Staff)
#(override-auto-beam-setting '(end 1 8 2 4) 1 2 'Staff)
\override TupletBracket  #'bracket-visibility = ##f
\tupletUp
}

reveille = {
\global
\time 2/4
\tempo 4=152
\partial 8

g,-.\f | \repeat percent 2 { c-. e16 c g,8-. e-. | }
c-. e16 c g,8-. c-. | e4( c8) g,-. |
\repeat percent 2 { c-. e16 c g,8-. e-. | } \break

c-. e16 c g,8-. g,-. | c4.^\markup { \translate #(cons 1.75 0) "Fine" } \bar "||"
e8 | e-. e-. e-. e-. | g4( e8) c-. | e-. c-. e-. c-. |
e4( c8) e-. | e-. e-. e-. e-. | g4( e8) c-. |

e-. c-. g,-. g,-. | c4.^\markup { \translate #(cons -3 0) "D.C. al fine" } \bar "|."
}

\paper {
#(set-paper-size "letter" 'landscape)
hsize = 139.7\mm
vsize = 215.9\mm
%leftmargin = 144.05\mm
linewidth = 122\mm
%aftertitlespace = 3.8\mm
%betweentitlespace = 0\mm
printpagenumber = ##f
indent = 0\mm
}

\book {

\score { \header { piece = "Reveille" } \transpose c c'' { \reveille \break } \layout { } }
}




Not being an expert engraver, I'm not actually sure /what/ I want, but whatever it is, I'm sure I don't know how to get it. Suggestion 1: teach Lilypond some of the standard text markings: Fine, D.S. al Fine, D.C. al Fine, D.S., D.C., and to Coda would be good to build in, particularly because they should affect MIDI playing.


If you search the mailing list archives, you will find a number of related discussions over the years. Two arguments againts this is that
there are so many different versions of D.S, D.C with and without codas
and with different notations ("segno" versus a segno mark, for example)
that it would be very hard both to implement and to use. Also, the MIDI

support is mainly intended to be used for proof reading ("proof listening") a score while typesetting it and in such situations you don't want the MIDI file to reflect all the D.S.


I don't think Rehearsal Marks are as flexible as \markup. There may still be a need to align markup text to barlines rather than just to notes.

Stephen


P.S. O.K. So I tried using Rehearsal Marks to get the same effect and came up with something satisfactory after browsing the Lilypond-User Archives. Several overides are needed to get the font lined up like it does with \markup. This eliminates having to use \translate to line up the text to the barline though.

g,-.\f | \repeat percent 2 { c-. e16 c g,8-. e-. | }
c-. e16 c g,8-. c-. | e4( c8) g,-. |
\repeat percent 2 { c-. e16 c g,8-. e-. | } \break

c-. e16 c g,8-. g,-. | c4.%{^\markup { \translate #(cons 1.75 0) "Fine" }%} \bar "||"
\once \override Score.RehearsalMark #'self-alignment-X = #right
\once \override Score.RehearsalMark #'font-size = #0
\once \override Score.RehearsalMark #'padding = #0.5
\mark "Fine"
e8 | e-. e-. e-. e-. | g4( e8) c-. | e-. c-. e-. c-. |
e4( c8) e-. | e-. e-. e-. e-. | g4( e8) c-. |

e-. c-. g,-. g,-. | c4.%{^\markup { \translate #(cons -3 0) "D.C. al fine" }%} \bar "|."
\once \override Score.RehearsalMark #'self-alignment-X = #right
\once \override Score.RehearsalMark #'break-visibility = #all-visible
\once \override Score.RehearsalMark #'font-size = #0
\once \override Score.RehearsalMark #'padding = #0.5
\mark "D.C. al fine"




It'd also be good to make a category of sorts for tempo markings: rit., a tempo, etc. Please try to improve the documentation for alignment in general and text in particular, and try to make it more friendly. It's not a good sign that text shows up in the "advanced" section of the manual.


There are thousands of different settings that you may want to do in LilyPond. The next time, you might want to move a dynamic sign slightly
or change the layout of a title or ... The point is that it's impossible

to cover all of it in the manual. Therefore there are several other sources of information available, such as the Tips and Tricks document, the Regression Test document (in spite of its name, it's a very useful collection of examples), the LilyPond Snippet Repository (see www.lilypond.org -> Documentation) and of course the mailing list
with its archives.

Once you have found a nice solution that you like, please don't hesitate
to send it to the mailing list and/or add it to the snippet repository
and/or suggest additions/modifications to the documentation, to make
the program even more useful to others.

/Mats

_______________________________________________
lilypond-devel mailing list