Issue 659: alternate segno symbol
authorMarc Hohl <marc@hohlart.de>
Thu, 14 Jan 2010 08:57:55 +0000 (09:57 +0100)
committerCarl Sorensen <c_sorensen@byu.edu>
Mon, 12 Apr 2010 17:59:02 +0000 (11:59 -0600)
An alternate segno symbol is included in mf/feta-scripts.mf.
New arguments to the \bar command are introduced for easier
use of the new sign.

Documentation/changes.tely
Documentation/notation/rhythms.itely
input/regression/bar-line-segno.ly [new file with mode: 0644]
lily/bar-line.cc
lily/span-bar.cc
mf/feta-scripts.mf
scm/output-lib.scm

index 8569dbf56f67004badce4e245c04aaf92d26058c..d680057e50ec7ca44700492f9daff1813acb7b51 100644 (file)
@@ -281,6 +281,13 @@ and to add notes to the number or fraction:
 FretBoards now have a chordChanges property to keep repeated FretBoard objects
 from being typeset.
 
+@item
+A variant of the segno sign is provided:
+@lilypond[quote,relative=2]
+c4 d e f \bar "S"
+g4 f e d
+@end lilypond
+
 @end itemize
 
 
index 279f1ceb9d31bb80b6b674da298e42354b598db8..ac6dfa92e0ff298aa4d5c6ffe17c0b4811e701a3 100644 (file)
@@ -2155,6 +2155,26 @@ However, as such ticks are typically used in Gregorian chant, it is
 preferable to use @code{\divisioMinima} there instead, described in
 the section @ref{Divisiones} in Gregorian chant.
 
+@cindex segno
+
+For in-line segno signs, there are three types of bar lines which
+differ in their behavior at line breaks:
+
+@lilypond[quote,relative=2,verbatim]
+c4 c c c
+\bar "S"
+c4 c c c \break
+\bar "S"
+c4 c c c
+\bar "|S"
+c4 c c c \break
+\bar "|S"
+c4 c c c
+\bar "S|"
+c4 c c c \break
+\bar "S|"
+c1
+@end lilypond
 
 @cindex repeats
 
@@ -2177,6 +2197,38 @@ c4 c c c \break
 c4 c c c
 @end lilypond
 
+For combinations of repeats with the segno sign, there are six different
+variations:
+
+@lilypond[quote,relative=2,verbatim]
+c4 c c c
+\bar ":|S"
+c4 c c c \break
+\bar ":|S"
+c4 c c c
+\bar ":|S."
+c4 c c c \break
+\bar ":|S."
+c4 c c c
+\bar "S|:"
+c4 c c c \break
+\bar "S|:"
+c4 c c c
+\bar ".S|:"
+c4 c c c \break
+\bar ".S|:"
+c4 c c c
+\bar ":|S|:"
+c4 c c c \break
+\bar ":|S|:"
+c4 c c c
+\bar ":|S.|:"
+c4 c c c \break
+\bar ":|S.|:"
+c1
+@end lilypond
+
+
 In scores with many staves, a @code{\bar} command in one staff is
 automatically applied to all staves.  The resulting bar lines are
 connected between different staves of a @code{StaffGroup},
diff --git a/input/regression/bar-line-segno.ly b/input/regression/bar-line-segno.ly
new file mode 100644 (file)
index 0000000..4974326
--- /dev/null
@@ -0,0 +1,25 @@
+\version "2.13.17"
+
+\header { texidoc = "Segno bar lines can be used to mark
+                     the begin and the end of a segno part."
+        }
+
+\paper { ragged-right = ##t }
+
+\relative \new StaffGroup <<
+  \new Staff {
+    c4 \bar "S" c \bar "|S" c \bar "S|" c \bar ":|S" \break
+    c4 c \bar ":|S|:" c c \bar ":|S.|:" \break
+    c4 c c2 \bar ".S|:" \break
+    c1 \bar ":|S." \break
+    c1 \bar "S" \break
+    c1 }
+  \new Staff {
+    c4 c c c
+    c4 c c c
+    c4 c c c
+    c4 c c c
+    c4 c c c
+    c1
+  }
+>>
index 503420b7b3af40072f380caf0bbf4b54b043ba7a..d3f21e5350ec0ca0ac1176ba740d781ab0c2ad4c 100644 (file)
@@ -116,6 +116,9 @@ Bar_line::compound_barline (Grob *me, string str, Real h,
   if (str == "||:")
     str = "|:";
 
+  if (str == "|S" || str == "S|")
+    str = "S";
+
   if (str == "")
     {
       Stencil empty =  Lookup::blank (Box (Interval (0, 0), Interval (-h / 2, h / 2)));
@@ -193,9 +196,58 @@ Bar_line::compound_barline (Grob *me, string str, Real h,
       /*
        should align to other side? this never appears
        on the system-start?
-      */
       m.add_at_edge (X_AXIS, RIGHT, thin, 0);
       m.add_at_edge (X_AXIS, RIGHT, thin, thinkern);
+      */
+      m.add_at_edge (X_AXIS, LEFT, thin, thinkern / 2);
+      m.add_at_edge (X_AXIS, RIGHT, thin, thinkern / 2);
+    }
+  else if (str.find ("S") != NPOS || str == "|._.|")
+    {
+      //  Handle all varsegno stuff
+      Stencil segno;
+      segno.add_at_edge (X_AXIS, LEFT, thin, thinkern / 2);
+      segno.add_at_edge (X_AXIS, RIGHT, thin, thinkern / 2);
+      segno.add_stencil (Font_interface::get_default_font (me)->find_by_name ("scripts.varsegno"));
+
+      if (str == "S")
+        {
+          m.add_stencil (segno);
+        }
+      else if (str == "S|:" || str == ".S|:")
+        {
+          m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+          m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+          m.add_at_edge (X_AXIS, RIGHT, colon, kern);
+          m.add_at_edge (X_AXIS, LEFT, segno, thinkern);
+        }
+      else if (str == ":|S" || str == ":|S.")
+        {
+          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, segno, thinkern);
+        }
+      else if (str == ":|S|:" || str == ":|S.|:")
+        {
+          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, segno, thinkern);
+          m.add_at_edge (X_AXIS, RIGHT, thick, thinkern);
+          m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+          m.add_at_edge (X_AXIS, RIGHT, colon, kern);
+        }
+      else if (str == "|._.|") // :|S|: or :|S.|: without segno and colon
+        {
+          // get the width of the segno sign
+          Real segno_width = segno.extent (X_AXIS).length ();
+          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, thick, segno_width + 2 * thinkern);
+          m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+        }
+      // end varsegno block
     }
   else if (str == ":")
     {
@@ -369,19 +421,36 @@ ADD_INTERFACE (Bar_line,
               " is a string which specifies the kind of bar line to print."
               "  Options are @code{|}, @code{:|}, @code{|:}, @code{:|:}, @code{:|.|:},"
               " @code{:|.:}, @code{.}, @code{||}, @code{|.}, @code{.|}, @code{.|.},"
-              " @code{|.|}, @code{:}, @code{dashed} and @code{'}.\n"
+              " @code{|.|}, @code{:}, @code{dashed}, @code{'} and @code{S}.\n"
               "\n"
               "These produce, respectively, a normal bar line, a right repeat, a left repeat,"
               " a thick double repeat, a thin-thick-thin double repeat,"
               " a thin-thick double repeat, a thick bar, a double bar, a start bar,"
               " an end bar, a thick double bar, a thin-thick-thin bar,"
-              " a dotted bar, a dashed bar, and a tick."
-              "  In addition, there is an option"
+              " a dotted bar, a dashed bar, a tick as bar line and a segno bar.\n"
+              "\n"
+              "In addition, there is an option"
               " @code{||:} which is equivalent to @code{|:} except at line"
               " breaks, where it produces a double bar (@code{||}) at the"
               " end of the line and a repeat sign (@code{|:}) at the"
               " beginning of the new line.\n"
               "\n"
+              "For segno, @code{S} produces a segno sign except at line breaks,"
+              " where it produces a double bar (@code{||}) at the"
+              " end of the line and a segno sign at the beginning of the new line."
+              " @code{|S} is equivalent to @code{S} but produces a simple bar line"
+              " (@code{|}) instead of a double bar line (@code{||}) at line breaks."
+              " @code{S|} produces the segno sign at line breaks and starts the following"
+              " line without special bar lines.\n"
+              "\n"
+              "@code{S|:} and @code{:|S} are used for repeat/segno combinations that are"
+              " separated at line breaks. Alternatively, @code{.S|:} and @code{:|S.}"
+              " may be used which combine repeat signs and segno at the same line in"
+              " case of a line break. @code{:|S|:} is a combination of a left repeat"
+              " (@code{:|}), a segno (@code{S}) and a right repeat @code{|:} which"
+              " splits before the segno at line breaks; @code{:|S.|:} splits after"
+              " the segno sign.\n"
+              "\n"
               "If @var{bartype} is set to @code{empty} then nothing is"
               " printed, but a line break is allowed at that spot.\n"
               "\n"
index 3ef38ec8125e9a2ac5ea291632511860c988a3be..36590c30a598fb1c6c4188c3bc46bc83749ca0c5 100644 (file)
@@ -128,7 +128,7 @@ Span_bar::width (SCM smob)
   SCM gn = me->get_property ("glyph-name");
   if (!me->is_live ())
     return ly_interval2scm (Interval ());
-  
+
   string gl = ly_scm2string (gn);
 
   /*
@@ -201,6 +201,14 @@ Span_bar::calc_glyph_name (SCM smob)
     type = "|.|";
   else if (type == ":|.:")
     type = "|.";
+  else if (type == "S" || type == "S|" || type == "|S")
+    type = "||";
+  else if (type == "S|:" || type == ".S|:")
+    type = ".|";
+  else if (type == ":|S" || type == ":|S.")
+    type = "|.";
+    else if (type == ":|S|:" || type == ":|S.|:")
+    type = "|._.|";
   else if (type == "'")
     type = "";
 
index dbcac4d8342f52532b3afc5d5521d26fd3b65c61..6d921cb74606fcfae725df6c361abe685f096060 100644 (file)
@@ -1151,6 +1151,84 @@ fet_beginchar ("Segno", "segno");
        penlabels (range 1 thru 8);
 fet_endchar;
 
+fet_beginchar ("Varied Segno", "varsegno");
+       save ht, wd, loopdist, loopangle;
+       save thin, med, thick;
+       save bulbradius;
+
+       ht# = 8 staff_space#;
+       wd# = 2.5 staff_space#;
+
+       set_char_box (wd# / 2, wd# / 2, ht# / 2, ht# / 2);
+       %set_char_box (0, 0, ht# / 2, ht# / 2);
+
+       loopdist = 4/3 staff_space;
+       loopangle = 35;
+
+       thick = 1/2 staff_space;
+       med   = 1/4 staff_space;
+       thin = 1/10 staff_space;
+
+       x1 = staff_space;
+       y1 = 13/4 staff_space;
+       penpos1 (med,  210);
+
+       z2l = (0, 4 staff_space);
+       penpos2 (med, 270 - loopangle);
+
+       x3 = -x1;
+       y3 = y1 + 1/4 staff_space;
+       penpos3 (med, 270 + loopangle);
+
+        pair center;
+        center = (0, 2 staff_space);
+       z4 = (3/4 staff_space, 2 staff_space) rotatedabout (center, 180 - loopangle);
+       z5 = 2[z4,center];
+       x9  = x4; y9  = y4 - 2 loopdist;
+       x10 = x5; y10 = y5 - 2 loopdist;
+       penpos4  (thick, 90 - loopangle);
+       penpos5  (thick, 90 - loopangle);
+       penpos9  (thick, 90 - loopangle);
+       penpos10 (thick, 90 - loopangle);
+
+       z6 = (4/3 staff_space, 4/3 staff_space) rotatedabout (2/3 center, -loopangle);
+       x11 = x6; y11 = y6 - 2 loopdist;
+       penpos6  (thin, -loopangle);
+       penpos11 (thin, -loopangle);
+
+       z7 = 1/3 center;
+       penpos7 (thick, 270 - loopangle);
+
+       z8 = (4/3 staff_space, 0) rotated (180 - loopangle);
+       penpos8 (thin, -loopangle);
+
+       z12 = -center;
+       penpos12 (thick, 270 - loopangle);
+
+       z1' = 4/3[z1l,z1r];
+       bulbradius = length ( z1l - z1');
+       pickup pencircle scaled 2 bulbradius;
+       drawdot z1';
+
+       penstroke z1e
+              .. z2e
+              .. z3e
+              .. z4e{dir (-loopangle)}
+              .. z5e{dir (-loopangle)}
+              .. z6e
+              .. z7e
+              .. z8e
+              .. z9e{dir (-loopangle)}
+              .. z10e{dir (-loopangle)}
+              .. z11e
+              .. {dir (180 - loopangle)}z12e;
+       addto currentpicture also currentpicture scaled -1;
+
+       penlabels (1, 1', 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
+       %draw_staff (-2, 2, 0);
+fet_endchar;
+
+
 
 fet_beginchar ("Coda", "coda");
        save stickout, thin, thick, codawidth, codaheight;
index 8e17401477a79435adc2c47ead1db86c86faf8fc..04accee6652ee904a4e724caff31893520e13240 100644 (file)
@@ -218,7 +218,18 @@ and duration-log @var{log}."
     ("'" . ("'" . ()))
     ("empty" . (() . ()))
     ("brace" . (() . "brace"))
-    ("bracket" . (() . "bracket"))))
+    ("bracket" . (() . "bracket"))
+
+    ;; segno bar lines
+    ("S" . ("||" . "S"))
+    ("|S" . ("|" . "S"))
+    ("S|" . ("S" . ()))
+    (":|S" . (":|" . "S"))
+    (":|S." . (":|S" . ()))
+    ("S|:" . ("S" . "|:"))
+    (".S|:" . ("|" . "S|:"))
+    (":|S|:" . (":|" . "S|:"))
+    (":|S.|:" . (":|S" . "|:"))))
 
 (define-public (bar-line::calc-glyph-name grob)
   (let* ((glyph (ly:grob-property grob 'glyph))