]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 1456
authorCarl Sorensen <c_sorensen@byu.edu>
Thu, 16 Dec 2010 12:40:00 +0000 (05:40 -0700)
committerCarl Sorensen <c_sorensen@byu.edu>
Wed, 22 Dec 2010 22:22:10 +0000 (15:22 -0700)
Remove context argument from \overrideTimeSignatureSettings.  It
always applies to the Timing context, so no argument is necessary.

Fix documentation and regression tests to match new behavior.

Write conversion rules for convert-ly

Run convert-ly on the documentation

Documentation/de/notation/rhythms.itely
Documentation/es/notation/rhythms.itely
Documentation/fr/notation/rhythms.itely
Documentation/notation/rhythms.itely
input/regression/multiple-time-sig-settings.ly
input/regression/skiptypesetting-multimeasurerest.ly
ly/music-functions-init.ly
python/convertrules.py
scm/time-signature-settings.scm

index 5dec8ca8c253b1518dae246da4b42cd5d712c728..b1ea1362ae09c251af10947edd087b130bdaef2c 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes.
 @end ignore
 
-@c \version "2.13.36"
+@c \version "2.13.44"
 
 @c Translators: Till Paala
 
@@ -1104,7 +1104,6 @@ werden.
 \score {
   \relative c' {
     \overrideTimeSignatureSettings
-      #'Score
       #'(4 . 4)  % time signature fraction
       #'(1 . 4)  % base moment fraction
       #'(3 1)    % beatStructure
@@ -1141,14 +1140,13 @@ Standard zurückgesetzt werden:
   \relative c' {
     \repeat unfold 8 { c8 } |
     \overrideTimeSignatureSettings
-      #'Score                         % context
       #'(4 . 4)                       % timeSignatureFraction
       #'(1 . 4)                       % baseMomentFraction
       #'(3 1)                         % beatStructure
       #'((end . (((1 . 8) . (3 1))))) % beamExceptions
     \time 4/4
     \repeat unfold 8 { c8 } |
-    \revertTimeSignatureSettings #'Score #'(4 . 4)
+    \revertTimeSignatureSettings #'(4 . 4)
     \time 4/4
     \repeat unfold 8 { c8 } |
   }
index 38f53b13400b8b1c2d9d73eab43c414268fd2b29..6378b7ecec7f5388e58df7c1fa9a7ed2ef179c5d 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.13.36"
+@c \version "2.13.44"
 
 @node Duraciones
 @section Duraciones
@@ -1096,7 +1096,6 @@ existentes se pueden cambiar, o pueden añadirse valores nuevos:
 \score {
   \relative c' {
     \overrideTimeSignatureSettings
-      #'Score    % context
       #'(4 . 4)  % timeSignatureFraction
       #'(1 . 4)  % baseMomentFraction
       #'(3 1)    % beatStructure
@@ -1146,14 +1145,13 @@ compás se pueden restaurar a los valores originales:
   \relative c' {
     \repeat unfold 8 { c8 } |
     \overrideTimeSignatureSettings
-      #'Score                         % context
       #'(4 . 4)                       % timeSignatureFraction
       #'(1 . 4)                       % baseMomentFraction
       #'(3 1)                         % beatStructure
       #'((end . (((1 . 8) . (3 1))))) % beamExceptions
     \time 4/4
     \repeat unfold 8 { c8 } |
-    \revertTimeSignatureSettings #'Score #'(4 . 4)
+    \revertTimeSignatureSettings #'(4 . 4)
     \time 4/4
     \repeat unfold 8 { c8 } |
   }
index 3da2258df9e2dfdcc0e14a0e7e76a4b9c269c36c..839675dec3a6ea1cc1222916892846bd03bf42b0 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.13.36"
+@c \version "2.13.44"
 
 @c Translators: Frédéric Chiasson, Jean-Charles Malahieude
 @c Translation checkers: Valentin Villenave, Jean-Charles Malahieude,
