]> git.donarmstrong.com Git - lilypond.git/commitdiff
Implement two variations on double repeat sign.
authorNeil Puttock <n.puttock@gmail.com>
Tue, 23 Sep 2008 00:33:14 +0000 (01:33 +0100)
committerNeil Puttock <n.puttock@gmail.com>
Tue, 23 Sep 2008 00:33:14 +0000 (01:33 +0100)
Add context property doubleRepeatType so that default double repeat can be
changed for volte using \repeat volta.

Documentation/user/rhythms.itely
input/regression/double-repeat-default-volta.ly [new file with mode: 0644]
input/regression/double-repeat.ly [new file with mode: 0644]
lily/bar-line.cc
lily/repeat-acknowledge-engraver.cc
lily/span-bar.cc
ly/engraver-init.ly
scm/define-context-properties.scm
scm/output-lib.scm

index 8387123d8bd6025155cf82a5e6beb8b9efb103a1..fff7c7c1e4eeec07de10a94dfeaf82d00ebb16df 100644 (file)
@@ -2031,11 +2031,11 @@ with the end of a measure the specified bar line is inserted at that
 point in the printed output.  Such insertions do not affect
 the calculation and placement of subsequent automatic bar lines.
 
-The simple bar line and four types of double bar line are available
+The simple bar line and five types of double bar line are available
 for manual insertion:
 
 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
-f1 \bar "|" g \bar "||" a \bar ".|" b \bar ".|." c \bar "|." d
+f1 \bar "|" g \bar "||" a \bar ".|" b \bar ".|." c \bar "|.|" d \bar "|." e
 @end lilypond
 
 @noindent
@@ -2046,10 +2046,10 @@ f1 \bar ":" g \bar "dashed" a
 @end lilypond
 
 @noindent
-and three types of repeat bar line:
+and five types of repeat bar line:
 
 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
-f1 \bar "|:" g \bar ":|:" a \bar ":|" b
+f1 \bar "|:" g \bar ":|:" a \bar ":|.|:" b \bar ":|.:" c \bar ":|" d
 @end lilypond
 
 @cindex repeats
diff --git a/input/regression/double-repeat-default-volta.ly b/input/regression/double-repeat-default-volta.ly
new file mode 100644 (file)
index 0000000..b095b3c
--- /dev/null
@@ -0,0 +1,26 @@
+\version "2.11.60"
+
+\header {
+  texidoc = "For volte, the style of double repeats can be set
+  using @code{doubleRepeatType}."
+}
+
+\relative c' {
+  \repeat volta 1 {
+    c1
+  }
+  \mark "default"
+  \repeat volta 1 {
+    c1
+  }
+  \mark "\":|.|:\""
+  \set Score.doubleRepeatType = #":|.|:"
+  \repeat volta 1 {
+    c1
+  }
+  \mark "\":|.:\""
+  \set Score.doubleRepeatType = #":|.:"
+  \repeat volta 1 {
+  c1
+  }
+}
diff --git a/input/regression/double-repeat.ly b/input/regression/double-repeat.ly
new file mode 100644 (file)
index 0000000..5c2f697
--- /dev/null
@@ -0,0 +1,22 @@
+\version "2.11.60"
+
+\header {
+  texidoc = "Three types of double repeat bar line are supported."
+}
+\new StaffGroup <<
+  \new Staff \relative c' {
+    c1
+    \mark "\":|:\""
+    \bar ":|:"
+    c1
+    \mark "\":|.|:\""
+    \bar ":|.|:"
+    c1
+    \mark "\":|.:\""
+    \bar ":|.:"
+    c1
+  }
+  \new Staff \relative c' {
+    \repeat unfold 4 { c1 }
+  }
+>>
index 4d2cbf9b5968b46b80f3f9c7b557379a09fde3d2..d0b18fd1c55345adf59f2d46f99321a5d9390af3 100644 (file)
@@ -145,11 +145,33 @@ Bar_line::compound_barline (Grob *me, string str, Real h,
       m.add_at_edge (X_AXIS, RIGHT, thick, kern);
       m.add_at_edge (X_AXIS, RIGHT, colon, kern);
     }
