From 64e9a90d359048efc7ec8ab2d5b080bc739e15b5 Mon Sep 17 00:00:00 2001 From: hanwen Date: Sun, 18 Jan 2004 12:14:43 +0000 Subject: [PATCH] * Documentation/user/refman.itely (Rehearsal marks): document new functionality. * input/regression/rehearsal-mark-number.ly: new file. * input/regression/rehearsal-mark-letter.ly: new file. --- ChangeLog | 3 ++ Documentation/user/refman.itely | 55 +++++++++++++++++------ input/regression/rehearsal-mark-letter.ly | 26 +++-------- input/regression/rehearsal-mark-number.ly | 24 +++------- 4 files changed, 58 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4dcc8561a1..a74997b4c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2004-01-18 Han-Wen Nienhuys + * Documentation/user/refman.itely (Rehearsal marks): document new + functionality. + * input/regression/rehearsal-mark-number.ly: new file. * input/regression/rehearsal-mark-letter.ly: new file. diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 54cee83ff8..c8bd42b319 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -4180,17 +4180,41 @@ for the score. To print a rehearsal mark, use the @code{\mark} command: @lilypond[fragment,verbatim] \relative c'' { - c1 \mark "A" - c1 \mark "B" - c1 \mark "12" - c1 \mark "13" - c1 + c1 \mark \default + c1 \mark \default + c1 \mark #8 + c1 \mark \default + c1 \mark \default } @end lilypond The mark is incremented automatically if you use @code{\mark -\default}. The value to use is stored in the property -@code{rehearsalMark} is used and automatically incremented. +\default}, but you can also use an integer argument to set the mark +manually. The value to use is stored in the property +@code{rehearsalMark}. + +The style is defined by the property @code{markFormatter}. It is a +function taking the current mark (an integer) and the current context +as argument. It should return a markup object. In the following +example, @code{markFormatter} is set to a canned procedure. After a +few measures, it is set to function that produces a boxed number. + +@lilypond[verbatim,fragment,relative 2] + \property Score.markFormatter = #format-mark-numbers + c1 \mark \default + c1 \mark \default + \property Score.markFormatter + = #(lambda (mark context) + (make-bold-markup (make-box-markup (number->string mark)))) + c1 \mark \default + c1 \mark \default +@end lilypond + +The file @file{scm/translation-functions.scm} contains the definitions +of @code{format-mark-numbers} (the default format) and +@code{format-mark-letters}. They can be used as inspiration for other +formatting functions. + @cindex coda on bar line @cindex segno on bar line @@ -4206,17 +4230,14 @@ to access the appropriate symbol: c1 @end lilypond -In this case, during line breaks, -marks must also be printed at the end of the line, and not at the -beginning. Use the following to force that behavior: +In this case, during line breaks, marks must also be printed at the +end of the line, and not at the beginning. Use the following to force +that behavior: @example \property Score.RehearsalMark \override #'break-visibility = #begin-of-line-invisible @end example -See @inputfileref{input/test,boxed-molecule.ly} for putting boxes -around the marks. - @cindex fermatas @cindex coda @cindex segno @@ -4226,7 +4247,13 @@ around the marks. Internals: @internalsref{MarkEvent}, @internalsref{RehearsalMark} -Examples: @inputfileref{input/test,boxed-molecule.ly}. +Init files: @file{scm/translation-functions.scm} contains the +definition of @code{format-mark-numbers} and +@code{format-mark-letters}. They can be used as inspiration for other +formatting functions. + +Examples: @inputfileref{input/regression,rehearsal-mark-letter.ly}, +@inputfileref{input/regression,rehearsal-mark-number.ly}. @node Bar numbers diff --git a/input/regression/rehearsal-mark-letter.ly b/input/regression/rehearsal-mark-letter.ly index 3ee5d35e9e..48fbe81766 100644 --- a/input/regression/rehearsal-mark-letter.ly +++ b/input/regression/rehearsal-mark-letter.ly @@ -6,25 +6,13 @@ with @code{\mark NUMBER}, or with @code{Score.rehearsalMark}." } \version "2.1.7" - - -global = \notes { - s1 | \mark #6 - s1 | \mark \default - s1 | \mark \default - s1 | \mark \default +\score { \notes \relative c'' { + c1 | \mark #6 + c1 | \mark \default + c1 | \mark \default + c1 | \mark \default \property Score.rehearsalMark = #24 - s1 | \mark \default - s1 | \mark \default + c1 | \mark \default + c1 | \mark \default } - - -one = \notes \relative c { - c''1 c c c c c c } - - -\score{ -\context Staff << \global \one >> -} - diff --git a/input/regression/rehearsal-mark-number.ly b/input/regression/rehearsal-mark-number.ly index b48fddb6e5..8b8d3f4bcc 100644 --- a/input/regression/rehearsal-mark-number.ly +++ b/input/regression/rehearsal-mark-number.ly @@ -6,28 +6,18 @@ By setting @code{markFormatter} we may choose a different style of mark printing } \version "2.1.7" - - -global = \notes { +\score { + \notes \relative c''{ \property Score.markFormatter = #format-mark-numbers - s1 | \mark \markup { \musicglyph #"scripts-coda" } - s1 | \mark \default - s1 | \mark \default + c1 | \mark \markup { \musicglyph #"scripts-coda" } + c1 | \mark \default + c1 | \mark \default \property Score.markFormatter = #(lambda (mark context) (make-bold-markup (make-box-markup (number->string mark)))) - s1 | \mark \default - s1 | \mark \default + c1 | \mark \default + c1 | \mark \default } - - -one = \notes \relative c { - c''1 c c c c c c -} - - -\score{ -\context Staff << \global \one >> } -- 2.39.5