]> git.donarmstrong.com Git - lilypond.git/commitdiff
Refine mid-measure beams in 3/4 time; Issue 2566
authorKeith OHara <k-ohara5a5a@oco.net>
Mon, 28 May 2012 06:36:52 +0000 (23:36 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Sat, 2 Jun 2012 00:56:57 +0000 (17:56 -0700)
Replaces 4d7cac2e94f7fb8c86c69c6d6fceff1ddfb545e4

Documentation/notation/rhythms.itely
input/regression/autobeam-3-4-rules.ly
input/regression/autobeam-start-at-beginning-of-measure-in-3-4.ly [deleted file]
input/regression/multiple-time-sig-settings.ly
lily/auto-beam-engraver.cc
ly/engraver-init.ly
python/convertrules.py
scm/auto-beam.scm
scm/define-context-properties.scm
scm/time-signature-settings.scm

index 1b02b259fc00f272dd570be4a08cbb42a7051ece..8f0827bb36b5283a6cccc6d3a20778d130863560 100644 (file)
@@ -2149,30 +2149,30 @@ if @code{beamExceptions} is not reset.
 \repeat unfold 8 {c8}
 @end lilypond
 
-In traditional engraving, eighth notes can have special beaming rules.
-A measure consisting of only eighth notes can be beamed in one.  This rule is
-controlled by the context property @code{beamWholeMeasure}:
+In a similar fashion, eighth notes in 3/4 time are beamed as a full
+measure by default.  To beam eighth notes in 3/4 time on the beat,
+reset @code{beamExceptions}.
 
 @lilypond[quote,verbatim,relative=2]
 \time 3/4
-% By default we beam in one
-\repeat unfold 6 { a8 }
-% We can avoid beaming in one
-\set Timing.beamWholeMeasure = ##f
-\repeat unfold 6 { a8 }
+% by default we beam in (3) due to beamExceptions
+\repeat unfold 6 {a8} |
+% This will beam (1 1 1) due to beatLength
+\set Timing.beamExceptions = #'()
+\repeat unfold 6 {a8}
 @end lilypond
 
-In some engraving from the Romantic and Classical periods,
-a half-measure of eighth notes can be beamed
-together even though this violates the general rule (see Gould, p. 153).
-This behavior is controlled by the context property @code{beamHalfMeasure}:
+In engraving from the Romantic and Classical periods,
+beams often begin midway through the measure in 3/4 time,
+but modern practice is to avoid the false impression of 6/8 time
+(see Gould, p. 153).  Similar situations arise in 3/8 time.
+This behavior is controlled by the context property @code{beamHalfMeasure},
+which has effect only in time signatures with 3 in the numerator:
 
 @lilypond[quote,verbatim,relative=2]
 \time 3/4
-% By default we avoid half-measure beams
 r4. a8 a a |
-% We can allow half-measure beams
-\set Timing.beamHalfMeasure = ##t
+\set Timing.beamHalfMeasure = ##f
 r4. a8 a a |
 @end lilypond
 
index 5730b6c42449a89b825dc23f12cabc83911e7562..88ebd97afd6374eac3e59d9d363fce0e04490676 100644 (file)
@@ -1,24 +1,34 @@
-\version "2.15.31"
+\version "2.15.40"
 
 \header {
 
   doctitle = "Special beaming rules for 3/4 time"
 
-  texinfo = "
-Whole-measure and half-measure beaming in 3/4 time can be controlled.
-The first measure should be beamed in one.  The second measure should
-be beamed in three.  The third and fourth measures should be beamed
-at 3/8.
-  "
+  texinfo = "Beaming in 3/4 time has special treatment.  By default
+six eighth notes are beamed in one. Beams that would imply 6/8 time
+may be avoided with @code{beamHalfMeasure = ##f}.  When the beaming
+is changed, beams should start at the beginning of the measure.
+"
 
 }
 
 \relative c' {
-    \time 3/4
-    c8^\markup "Beam in one" c c c c c
-    \set Timing.beamWholeMeasure = ##f
-    c8^\markup "Beam in three" c c c c c
-    \set Timing.beamHalfMeasure = ##t
-    r4.^\markup "Beam in Two" c8 c c
-    c8 c c  r4.
+  \time 3/4
+  \set Timing.beamHalfMeasure = ##f
+  r4.^\markup "Prevent beams that imply 6/8 time" c8 c c |
+  c8 c r c c r |
+  r8_"but these beams are okay" c c c c c | c c c r r4 \bar "||"
+
+  \set Timing.beamHalfMeasure = ##t
+  r4.^\markup "Or allow them" c8 c c c c r c c r
+  \break
+
+  \unset Timing.beamExceptions
+  r8^\markup "Beam to the beat" c c c c c
+  c c c r r4 \bar "||"
+
+  \set Timing.baseMoment = #(ly:make-moment 1 8)
+  \set Timing.beatStructure = #'(3 3)
+  r8^\markup "Override to beam groups of 3 eighth notes" c c c c c
+  r4. c8 c c c c c r4.
 }
diff --git a/input/regression/autobeam-start-at-beginning-of-measure-in-3-4.ly b/input/regression/autobeam-start-at-beginning-of-measure-in-3-4.ly
deleted file mode 100644 (file)
index a6b8652..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-\version "2.14.0"
-
-\header {
-
-  texidoc = "
-3/4 beaming has special rules, that are hardcoded in the autobeam
-routines.  When the beaming is changed, beams should start at the
-beginning of the measure.  In this case, the measure should be beamed
-in two.
-"
-}
-
-\relative c' {
-    \time 3/4
-    \set Timing.baseMoment = #(ly:make-moment 1 8)
-    \set Timing.beatStructure = #'(3 3)
-    \set Timing.beamExceptions = #'()
-    c8 c c c c c
-}
index ab95af5498c83ca866f2a8311a34a816cdf32de1..2caad79c8e96e783e8a3891496cfaf23d6470f3b 100644 (file)
@@ -10,7 +10,7 @@ by the markups.
 
 \new Staff{
   \relative c' {
-   \overrideTimeSignatureSettings
+    \overrideTimeSignatureSettings
       #'(4 . 4)  % time signature fraction
       #'(1 . 4)  % base moment fraction
       #'(1 1 1 1)    % beatStructure
@@ -19,7 +19,7 @@ by the markups.
       #'(3 . 4)  % time signature fraction
       #'(1 . 4)  % base moment fraction
       #'(1 1 1)    % beatStructure
-      #'((end . (((1 . 8) . (2 2 2))))) % set exceptions to beam by 1/4
+      #'()       % beamExceptions
     \time 4/4
     c8^\markup {"Beam by 1/4"} c c c c c c c |
     \time 3/4
index 41c96eae76b84f2c5468526d93406ce2c7527663..87ab20e52460b21614265289ec4395335f567830 100644 (file)
@@ -558,6 +558,7 @@ ADD_TRANSLATOR (Auto_beam_engraver,
                 "autoBeaming "
                 "baseMoment "
                 "beamExceptions "
+                "beamHalfMeasure "
                 "beatStructure "
                 "subdivideBeams ",
 
index 6eecb0031df6903417c1b307a30e43365b39a8bf..9bb731883cba5d9754fdc7c2030508b49bde06f4 100644 (file)
@@ -626,8 +626,7 @@ automatically when an output definition (a @code{\score} or
   beatStructure = #'(1 1 1 1)
   beamExceptions = #'((end . (((1 . 8) . (4 4))
                               ((1 . 12) . (3 3 3 3)))))
-  beamWholeMeasure = ##t
-  beamHalfMeasure = ##f
+  beamHalfMeasure = ##t
 
   autoBeaming = ##t
   autoBeamCheck = #default-auto-beam-check
index 2bfbdce1ebf9c55b76e02212bc6f88777b49d281..60fb1740fd58826582b775ea6b8280b50e2791b8 100644 (file)
@@ -3361,6 +3361,13 @@ def conv (str):
                   not_first (r"\2 \\default"), str)
     return str
 
+@rule ((2, 15, 40), r"Remove beamWholeMeasure")
+def conv (str):
+    if re.search (r"\bbeamWholeMeasure\b", str):
+        stderr_write (NOT_SMART % "beamWholeMeasure")
+        stderr_write (_ ("beamExceptions controls whole-measure beaming.") + "\n")
+    return str
+
 # Guidelines to write rules (please keep this at the end of this file)
 #
 # - keep at most one rule per version; if several conversions should be done,
index 85ff3c65a1db9ef07a8dfb3b88a55eb569bbda12..b77022f2fca1cb2e24a164cdf4e2f7e8d1628f87 100644 (file)
@@ -16,9 +16,9 @@
 ;;;; along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;  Determine whether an auto beam should be extended to the right
-;;  of the current stem.   In general, we start anywhere except on
-;;  the last note of a beat. We end according to the follwing rules,
-;;  in order of decreasing priority:
+;;  of the current stem.  We start anywhere, except mid-measure in
+;;  3/4 time. We end according to the follwing rules, in order of
+;;  decreasing priority:
 ;;
 ;;  1. end <type>
 ;;  2. end <greater type>
   (define (beat-end? moment beat-structure)
     (pair? (member moment beat-structure)))  ;; member returns a list if found, not #t
 
-  (define (use-special-3-4-rules? fraction base-moment exceptions)
-    "Should we use special 3/4 time signature beaming rules?"
-     (and (equal? fraction '(3 . 4))
-          (equal? base-moment (ly:make-moment 1 4))
-          (null? (assoc-get '(1 . 8) exceptions '()))))
-
   ;; Start of actual auto-beam test routine
   ;;
   ;;
@@ -85,8 +79,7 @@
                                           '())
                                beaming<?))
              (function (if (= dir START) 'begin 'end))
-             (beam-whole-measure (get 'beamWholeMeasure #t))
-             (beam-half-measure (get 'beamHalfMeasure #f))
+             (beam-half-measure (get 'beamHalfMeasure #t))
              (type (moment->fraction test-beam))
              (non-grace (ly:make-moment
                           (ly:moment-main-numerator measure-pos)
                                   exception-grouping 0 grouping-moment)))
 
        (if (= dir START)
-            ;; Start rules -- start anywhere unless 3/4 with default rules
-            ;; #t if beam is to start
-            (or (not (use-special-3-4-rules?
-                       time-signature-fraction
-                       base-moment
-                       exceptions)) ;; start anywhere if not default 3/4
-                (= (ly:moment-main-numerator pos) 0) ;; start at beginning of measure
-               (and beam-half-measure
-                     (equal? type '(1 . 8))
-                     (equal? pos (ly:make-moment 3 8))) ;; start at mid-measure if 1/8 note beam
-                (beat-end? pos beat-endings)  ;; start if at start of beat
-               (and (not (equal? test-beam base-moment)) ;; is beat split?
-                     (not (beat-end? (ly:moment-add pos test-beam)
-                                     beat-endings))))  ;; will this note end the beat
-            ;; End rules -- #t if beam is to end
+            ;; Start rules -- #t if beam is allowed to start
+            (or beam-half-measure ;; Start anywhere, but option for mid-measure
+                (not (equal? (ly:moment-add pos pos) measure-length))
+                (not (= 3 (car time-signature-fraction))) ;; in triple meter
+                (not (= (cdr type) ;; when the beamed note is 1/6 of a measure
+                        (* 2 (cdr time-signature-fraction)))))
+            ;; End rules -- #t if beam is required to end
             (or (= (ly:moment-main-numerator pos) 0) ;; end at measure beginning
-                (if (use-special-3-4-rules?
-                      time-signature-fraction
-                      base-moment
-                      exceptions)
-                    ;; special rule for default 3/4 beaming
-                    (if (and (equal? type '(1 . 8))
-                             (or beam-whole-measure
-                                 (and beam-half-measure
-                                      (not (equal? pos (ly:make-moment 3 8))))))
-                        #f
-                        (beat-end? pos beat-endings))
-                    ;; rules for all other cases -- check for applicable exception
-                    (if (null? exception-grouping)
-                        (beat-end? pos beat-endings) ;; no exception, so check beat ending
-                        (member pos exception-moments)))))))) ;; check exception rule
+                (if (null? exception-grouping)
+                    (beat-end? pos beat-endings) ;; no exception, so check beat ending
+                    (member pos exception-moments))))))) ;; check exception rule
 
index dd6abce6d2d81559d723d146da773449e1b0a2aa..e0b45ab670b0b945b29cb0bac1872951633553ba 100644 (file)
@@ -141,10 +141,8 @@ apply for the down staff of @code{PianoStaff}.  Used by
 @code{\\autochange}.")
      (beamExceptions ,list? "An alist of exceptions to autobeam rules
 that normally end on beats.")
-     (beamHalfMeasure ,boolean? "Allow a half measure of eighth notes to
-be beamed together in 3/4 time?")
-     (beamWholeMeasure ,boolean? "Allow a whole measure of eighth notes
-to be beamed together in 3/4 time?")
+     (beamHalfMeasure ,boolean? "Whether to allow a beam to begin
+halfway through the measure in triple time, which could look like 6/8.")
      (beatStructure ,list? "List of @code{baseMoment}s that are combined
 to make beats.")
 
index 898eee600a5e4977555e554b25486760ae155003..af852575dcedeb521c56b44be4672d29e1b21210 100644 (file)
              ((beamExceptions . ((end .  (((1 . 32) . (8 8 8 8 8 8))))))))
 
     ;; in 3 4 time:
-    ;;   use defaults -- no entries necessary
+    ;;   use defaults, but combine all beats into a unit if possible
     ;;
-    ;;   Whole measure beaming is controlled by context property
-    ;;   beamWholeMeasure
-    ;;   Half measure beaming is controlled by context property
-    ;;   beamHalfMeasure
-
+    ;;   set all beams to end on beats, but 1 8 to beam entire measure
+    ;;   in order to avoid beaming every beam type for the entire measure, we set
+    ;;   triplets back to every beat.
     ((3 . 4) .
-             ((beamExceptions . ())))
+             ((beamExceptions . ((end . (((1 . 8) . (6))            ;1/8 note whole measure
+                                         ((1 . 12) . (3 3 3)))))))) ;Anything shorter by beat
 
     ;; in 3 8  time:
     ;;   beam entire measure together