+  else if (str == ":|.|:")
+    {
+      m.add_at_edge (X_AXIS, LEFT, thick, 0);
+      m.add_at_edge (X_AXIS, LEFT, thin, kern);
+      m.add_at_edge (X_AXIS, LEFT, colon, kern);
+      m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+      m.add_at_edge (X_AXIS, RIGHT, colon, kern);
+
+    }
+  else if (str == ":|.:")
+    {
+      m.add_at_edge (X_AXIS, LEFT, thick, 0);
+      m.add_at_edge (X_AXIS, LEFT, thin, kern);
+      m.add_at_edge (X_AXIS, LEFT, colon, kern);
+      m.add_at_edge (X_AXIS, RIGHT, colon, kern);
+    }
   else if (str == ".|.")
     {
       m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
       m.add_at_edge (X_AXIS, RIGHT, thick, kern);
     }
+  else if (str == "|.|")
+    {
+      m.add_at_edge (X_AXIS, LEFT, thick, 0);
+      m.add_at_edge (X_AXIS, LEFT, thin, kern);
+      m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+    }
   else if (str == "||")
     {
       /*
index cf42756f144d2729146a09d412a305cd8fbb9d81..5d7b98d36e4144661fd54b1e6775b092b72f4300 100644 (file)
@@ -83,7 +83,7 @@ Repeat_acknowledge_engraver::process_music ()
     }
 
   if (start && end)
-    s = ":|:";
+    s = robust_scm2string (get_property ("doubleRepeatType"), ":|:");
   else if (start)
     s = "|:";
   else if (end)
@@ -116,6 +116,7 @@ ADD_TRANSLATOR (Repeat_acknowledge_engraver,
                "",
 
                /* read */
+               "doubleRepeatType "
                "repeatCommands "
                "whichBar ",
 
index 76e1b60280970bb5eeadbdb9d77ed85f0d6283df..48a1df4f3acddb26fb2284fc5e63a9a014aadb8a 100644 (file)
@@ -186,6 +186,10 @@ Span_bar::calc_glyph_name (SCM smob)
     type = "|.";
   else if (type == ":|:")
     type = ".|.";
+  else if (type == ":|.|:")
+    type = "|.|";
+  else if (type == ":|.:")
+    type = "|.";
 
   return ly_string2scm (type);
 }
index 80700b8584ffa37ad6ea1c4ea34a2e9b2465c505..ba0d48d987db0199873e33d0716cd28d3d1be820 100644 (file)
@@ -513,6 +513,7 @@ automatically when an output definition (a @code{\score} or
   decrescendoSpanner = #'hairpin
   
   defaultBarType = #"|"
+  doubleRepeatType = #":|:"
   barNumberVisibility = #first-bar-number-invisible
   automaticBars = ##t
   
index 24bd6ddf605efc10d269af9009ec3142d53eff00..e3245477eedf5c1d6860405b16c09c2339f24228 100644 (file)
@@ -177,6 +177,8 @@ non-hairpin decrescendo, i.e., @samp{dim.}.")
 
 This variable is read by @rinternals{Timing_translator} at
 @rinternals{Score} level.")
+     (doubleRepeatType ,string? "Set the default bar line for double
+repeats.")
      (doubleSlurs ,boolean? "If set, two slurs are created for every
 slurred note, one above and one below the chord.")
      (drumPitchTable ,hash-table? "A table mapping percussion
index 7a50af6c1e3034acc3f7b919cb10501205618b6a..eb6d98db06c78d6cfff53b007abd80db5b708fb6 100644 (file)
@@ -226,6 +226,8 @@ centered, X==1 is at the right, X == -1 is at the left."
 ;; How should a  bar line behave at a break? 
 (define bar-glyph-alist
   '((":|:" . (":|" . "|:"))
+    (":|.|:" . (":|" . "|:"))
+    (":|.:" . (":|" . "|:"))
     ("||:" . ("||" . "|:"))
     ("dashed" . ("dashed" . '())) 
     ("|" . ("|" . ()))
@@ -239,6 +241,7 @@ centered, X==1 is at the right, X == -1 is at the left."
     (":|" . (":|" . ()))
     ("||" . ("||" . ()))
     (".|." . (".|." . ()))
+    ("|.|" . ("|.|" . ()))
     ("" . ("" . ""))
     (":" . (":" . ""))
     ("." . ("." . ()))