Some newbie troubles, especially with text

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Some newbie troubles, especially with text

David Feuer-4
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.  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 ^).  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.  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.

Thanks for your consideration,
David Feuer

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Mats Bengtsson-4
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.



Quoting David Feuer <[hidden email]>:

> 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

>  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.

> 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
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Stephen-7
From: "Mats Bengtsson" <[hidden email]>
To: "David Feuer" <[hidden email]>
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.
>
>
>
> Quoting David Feuer <[hidden email]>:
>
>> 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 #'padding = #3.2
\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
  betweensystempadding = 3.8\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
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-devel 



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Graham Percival-2
In reply to this post by Mats Bengtsson-4

On 20-Mar-06, at 8:18 AM, Stephen wrote:

> 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.

Rehearsal marks _are_ just \markup that is aligned to barlines.  See
"Text marks" (particularly in the 2.7 docs)

- Graham



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Mats Bengtsson-4
Graham Percival wrote:

>
> On 20-Mar-06, at 8:18 AM, Stephen wrote:
>
>> 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.
>
>
> Rehearsal marks _are_ just \markup that is aligned to barlines.  See
> "Text marks" (particularly in the 2.7 docs)
>
Except that they only are typeset above the topmost stave,
not above every stave in scores with multiples staves.

  /Mats


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Stephen-7

From: "Mats Bengtsson" <[hidden email]>
To: "Graham Percival" <[hidden email]>
Cc: "Stephen" <[hidden email]>; "lily-devel"
<[hidden email]>
Sent: Monday, March 20, 2006 4:09 PM


> Graham Percival wrote:
>
>>
>> On 20-Mar-06, at 8:18 AM, Stephen wrote:
>>
>>> 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.
>>
>>
>> Rehearsal marks _are_ just \markup that is aligned to barlines.  See
>> "Text marks" (particularly in the 2.7 docs)
>>
> Except that they only are typeset above the topmost stave,
> not above every stave in scores with multiples staves.
>
>  /Mats

That still works for "Fine" and "D.C. al fine" which must be right-aligned
with the barline, but is usually on the topmost stave. Bottom line is we
have a system that works for them, considering how flexible it needs to be
anyway to cover all cases. The only generalization that we could make would
be a version of \mark that right-aligns, allows markup of the last bar of a
score, and uses a smaller font size by default (with a slightly smaller
padding as well) than \mark uses.

Stephen



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Mats Bengtsson-4
In reply to this post by Mats Bengtsson-4
Quoting Mats Bengtsson <[hidden email]>:

> Graham Percival wrote:
>
>>
>> On 20-Mar-06, at 8:18 AM, Stephen wrote:
>>
>>> 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.
>>
>>
>> Rehearsal marks _are_ just \markup that is aligned to barlines.  See
>> "Text marks" (particularly in the 2.7 docs)
>>
> Except that they only are typeset above the topmost stave,
> not above every stave in scores with multiples staves.

Continuing my own comment:

This can of course be customized, by adding the corresponding
engraver to the Staff context. A more serious limitation might
be that you cannot simultaneously typeset a \mark both above
and below the system (or stave), in contrast to text scripts
where you easily can do ^"above"_"below". Another problem is
that you cannot easily specify two different marks to appear
at the end of a line and at the beginning of the next line.

   /Mats



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Graham Percival-2

On 21-Mar-06, at 7:45 AM, Mats Bengtsson wrote:

>>> Rehearsal marks _are_ just \markup that is aligned to barlines.  See
>>> "Text marks" (particularly in the 2.7 docs)
>>>
>> Except that they only are typeset above the topmost stave,
>> not above every stave in scores with multiples staves.
>
> Continuing my own comment:
>
> This can of course be customized, by adding the corresponding
> engraver to the Staff context. A more serious limitation might
> be that you cannot simultaneously typeset a \mark both above
> and below the system (or stave), in contrast to text scripts
> where you easily can do ^"above"_"below". Another problem is
> that you cannot easily specify two different marks to appear
> at the end of a line and at the beginning of the next line.

Very true, sorry.

I'd like to add an example of moving the engraver around, but the below
code doesn't work -- it still only prints the mark above the topmost
stave.  Any ideas?

\version "2.7.40"
{
   \new Score \with {
     \remove "Mark_engraver"
   }
   <<
     \new Staff \with {
       \consists "Mark_engraver"
     }
     { c''1 \mark "foo" c'' }
     \new Staff \with {
       \consists "Mark_engraver"
     }
     { c'1 c' }
   >>
}



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Stephen-7
From: "Graham Percival" <[hidden email]>
To: "Mats Bengtsson" <[hidden email]>
Cc: "lily-devel" <[hidden email]>
Sent: Tuesday, March 21, 2006 12:08 PM
Subject: Re: Some newbie troubles, especially with text


>
> On 21-Mar-06, at 7:45 AM, Mats Bengtsson wrote:
>
>>>> Rehearsal marks _are_ just \markup that is aligned to barlines.  See
>>>> "Text marks" (particularly in the 2.7 docs)
>>>>
>>> Except that they only are typeset above the topmost stave,
>>> not above every stave in scores with multiples staves.
>>
>> Continuing my own comment:
>>
>> This can of course be customized, by adding the corresponding
>> engraver to the Staff context. A more serious limitation might
>> be that you cannot simultaneously typeset a \mark both above
>> and below the system (or stave), in contrast to text scripts
>> where you easily can do ^"above"_"below". Another problem is
>> that you cannot easily specify two different marks to appear
>> at the end of a line and at the beginning of the next line.
>
> Very true, sorry.
>
> I'd like to add an example of moving the engraver around, but the below
> code doesn't work -- it still only prints the mark above the topmost
> stave.

