diff options
author | Graham Percival <graham@percival-music.ca> | 2008-04-28 20:43:41 -0700 |
---|---|---|
committer | Graham Percival <graham@percival-music.ca> | 2008-04-28 20:43:41 -0700 |
commit | b1e5e3effc79072fd1f2f073dc5be51a1655a3c4 (patch) | |
tree | c0143da29dba7edff4dfbfcf3b3e4d8477f9d70c | |
parent | eb43b9cc24916bb10568c01e6ac4f4ee20d15418 (diff) |
Neil's patch for hairpin to bar line.
- remove hairpinToBarline snippet from expressive.itely
- remove hairpinToBarline from define-context-properties.scm
- change hairpin regression tests to reflect 'to-barline default
- remove backwards compatibility support for hairpinToBarline
- add 'to-barline snippet for Hairpin to input/new
- improve adding-text-indications-to-metronome-marks.ly
-rw-r--r-- | Documentation/de/user/expressive.itely | 5 | ||||
-rw-r--r-- | Documentation/es/user/expressive.itely | 6 | ||||
-rw-r--r-- | Documentation/fr/user/expressive.itely | 5 | ||||
-rw-r--r-- | Documentation/user/expressive.itely | 7 | ||||
-rw-r--r-- | input/new/adding-text-indications-to-metronome-marks.ly | 91 | ||||
-rw-r--r-- | input/new/setting-hairpin-behavior-at-bar-lines.ly | 17 | ||||
-rw-r--r-- | input/regression/hairpin-barline-break.ly | 11 | ||||
-rw-r--r-- | input/regression/hairpin-to-barline-mark.ly | 10 | ||||
-rw-r--r-- | input/regression/hairpin-to-barline.ly | 11 | ||||
-rw-r--r-- | lily/dynamic-engraver.cc | 10 | ||||
-rw-r--r-- | python/convertrules.py | 15 | ||||
-rw-r--r-- | scm/define-context-properties.scm | 4 |
12 files changed, 96 insertions, 96 deletions
diff --git a/Documentation/de/user/expressive.itely b/Documentation/de/user/expressive.itely index b51c183394..a7e8afc12c 100644 --- a/Documentation/de/user/expressive.itely +++ b/Documentation/de/user/expressive.itely @@ -184,10 +184,7 @@ fällt, endet die Klammer an der direkt vorhergehenden Taktlinie. Diese Einstellung lässt sich aber durch die Eigenschaft @code{hairpinToBarline} verändern. -@lilypond[quote,ragged-right,fragment,verbatim,relative=2] -\set hairpinToBarline = ##f -c4\< c2. c4\! -@end lilypond +@c TODO: Add link to new snippet for #'to-barline In manchen Situationen kann auch der @code{\espressivo}-Befehl geeignet sein, ein An- und Abschwellen einer Note anzuzeigen. diff --git a/Documentation/es/user/expressive.itely b/Documentation/es/user/expressive.itely index 1e26f4e573..030cbc59d1 100644 --- a/Documentation/es/user/expressive.itely +++ b/Documentation/es/user/expressive.itely @@ -253,11 +253,7 @@ nota final cae sobre el principio de un compás, el anterior. Esto se puede modificar estableciendo la propiedad @code{hairpinToBarline}: -@lilypond[verbatim,quote,ragged-right,fragment,relative=2] -e4\< e2. e1\! -\set hairpinToBarline = ##f -e4\< e2. e1\! -@end lilypond +@c TODO: Add link to new snippet for #'to-barline @cindex espressivo, articulación diff --git a/Documentation/fr/user/expressive.itely b/Documentation/fr/user/expressive.itely index 5727f9b293..b8b906f762 100644 --- a/Documentation/fr/user/expressive.itely +++ b/Documentation/fr/user/expressive.itely @@ -187,10 +187,7 @@ barre de mesure qui la précède. Ce comportement peut être annulé en assignant @emph{faux} (lettre @q{f}) à la propriété @code{hairpinToBarline} : -@lilypond[quote,ragged-right,fragment,verbatim,relative=2] -\set hairpinToBarline = ##f -c4\< c2. c4\! -@end lilypond +@c TODO: Add link to new snippet for #'to-barline On peut avoir recours à l'indication @code{\espressivo} pour indiquer un crescendo puis un decrescendo sur une seule note. diff --git a/Documentation/user/expressive.itely b/Documentation/user/expressive.itely index c0ac7b89ef..50d9e322c4 100644 --- a/Documentation/user/expressive.itely +++ b/Documentation/user/expressive.itely @@ -231,12 +231,7 @@ on the immediately preceding bar line. The following example illustrates this behavior: @c This example currently does not work. -pm - -@lilypond[verbatim,quote,ragged-right,fragment,relative=2] -e4\< e2. e1\! -\set hairpinToBarline = ##f -e4\< e2. e1\! -@end lilypond +@c TODO: Add link to new snippet for #'to-barline Spacer notes are needed to engrave multiple marks on one note. diff --git a/input/new/adding-text-indications-to-metronome-marks.ly b/input/new/adding-text-indications-to-metronome-marks.ly index 630ee5a1df..59ce545537 100644 --- a/input/new/adding-text-indications-to-metronome-marks.ly +++ b/input/new/adding-text-indications-to-metronome-marks.ly @@ -1,59 +1,58 @@ -\version "2.11.43" +\version "2.11.45" \header { - lsrtags = "expressive-marks,text,tweaks-and-overrides" + lsrtags = "expressive-marks,tweaks-and-overrides" texidoc = " Using Scheme code to override the stencil for @code{MetronomeMark} objects, this example allows the creation of metronome marks which include -text directions. The function @code{\tempoChangeMarkup} is called with three -strings: the text label, note duration, and beats per minute. To print the -new metronome mark, this is followed by the standard @code{\tempo} command. +text directions. The function @code{\movement} is called with three +arguments: the text label, note duration, and beats per minute. " doctitle = "Adding text indications to metronome marks" } -% Thanks to Alexander Kobel for this snippet +#(define-markup-command (mvt layout props arg) (markup?) + (interpret-markup layout props + (markup #:huge #:bold arg))) -tempoMarkLabelSize = #0 -tempoMarkNoteSize = #-6 +#(define (string->duration duration-string) + "Parse the `duration-string', e.g. ''4..'' or ''breve.'', and return a duration object." + (let* ((length (string-length duration-string)) + (dot-index (or (string-index duration-string #\.) length)) + (len (substring duration-string 0 dot-index)) + (dots (- length dot-index))) + (ly:make-duration (cond ((string=? len "breve") -1) + ((string=? len "longa") -2) + ((string=? len "maxima") -3) + (else (log2 (string->number len)))) + dots 1 1))) -#(define (tempoChangeMarkupFactory grob label noteValue tempo) - (interpret-markup - (ly:grob-layout grob) - (ly:grob-alist-chain grob (ly:output-def-lookup (ly:grob-layout grob) 'text-font-defaults)) - (markup - #:fontsize tempoMarkLabelSize #:italic #:concat (label (if (string-null? label) "(" " (" )) - #:hspace -1 - #:fontsize tempoMarkNoteSize #:general-align Y DOWN #:note noteValue UP - #:fontsize tempoMarkLabelSize #:italic #:concat( "= " tempo ")" ) - ) - )) +movement = #(define-music-function (parser location text duration count music) + (string? string? integer? ly:music?) + (define (format-movement-markup dur count context) + (markup #:mvt text #:hspace 1 + #:concat ("(" #:general-align Y DOWN #:smaller #:note duration 1) + "=" + #:concat ((number->string count) ")"))) + #{ + \set Score.metronomeMarkFormatter = #$format-movement-markup + \set Score.tempoWholesPerMinute = #$(ly:moment-mul (ly:make-moment count 1) + (ly:duration-length + (string->duration duration))) + \set Score.tempoUnitDuration = #$(string->duration duration) + \set Score.tempoUnitCount = $count + $music + \set Score.metronomeMarkFormatter = #format-metronome-markup + #}) -#(define (tempoChangeStencil label noteValue tempo) - (lambda (grob) - (tempoChangeMarkupFactory grob label noteValue tempo) - )) +\layout { ragged-right = ##f } -tempoChangeMarkup = #(define-music-function (parser location label noteValue tempo) (string? string? string?) - #{ - \once \override Score.MetronomeMark #'stencil = #(tempoChangeStencil $label $noteValue $tempo) - #}) - -\relative c' { - \time 4/4 - \clef treble - % initialize the override - \tempoChangeMarkup #"Moderato" #"4" #"63" - % markup is printed - \tempo 4 = 63 - c4 d e f - g a b c - \time 6/4 - \mark \default - \tempoChangeMarkup #"presto" #"2." #"90" - \tempo 2. = 90 - c2. g \break - e \tempoChangeMarkup #"handling collision with RehearsalMark" #"4" #"120" \tempo 4 = 120 c - \time 4/4 - \mark \default - c1 +\relative c' { + \time 3/4 + \movement "Allegro" "2." #92 + c2 e4 + g2. + \movement "Moderato" "4" #104 + f4 e d + \tempo 4 = 92 + c2. } diff --git a/input/new/setting-hairpin-behavior-at-bar-lines.ly b/input/new/setting-hairpin-behavior-at-bar-lines.ly new file mode 100644 index 0000000000..5650871792 --- /dev/null +++ b/input/new/setting-hairpin-behavior-at-bar-lines.ly @@ -0,0 +1,17 @@ +\version "2.11.46"
+\header {
+ lsrtags = "expressive-marks"
+ texidoc = "If the note which ends a hairpin falls on a downbeat,
+the hairpin stops at the bar line immediately preceding. This behavior
+can be controlled by overriding the @code{'to-barline} property.
+"
+ doctitle = "Setting hairpin behavior at bar lines"
+}
+
+\relative c'' {
+ e4\< e2.
+ e1\!
+ \override Hairpin #'to-barline = ##f
+ e4\< e2.
+ e1\!
+}
diff --git a/input/regression/hairpin-barline-break.ly b/input/regression/hairpin-barline-break.ly index 754871be63..bcaa0630f5 100644 --- a/input/regression/hairpin-barline-break.ly +++ b/input/regression/hairpin-barline-break.ly @@ -1,14 +1,13 @@ \header { - texidoc ="If a hairpin ends on the first note of a new stave, we -don't print that ending. But on the previous line, this hairpin -should not be left open, and should end at the barline. " + texidoc = "If a hairpin ends on the first note of a new stave, we +do not print that ending. But on the previous line, this hairpin +should not be left open, and should end at the bar line. " } -\version "2.10.0" -\layout { ragged-right = ##t } +\version "2.11.46" + \relative c' { - \set hairpinToBarline = ##t c1\> \break c1\! diff --git a/input/regression/hairpin-to-barline-mark.ly b/input/regression/hairpin-to-barline-mark.ly index 488ae8bc80..041e1232e1 100644 --- a/input/regression/hairpin-to-barline-mark.ly +++ b/input/regression/hairpin-to-barline-mark.ly @@ -1,13 +1,13 @@ -\version "2.11.12" -\paper { ragged-right = ##t } +\version "2.11.46" + \header { - texidoc = "hairpinToBarline is not confused by very long marks." + texidoc = "'to-barline is not confused by very long marks." } \new Staff \relative c' { - c1\< | + c1\< \mark "Very long mark" - c4\> c c c\! | + c4\> c c c\! } diff --git a/input/regression/hairpin-to-barline.ly b/input/regression/hairpin-to-barline.ly index e5c450a3c2..f9d0ee1ee8 100644 --- a/input/regression/hairpin-to-barline.ly +++ b/input/regression/hairpin-to-barline.ly @@ -1,18 +1,13 @@ \header { - texidoc = "By setting @code{hairpinToBarline}, hairpins will stop at -the barline preceding the ending note." + texidoc = "Hairpins whose end note is preceded by a bar line +should end at that bar line. " } -\version "2.10.0" - -\paper { - ragged-right = ##t -} +\version "2.11.46" \relative c'' { - \set hairpinToBarline = ##t \override Hairpin #'bound-padding = #1.0 c4\< c2. c4\! } diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 51161d1501..2f66955d44 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -176,16 +176,6 @@ Dynamic_engraver::process_music () } finished_cresc_ = cresc_; - - /* backwards compatibility with hairpinToBarline */ - if (finished_cresc_->get_property ("to-barline") == SCM_EOL) - { - bool use_bar = to_boolean (get_property ("hairpinToBarline")) - && scm_is_string (get_property ("whichBar")); - - finished_cresc_->set_property ("to-barline", scm_from_bool (use_bar)); - } - announce_end_grob (finished_cresc_, SCM_EOL); cresc_ = 0; current_cresc_ev_ = 0; diff --git a/python/convertrules.py b/python/convertrules.py index 22ed07ad60..31d756f0e4 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -3033,3 +3033,18 @@ def conv (str): conversions.append (((2, 11, 38), conv, """\\setEasyHeads -> \\easyHeadsOn, \\fatText -> \\textLengthOn, \\emptyText -> \\textLengthOff""")) + +def conv (str): + str = re.sub (r"\\set\s+([a-zA-Z]+)\s*.\s*hairpinToBarline\s*=\s*##([tf]+)", + r"\\override \1.Hairpin #'to-barline = ##\2", str) + str = re.sub (r"\\set\s+hairpinToBarline\s*=\s*##([tf]+)", + r"\\override Hairpin #'to-barline = ##\1", str) + str = re.sub (r"\\unset\s+([a-zA-Z]+)\s*.\s*hairpinToBarline", + r"\\revert \1.Hairpin #'to-barline", str) + str = re.sub (r"\\unset\s+hairpinToBarline", + r"\\revert Hairpin #'to-barline", str) + str = re.sub (r"hairpinToBarline\s*=\s*##([tf]+)", + r"\\override Hairpin #'to-barline = ##\1", str) + return str + +conversions.append (((2, 11, 46), conv, """\\set hairpinToBarline -> \\override Hairpin #'to-barline""")) diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm index e8c2247432..e506ed24fe 100644 --- a/scm/define-context-properties.scm +++ b/scm/define-context-properties.scm @@ -231,8 +231,6 @@ for the full staff.") @code{GridPoint}s.") - (hairpinToBarline ,boolean? "If set, end a hairpin at the barline -before the ending note.") (harmonicAccidentals ,boolean? "If set, harmonic notes in chords get accidentals.") (highStringOne ,boolean? "Whether the first string is the string @@ -279,8 +277,10 @@ containing @code{(@var{step} . @var{alter})} or @code{((@var{octave} . 0 to@tie{}6 and @var{alter} a fraction, denoting alteration. For alterations, use symbols, e.g. @code{keySignature = #`((6 . ,FLAT))}.") + (lyricMelismaAlignment ,ly:dir? "Alignment to use for a melisma syllable.") + (majorSevenSymbol ,markup? "How should the major 7th be formatted in a chord name?") (markFormatter ,procedure? "A procedure taking as arguments the |