lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue 3286: add single-C time signature style (issue 164830043 by addres


From: nine . fierce . ballads
Subject: Issue 3286: add single-C time signature style (issue 164830043 by address@hidden)
Date: Sun, 26 Oct 2014 03:27:52 +0000

Reviewers: ,

Description:
Issue 3286: add single-C time signature style

This style is identical to single-digit except that C is printed
instead of 4 and cut-C is printed instead of 2.

Please review this at https://codereview.appspot.com/164830043/

Affected files (+28, -0 lines):
  A input/regression/time-signature-single-c.ly
  M lily/time-signature.cc


Index: input/regression/time-signature-single-c.ly
diff --git a/input/regression/time-signature-single-c.ly b/input/regression/time-signature-single-c.ly
new file mode 100644
index 0000000000000000000000000000000000000000..8921bcf98a5bd4b5e02742431d3d7677615ab12a
--- /dev/null
+++ b/input/regression/time-signature-single-c.ly
@@ -0,0 +1,20 @@
+\version "2.19.16"
+
+\header {
+ texidoc = "The single-C time signature style prints a C for any time signature fraction with 4 in the numerator and print 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: lily/time-signature.cc
diff --git a/lily/time-signature.cc b/lily/time-signature.cc
index 96ab19758135ee9d5811156c642dcbd5df39ab71..c85b891932cf036c74d8f768214fe4d20394d117 100644
--- a/lily/time-signature.cc
+++ b/lily/time-signature.cc
@@ -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")
     {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]