That is because you put the mark on the topmost stave.

  Any ideas?

>
> \version "2.7.40"
> {
>   \new Score \with {
>     \remove "Mark_engraver"
>   }
>   <<
>     \new Staff \with {
>       \consists "Mark_engraver"
>     }
>     { c''1 \mark "foo" c'' }
>     \new Staff \with {
>       \consists "Mark_engraver"
>     }
>     { c'1 c' }
>   >>
> }
>
>

Try this instead:

\version "2.7.40"
{
   \new Score \with {
     \remove "Mark_engraver"
   }
   <<
     \new Staff \with {
       \consists "Mark_engraver"
     }
     { c''1 c'' }
     \new Staff \with {
       \consists "Mark_engraver"
     }
     { c'1 \mark "foo" c' }
   >>
}

Stephen

>
> _______________________________________________
> lilypond-devel mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-devel


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Graham Percival-2
In reply to this post by Graham Percival-2

On 21-Mar-06, at 10:53 AM, Stephen wrote:

> That is because you put the mark on the topmost stave.
>
>>     { c''1 \mark "foo" c'' }
>>     { c'1 c' }

Whoops.  For some reason I was thinking that the \mark would get
applied to every staff, despite the context changing.

Thanks, applied to CVS.
- Graham



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Mats Bengtsson-4
In reply to this post by Mats Bengtsson-4
Quoting Stephen <[hidden email]>:
> That still works for "Fine" and "D.C. al fine" which must be
> right-aligned with the barline, but is usually on the topmost stave.
> Bottom line is we have a system that works for them, considering how
> flexible it needs to be anyway to cover all cases. The only
> generalization that we could make would be a version of \mark that
> right-aligns, allows markup of the last bar of a score, and uses a
> smaller font size by default (with a slightly smaller padding as
> well) than \mark uses.

Someone else probably wants a version that left aligns and uses
bold font, not to mention ... Therefore, it's possible for you to make
your own favourite command, see Sect, "11.1.3 Extending music syntax"
and "11.1.6 Using LilyPond syntax inside Scheme" in the manual if you
want a command that
takes a text argument. Or even simpler, add a definition like
the following in a file myfavouritemacros.ly:

DS = {
\once \override Score.RehearsalMark #'break-visibility =
#begin-of-line-invisible
\once \override Score.RehearsalMark #'self-alignment-X = #right
\mark \markup{\smaller "D.S. al Fine" }
}

Then, you can \include it wherever in whatever .ly file you have
and use it like c1 \DS \bar "|."

  /Mats



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some newbie troubles, especially with text

Stephen-7
From: "Mats Bengtsson" <[hidden email]>
To: "Stephen" <[hidden email]>
Cc: "Graham Percival" <[hidden email]>; "lily-devel"
<[hidden email]>
Sent: Tuesday, March 21, 2006 3:43 PM
Subject: Re: Some newbie troubles, especially with text


> Quoting Stephen <[hidden email]>:
>> That still works for "Fine" and "D.C. al fine" which must be
>> right-aligned with the barline, but is usually on the topmost stave.
>> Bottom line is we have a system that works for them, considering how
>> flexible it needs to be anyway to cover all cases. The only
>> generalization that we could make would be a version of \mark that
>> right-aligns, allows markup of the last bar of a score, and uses a
>> smaller font size by default (with a slightly smaller padding as well)
>> than \mark uses.
>
> Someone else probably wants a version that left aligns and uses
> bold font, not to mention ... Therefore, it's possible for you to make

I am referring to text such as "Fine" which tends to be in regular text
right aligned above the last measure to be played. This is standard
practice, just as the dynamic marks are in extra bold italic rather than
regular font. The default font size for \markup is 1, but for \mark, it is
2. It is a good default for rehearsal marks, but not for "D.S. al fine". I
am using my experience as a piano player as a guide. Lilypond is meant to
adhere to standared engraving practices. So I don't think that someone else
probably wants a version that left aligns and uses a bold font. This
particuliar case comes up often enough in scores to get its own defaults in
Lilypond.

> your own favourite command, see Sect, "11.1.3 Extending music syntax" and
> "11.1.6 Using LilyPond syntax inside Scheme" in the manual if you want a
> command that
> takes a text argument. Or even simpler, add a definition like
> the following in a file myfavouritemacros.ly:
>
> DS = {
> \once \override Score.RehearsalMark #'break-visibility =
> #begin-of-line-invisible
> \once \override Score.RehearsalMark #'self-alignment-X = #right
> \mark \markup{\smaller "D.S. al Fine" }
> }
>
> Then, you can \include it wherever in whatever .ly file you have
> and use it like c1 \DS \bar "|."

I am thinking more along the lines of:

\bar "|." \markfine "D.S. al fine"

So it would work exactly like \mark, but with different defaults. The need
to change the font defaults of  \mark is disguised by using "\mark \markup",
because the font will probably use the \markup font defaults. \mark "D.S. al
fine" uses font-size = 2.

Stephen

>
>  /Mats
>



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel