]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/new/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly
Fix 627, change \compressMusic to \scaleDurations.
[lilypond.git] / input / new / changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly
diff --git a/input/new/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly b/input/new/changing-time-signatures-inside-a-polymetric-section-using-scaledurations.ly
new file mode 100644 (file)
index 0000000..6cef1f8
--- /dev/null
@@ -0,0 +1,43 @@
+\version "2.11.48"
+\header {
+  lsrtags = "rhythms,contexts-and-engravers"
+  texidoc = "The @code{measureLength} property, together with
+@code{measurePosition}, determines when a bar line is needed. However,
+when using @code{\\scaleDurations}, the scaling of durations makes it
+difficult to change time signatures without making a mess of it.
+Therefore, @code{measureLength} has to be set manually, using the
+@code{ly:make-moment} callback. The second argument must be the same as
+the second argument of @code{\\scaleDurations}."
+  doctitle = "Changing time signatures inside a polymetric section using @code{\\scaleDurations}"
+}
+
+\layout {
+  \context {
+    \Score
+    \remove "Timing_translator"
+    \remove "Default_bar_line_engraver"
+  }
+  \context {
+    \Staff
+    \consists "Timing_translator"
+    \consists "Default_bar_line_engraver"
+  }
+}
+
+<<
+  \new Staff {
+    \scaleDurations #'(8 . 5) {
+      \time 6/8
+      \set Timing.measureLength = #(ly:make-moment 3 5)
+      b8 b b b b b
+      \time 2/4
+      \set Timing.measureLength = #(ly:make-moment 2 5)
+      b4 b
+    }
+  }
+  \new Staff {
+    \clef bass
+    \time 2/4
+    c2 d e f
+  }
+>>