@@ -1101,7 +1101,6 @@ pouvez les modifier de la manière suivante@tie{}:
 \score {
   \relative c' {
     \overrideTimeSignatureSettings
-      #'Score    % context
       #'(4 . 4)  % timeSignatureFraction
       #'(1 . 4)  % baseMomentFraction
       #'(3 1)    % beatStructure
@@ -1139,14 +1138,13 @@ métrique@tie{}:
   \relative c' {
     \repeat unfold 8 { c8 } |
     \overrideTimeSignatureSettings
-      #'Score                         % context
       #'(4 . 4)                       % timeSignatureFraction
       #'(1 . 4)                       % baseMomentFraction
       #'(3 1)                         % beatStructure
       #'((end . (((1 . 8) . (3 1))))) % beamExceptions
     \time 4/4
     \repeat unfold 8 c8 |
-    \revertTimeSignatureSettings #'Score #'(4 . 4)
+    \revertTimeSignatureSettings #'(4 . 4)
     \time 4/4
     \repeat unfold 8 { c8 } |
   }
index e463b9fcc6d25a29929fec690f481a60b225cf13..9ec5165cd18cdd8007681a5f990f3995adc9edc3 100644 (file)
@@ -7,7 +7,7 @@
     Guide, node Updating translation committishes..
 @end ignore
 
-@c \version "2.13.36"
+@c \version "2.13.44"
 
 @node Rhythms
 @section Rhythms
@@ -1056,25 +1056,23 @@ be changed, or new default values can be added:
 
 @lilypond[quote,verbatim]
 \score {
-  \relative c' {
-    \overrideTimeSignatureSettings
-      #'Score    % context
-      #'(4 . 4)  % timeSignatureFraction
-      #'(1 . 4)  % baseMomentFraction
-      #'(3 1)    % beatStructure
-      #'()       % beamExceptions
-    \time 4/4
-    \repeat unfold 8 { c8 } |
+  \new Staff {
+    \relative c' {
+      \overrideTimeSignatureSettings
+        #'(4 . 4)  % timeSignatureFraction
+        #'(1 . 4)  % baseMomentFraction
+        #'(3 1)    % beatStructure
+        #'()       % beamExceptions
+      \time 4/4
+      \repeat unfold 8 { c8 } |
+    }
   }
 }
 @end lilypond
 
-@code{\overrideTimeSignatureSettings} takes five arguments:
+@code{\overrideTimeSignatureSettings} takes four arguments:
 
 @enumerate
-@item
-@code{@var{context}}, a Scheme symbol that describes the context
-to which the default setting will apply.
 
 @item
 @code{@var{timeSignatureFraction}}, a Scheme pair describing the
@@ -1094,6 +1092,38 @@ for the time signature that go beyond ending at every beat, as
 described in @ref{Setting automatic beam behavior}.
 @end enumerate
 
+The context containing @code{\overrideTimeSignatureSettings} must
+be instantiated before the @code{\overrideTimeSignatureSettings}
+call is executed.  That means it must either be explicitly
+instantiated or there must be music in the context before the
+@code{\overrideTimeSignatureSettings} call:
+
+@lilypond[quote,verbatim]
+\score {
+  \relative c' {
+    % This call will fail because the context isn't yet instantiated
+    \overrideTimeSignatureSettings
+      #'(4 . 4)  % timeSignatureFraction
+      #'(1 . 4)  % baseMomentFraction
+      #'(3 1)    % beatStructure
+      #'()       % beamExceptions
+    \time 4/4
+    c8^\markup {"Beamed (2 2)"}
+    \repeat unfold 7 { c8 } |
+    % This call will succeed
+    \overrideTimeSignatureSettings
+      #'(4 . 4)  % timeSignatureFraction
+      #'(1 . 4)  % baseMomentFraction
+      #'(3 1)    % beatStructure
+      #'()       % beamExceptions
+    \time 4/4
+    c8^\markup {"Beamed (3 1)"}
+    \repeat unfold 7 { c8 } |
+  }
+}
+@end lilypond
+
+
 @cindex time signature properties, restoring default values
 @cindex restoring default properties for time signatures
 @funindex \revertTimeSignatureSettings
@@ -1106,20 +1136,61 @@ to the original values:
   \relative c' {
     \repeat unfold 8 { c8 } |
     \overrideTimeSignatureSettings
-      #'Score                         % context
-      #'(4 . 4)                       % timeSignatureFraction
-      #'(1 . 4)                       % baseMomentFraction
-      #'(3 1)                         % beatStructure
-      #'((end . (((1 . 8) . (3 1))))) % beamExceptions
+      #'(4 . 4)  % timeSignatureFraction
+      #'(1 . 4)  % baseMomentFraction
+      #'(3 1)    % beatStructure
+      #'()       % beamExceptions
     \time 4/4
     \repeat unfold 8 { c8 } |
-    \revertTimeSignatureSettings #'Score #'(4 . 4)
+    \revertTimeSignatureSettings #'(4 . 4)
     \time 4/4
     \repeat unfold 8 { c8 } |
   }
 }
 @end lilypond
 
+Different values of default time signature properties can be established
+for different staves by moving the @code{Timing_translator} and the
+@code{Default_bar_line_engraver} from the @code{Score} context to the
+@code{Staff} context.
+
+@lilypond[quote, verbatim]
+\score {
+  \new StaffGroup <<
+     \new Staff {
+        \overrideTimeSignatureSettings
+          #'(4 . 4)  % timeSignatureFraction
+          #'(1 . 4)  % baseMomentFraction
+          #'(3 1)    % beatStructure
+          #'()       % beamExceptions
+        \time 4/4
+        \repeat unfold 8 {c''8}
+     }
+     \new Staff {
+        \overrideTimeSignatureSettings
+          #'(4 . 4)  % timeSignatureFraction
+          #'(1 . 4)  % baseMomentFraction
+          #'(1 3)    % beatStructure
+          #'()       % beamExceptions
+        \time 4/4
+        \repeat unfold 8 {c''8}
+     }
+  >>
+  \layout {
+    \context {
+      \Score
+      \remove "Timing_translator"
+      \remove "Default_bar_line_engraver"
+    }
+    \context {
+      \Staff
+      \consists "Timing_translator"
+      \consists "Default_bar_line_engraver"
+    }
+  }
+}
+@end lilypond
+
 @predefined
 @code{\numericTimeSignature},
 @code{\defaultTimeSignature}.
index 9a91b5417ccc8ba094323543519c0a42b7952f62..8eac48ba25ee3171a8e1f2989a358195a6e5fc29 100644 (file)
@@ -1,4 +1,4 @@
-\version "2.13.33"
+\version "2.13.44"
 
 \header {
   texidoc = "
@@ -8,27 +8,27 @@ by the markups.
 "
 }
 
-\relative c' {
-  \overrideTimeSignatureSettings
-      #'Score
+\new Staff{
+  \relative c' {
+    \overrideTimeSignatureSettings
       #'(4 . 4)  % time signature fraction
       #'(1 . 4)  % base moment fraction
       #'(1 1 1 1)    % beatStructure
       #'()       % beamExceptions
-  \overrideTimeSignatureSettings
-      #'Score
+    \overrideTimeSignatureSettings
       #'(3 . 4)  % time signature fraction
       #'(1 . 4)  % base moment fraction
       #'(1 1 1)    % beatStructure
       #'()       % beamExceptions
-  \time 4/4
-  c8^\markup {"Beam by 1/4"} c c c c c c c |
-  \time 3/4
-  c8^\markup {"Beam by 1/4"} c c c c c |
-  \revertTimeSignatureSettings #'Score #'(4 . 4)
-  \revertTimeSignatureSettings #'Score #'(3 . 4)
-  \time 4/4
-  c8^\markup {"Beam by 1/2"} c c c c c c c |
-  \time 3/4
-  c8^\markup {"Beam by 3/4"} c c c c c |
+    \time 4/4
+    c8^\markup {"Beam by 1/4"} c c c c c c c |
+    \time 3/4
+    c8^\markup {"Beam by 1/4"} c c c c c |
+    \revertTimeSignatureSettings #'(4 . 4)
+    \revertTimeSignatureSettings #'(3 . 4)
+    \time 4/4
+    c8^\markup {"Beam by 1/2"} c c c c c c c |
+    \time 3/4
+    c8^\markup {"Beam by 3/4"} c c c c c |
+  }
 }
