]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3286: add single-C time signature style
authorDan Eble <nine.fierce.ballads@gmail.com>
Sun, 26 Oct 2014 02:20:55 +0000 (22:20 -0400)
committerJames Lowe <pkx166h@gmail.com>
Sun, 2 Nov 2014 15:53:03 +0000 (15:53 +0000)
This style is identical to single-digit except that C is printed
instead of 4 and cut-C is printed instead of 2.

input/regression/time-signature-single-c.ly [new file with mode: 0644]
lily/time-signature.cc

diff --git a/input/regression/time-signature-single-c.ly b/input/regression/time-signature-single-c.ly
new file mode 100644 (file)
index 0000000..5e115e4
--- /dev/null
@@ -0,0 +1,20 @@
+\version "2.19.16"
+
+\header {
+  texidoc = "The single-C time signature style prints a C for any time signature with 4 in the numerator and prints a cut-C for any time signature with 2 in the numerator."
+}
+
+\layout { indent = 0 }
+
+\new Staff {
+  \relative f' {
+    \override Staff.TimeSignature.style = #'single-C
+    \time 1/2 f2^"1/2"
+    \time 2/2 f2^"2/2" f
+    \time 2/1 f1^"2/1" f
+    \time 3/4 f4^"3/4" f f
+    \time 4/4 f4^"4/4" f f f
+    \time 4/2 f2^"4/2" f f f
+    \time 4/1 f1^"4/1" f f f
+  }
+}
index 96ab19758135ee9d5811156c642dcbd5df39ab71..c85b891932cf036c74d8f768214fe4d20394d117 100644 (file)
@@ -68,6 +68,14 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
 
   if ((style == "default") || (style == ""))
     style = ::to_string ("C");
+  else if (style == "single-C")
+    {
+      if ((n != 2) && (n != 4))
+        return numbered_time_signature (me, n, 0);
+      /* for any d, print 2/d as cut-C, 4/d as C */
+      style = ::to_string ("C");
+      d = n;
+    }
 
   if (style == "C")
     {