Hi Mark,

2008/9/2 Mark Polesky <[EMAIL PROTECTED]>:
> Developers - thank you for such an awesome program!
>
> Feature request: more repeat signs
>
> Two "double-sided" repeat-sign styles (commonly found in print)
> are missing from LilyPond, as far as I can tell:
>
> 1.) repeat dots, thin line, thick line, thin line, repeat dots

Hmm, I hadn't really thought about it before, but I'm sure this option
is more common than LilyPond's default double repeat sign. It's also
more pleasant to look at. :)

> 2.) repeat dots, thin line, thick line, repeat dots

A bit more esoteric, I'd say, but still easily implemented.

> Following LilyPond convention, I suppose the first would be
> coded as \bar = ":|.|:" and the second as \bar = ":|.:".

It's actually three new styles, since ":|.|:" will require "|.|" to
prevent the colons appearing between staves in a
StaffGroup/GrandStaff.

I've knocked up a patch which implements these styles, together with a
context property `doubleRepeatType' for setting the default style
using \repeat volta.  At a line break, both styles will revert to ":|"
(before) and "|:" (after).

If the patch gets the OK, you'll be able to use these repeat signs in
the next release.

Regards,
Neil

<<attachment: double.repeat.png>>

From 81e09b9ab41f7510fd77f9bd50de8087ca281cd5 Mon Sep 17 00:00:00 2001
From: Neil Puttock <[EMAIL PROTECTED]>
Date: Tue, 2 Sep 2008 23:15:08 +0100
Subject: [PATCH] Implement two variations on double repeat sign.

Add context property doubleRepeatType so that default double repeat can be
changed for volte using \repeat volta.
---
 lily/bar-line.cc                    |   22 ++++++++++++++++++++++
 lily/repeat-acknowledge-engraver.cc |    3 ++-
 lily/span-bar.cc                    |    4 ++++
 ly/engraver-init.ly                 |    1 +
 scm/define-context-properties.scm   |    2 ++
 scm/output-lib.scm                  |    3 +++
 6 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/lily/bar-line.cc b/lily/bar-line.cc
index 4d2cbf9..d0b18fd 100644
--- a/lily/bar-line.cc
+++ b/lily/bar-line.cc
@@ -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 == "||")
     {
       /*
diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc
index cf42756..5d7b98d 100644
--- a/lily/repeat-acknowledge-engraver.cc
+++ b/lily/repeat-acknowledge-engraver.cc
@@ -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 ",
 
diff --git a/lily/span-bar.cc b/lily/span-bar.cc
index 76e1b60..48a1df4 100644
--- a/lily/span-bar.cc
+++ b/lily/span-bar.cc
@@ -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);
 }
diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly
index 022fb8a..3741ab1 100644
--- a/ly/engraver-init.ly
+++ b/ly/engraver-init.ly
@@ -513,6 +513,7 @@ automatically when an output definition (a @code{\score} or
   decrescendoSpanner = #'hairpin
   
   defaultBarType = #"|"
+  doubleRepeatType = #":|:"
   barNumberVisibility = #first-bar-number-invisible
   automaticBars = ##t
   
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm
index a7dd3ab..b43291d 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -175,6 +175,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
diff --git a/scm/output-lib.scm b/scm/output-lib.scm
index 7a50af6..eb6d98d 100644
--- a/scm/output-lib.scm
+++ b/scm/output-lib.scm
@@ -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."
     (":|" . (":|" . ()))
     ("||" . ("||" . ()))
     (".|." . (".|." . ()))
+    ("|.|" . ("|.|" . ()))
     ("" . ("" . ""))
     (":" . (":" . ""))
     ("." . ("." . ()))
-- 
1.5.4.3

_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to