index ce2cd6290e0a1cc1f7d83bc5555a25b07199b6ed..3c87f104032b1dcc84915dd1652552be5aa82ac0 100644 (file)
@@ -7,7 +7,6 @@ When @code{skipTypesetting} is set during a @code{skipBars}-induced
 "
 }
 
-\version "2.13.36"
 <<
   {
     \time 3/4
index bd7e60e691066a330497dd92a1976a724d485b81..9d66ee72ed03a5a1568d9ae6ee30b766422645ce 100644 (file)
@@ -462,17 +462,17 @@ ottava =
 
 overrideTimeSignatureSettings =
 #(define-music-function
-   (parser location context time-signature base-moment beat-structure beam-exceptions)
-   (symbol? pair? pair? cheap-list? cheap-list?)
+   (parser location time-signature base-moment beat-structure beam-exceptions)
+   (pair? pair? cheap-list? cheap-list?)
 
-   (_i "Override @code{timeSignatureSettings} in @var{context}
+   (_i "Override @code{timeSignatureSettings}
 for time signatures of @var{time-signature} to have settings
 of @var{base-moment}, @var{beat-structure}, and @var{beam-exceptions}.")
 
    ;; TODO -- add warning if largest value of grouping is
    ;;      greater than time-signature.
   (let ((setting (make-setting base-moment beat-structure beam-exceptions)))
-    (override-time-signature-setting time-signature setting context)))
+    (override-time-signature-setting time-signature setting)))
 
 overrideProperty =
 #(define-music-function (parser location name property value)
@@ -739,12 +739,12 @@ resetRelativeOctave =
 
 revertTimeSignatureSettings =
 #(define-music-function
-   (parser location context time-signature)
-   (symbol? pair?)
+   (parser location time-signature)
+   (pair?)
 
-   (_i "Revert @code{timeSignatureSettings} in @var{context}
+   (_i "Revert @code{timeSignatureSettings}
 for time signatures of @var{time-signature}.")
-     (revert-time-signature-setting time-signature context))
+   (revert-time-signature-setting time-signature))
 
 rightHandFinger =
 #(define-music-function (parser location finger) (number-or-string?)
index be132ac5e3db3c7b269b330634317b93fa81a97f..e17095c3884f4fea0c1c053a303c2bdc99f62bf1 100644 (file)
@@ -3122,6 +3122,12 @@ def conv(str):
        stderr_write (UPDATE_MANUALLY);
     return str
 
+@rule ((2, 13, 44),
+    _ ("Remove context from overrideTimeSignatureSettings and revertTimeSignatureSettings."))
+def conv(str):
+    str = re.sub (r"\\(override|revert)TimeSignatureSettings(\s+[^#]*)(#[^#]*)#", r"\\\1TimeSignatureSettings\2#", str)
+    return str
+
 
 # Guidelines to write rules (please keep this at the end of this file)
 #
index 42bf5bfd41ee163ec17e74132d43b75c1ac695fd..c5792d9b80e9c9adc3648bf11efd58f26bc9a3e2 100644 (file)
@@ -281,7 +281,7 @@ a fresh copy of the list-head is made."
           property
           (revert-member current-value setting)))))
 
-(define-public (override-time-signature-setting time-signature setting . rest)
+(define-public (override-time-signature-setting time-signature setting)
   "Override the time signature settings for the context in @var{rest},
 with the new setting alist @var{setting}. "
     (context-spec-music
@@ -291,17 +291,9 @@ with the new setting alist @var{setting}. "
                       'timeSignatureSettings
                       time-signature
                       setting)))
-      (if (and (pair? rest) (symbol? (car rest)))
-          (car rest)
-          'Voice)))
+      'Timing))
 
-(define-public (score-override-time-signature-setting
-                 time-signature setting)
-  (override-time-signature-setting
-    time-signature setting 'Score))
-
-(define-public (revert-time-signature-setting
-                  time-signature . rest)
+(define-public (revert-time-signature-setting time-signature)
   (context-spec-music
     (make-apply-context
       (lambda (c)
@@ -309,6 +301,4 @@ with the new setting alist @var{setting}. "
           c
           'timeSignatureSettings
           time-signature)))
-    (if (and (pair? rest) (symbol? (car rest)))
-        (car rest)
-        'Voice)))
+    'Timing))