lilypond-user
[Top][All Lists]
Advanced

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

double bar lines and repeats


From: Han-Wen Nienhuys
Subject: double bar lines and repeats
Date: Thu, 1 Nov 2001 16:39:37 +0100

address@hidden writes:
> Hi,
> 
> I'm using lily 1.4.3 and am wondering why the following:
> 
>  a4 b c d | d8 c b a g4 g \bar "||" \break
>  \repeat "volta" 2 { d4 d8 e fis4 d | g g8 a b4 g }
> 
> produces:
>  music | music |
>  ||: moremusic | moremusic :||
> 
> instead of:
>  music | music ||
>  ||: moremusic | moremusic :||
> 
> In other words, the \bar "||" request gets junked.
> 
> This would be very necessary for visual clarity of the different parts of the 
> tune.


The following patch fixes this problem, but it doesn't address the way
that the barline  should look   when there is no line break. What do
you want it to look like?


\score { \notes {
a4 b c d | d8 c b a g4 g \bar  "||:" \break
 \repeat "volta" 2 { d4 d8 e fis4 d | g g8 a b4 g }
}}


note that you might need to do some manual editing to make it work on
1.4.


--- repeat-acknowledge-engraver.cc~     Mon Sep 24 01:04:29 2001
+++ repeat-acknowledge-engraver.cc      Thu Nov  1 16:36:23 2001
@@ -92,15 +92,24 @@
     s = ":|";
 
   /*
-    TODO: line breaks might be allowed if we set whichBar to "". 
+    TODO: line breaks might be allowed if we set whichBar to "".
    */
-  if (s != "" || (volta_found && !gh_string_p (get_property ("whichBar"))))
+
+  /*
+    We only set the barline if we wouldn't overwrite a previously set
+    barline.
+   */
+  SCM wb = get_property ("whichBar");
+  SCM db  = get_property ("defaultBarType");
+  if (!gh_string_p (wb) || gh_equal_p (db, wb))
     {
-      daddy_trans_l_->set_property ("whichBar", ly_str02scm (s.ch_C ()));
+      if (s != "" || (volta_found && !gh_string_p (wb)))
+       {
+         daddy_trans_l_->set_property ("whichBar", ly_str02scm (s.ch_C ()));
+       }
     }
 }
 
-
 ENTER_DESCRIPTION(Repeat_acknowledge_engraver,
 /* descr */       "Acknowledge repeated music, and convert the contents of
 repeatCommands ainto an appropriate setting for whichBar",

--- basic-properties.scm~       Wed Mar 21 16:46:21 2001
+++ basic-properties.scm        Thu Nov  1 16:26:44 2001
@@ -26,6 +26,7 @@
    (let ((result (assoc glyph 
                        '((":|:" . (":|" . "|:"))
                          ("|" . ("|" . ""))
+                         ("||:" . ("||" . "|:"))
                          ("|s" . (nil . "|"))
                          ("|:" . ("|" . "|:"))
                          ("|." . ("|." . nil))


-- 

Han-Wen Nienhuys   |   address@hidden    | http://www.cs.uu.nl/~hanwen/




reply via email to

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