gnu-music-discuss
[Top][All Lists]
Advanced

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

Volta brackets


From: Rune Zedeler
Subject: Volta brackets
Date: Mon, 09 Apr 2001 08:52:21 +0200

Fixed right sides of brackets. - Right sides now only get printed if on "fat" 
bar line.
To get correct lefts we need a bit more work:
Lilypond don't suppert empty alternatives. - and that is quite a serious 
limitiation.
An ampty alternative should create a "no left side" volta bracket at the end of 
the repeated section.
Like

repeat volta 4 { r1 r1 }
\alternative {
  {}
  { r1 }
  {}
  { r1 \bar "|." }
}

should reveal

      -----+ +---+ +---+
      1,3  | |2  | |4  |

|: -  |  - :|  - :|  - |.


The problem is that the volta has to be created "backwards" that is: start 
before the alternative statement.


-Rune

--- /tmp/lilypond-1.3.147/lily/volta-spanner.cc Sun Mar 11 19:10:34 2001
+++ lily/volta-spanner.cc       Mon Apr  9 08:42:24 2001
@@ -46,16 +46,22 @@
   if (!bar_arr.size ())
     return SCM_EOL;
 
-  bool no_vertical_start = false;
-  bool no_vertical_end = to_boolean (me->get_grob_property ("last-volta"));
   Spanner *orig_span =  dynamic_cast<Spanner*> (me->original_l_);
 
   bool first_bracket = orig_span && (orig_span->broken_into_l_arr_[0] == 
(Spanner*)me);
   
   bool last_bracket = orig_span && (orig_span->broken_into_l_arr_.top () == 
(Spanner*)me);
 
-  no_vertical_start = orig_span && !first_bracket;
-  no_vertical_end = orig_span && !last_bracket;
+  bool no_vertical_start = orig_span && !first_bracket;
+  bool no_vertical_end = orig_span && !last_bracket;
+  SCM bars = me->get_grob_property ("bars");
+  Grob * endbar =   unsmob_grob (gh_car (bars));
+  SCM glyph = endbar->get_grob_property("glyph");
+  String str = ly_scm2string(glyph);
+  const char* cs = str.ch_C();
+  no_vertical_end |=
+    (strcmp(cs,":|")!=0 && strcmp(cs,"|:")!=0 && strcmp(cs,"|.")!=0
+     && strcmp(cs,":|:") && strcmp(cs,".|")!=0);
 
   Real staff_thick = me->paper_l ()->get_var ("stafflinethickness");  
   Real half_space = 0.5;



reply via email to

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