]> git.donarmstrong.com Git - lilypond.git/commitdiff
Volta enhancements tranche 1
authorPhil Holmes <mail@philholmes.net>
Tue, 17 Jul 2012 17:35:14 +0000 (18:35 +0100)
committerPhil Holmes <mail@philholmes.net>
Mon, 23 Jul 2012 14:03:41 +0000 (15:03 +0100)
Documentation/de/notation/repeats.itely
Documentation/de/notation/rhythms.itely
Documentation/notation/repeats.itely
Documentation/notation/rhythms.itely
lily/repeat-acknowledge-engraver.cc
ly/music-functions-init.ly
scm/define-context-properties.scm

index 6735c55a030d131d884dfa1ad1d4863e2e0ef186..4e9ccded75c9e4999f3d8d940a0c22ab996030c3 100644 (file)
@@ -242,6 +242,25 @@ g1 |
 Die @code{measureLength}-Eigenschaft ist beschrieben in
 @ref{Verwaltung der Zeiteinheiten}.
 
+@cindex \inStaffSegno
+
+Der @code{\inStaffSegno}-Befehl kann angewandt werden, um das
+Segno-Zeichen in die Notenzeile einzubinden, auch in Kooperation
+mit dem @code{\repeat volta}-Befehl. Die benutzten
+Taktstrichsymbole können durch Überschreiben der Eigenschaften
+@code{segnoType}, @code{startRepeatSegnoType},
+@code{endRepeatSegnoType} bzw. @code{doubleRepeatSegnoType}
+geändert werden.
+
+@lilypond[verbatim,quote,relative=1]
+e1
+\repeat volta 2 {
+  \inStaffSegno
+  f2 g a b
+}
+c1_"D.S." \bar "|."
+@end lilypond
+
 @cindex Wiederholungen mit Überbindung
 @cindex Alternative Schlüsse mit Bindebogen
 @cindex Überbindung in Wiederholung
index 1d9e76608fc72a1c3a6aac389688819cdde1fce8..9c5052619117528b8ac41ef8a38466ed099152c8 100644 (file)
@@ -2811,6 +2811,10 @@ c4 c c c \break
 c1
 @end lilypond
 
+Darüber hinaus wählt der @code{\inStaffSegno}-Befehl eines dieser
+Segno-Taktstriche aus, in Zusammenarbeit mit dem
+@code{\repeat volta}-Befehl.
+
 In Partituren mit vielen Systemen wird ein @code{\bar}-Befehl in einem
 System automatisch auf alle anderen Systeme angewendet. Die resultierenden
 Taktstriche sind miteinander verbunden innerhalb einer Gruppe
index 8696a750096c135f2b8869e43ac78fec376c20da..5d916d281dbc1af6d65b01058b61ec809e443587 100644 (file)
@@ -239,6 +239,24 @@ g1 |
 The @code{measureLength} property is described in @ref{Time
 administration}.
 
+@funindex \inStaffSegno
+
+The @code{\inStaffSegno} command can be used to place the segno
+symbol in cooperation with the @code{\repeat volta} command.
+Alternative bar line symbols can be set in a Score context by
+overriding the properties @code{segnoType},
+@code{startRepeatSegnoType}, @code{endRepeatSegnoType} or
+@code{doubleRepeatSegnoType} as required.
+
+@lilypond[verbatim,quote,relative=1]
+e1
+\repeat volta 2 {
+  \inStaffSegno
+  f2 g a b
+}
+c1_"D.S." \bar "|."
+@end lilypond
+
 @cindex repeats, with ties
 @cindex alternative endings, with ties
 @cindex ties, in repeats
index 4b2bac28e67f04d5ae8ad0c2b6c7103010efb677..ed9424c45550e97fe87711672944f980132d6615 100644 (file)
@@ -2673,6 +2673,10 @@ c4 c c c \break
 c1
 @end lilypond
 
+Additionally there is an @code{\inStaffSegno} command which
+creates a segno bar, placed in cooperation
+with the @code{\repeat volta} command.
+
 
 In scores with many staves, a @code{\bar} command in one staff is
 automatically applied to all staves.  The resulting bar lines are
index 6d2b508481d062d73dcf7475ad0c9dc0c420915c..6ebb7199940bb30d66765ec19b5bad54a0feb6ba 100644 (file)
@@ -80,6 +80,7 @@ Repeat_acknowledge_engraver::process_music ()
   string s = "";
   bool start = false;
   bool end = false;
+  bool segno = false;
   bool volta_found = false;
   while (scm_is_pair (cs))
     {
@@ -88,17 +89,36 @@ Repeat_acknowledge_engraver::process_music ()
         start = true;
       else if (command == ly_symbol2scm ("end-repeat"))
         end = true;
+      else if (command == ly_symbol2scm ("segno-display"))
+        segno = true;
       else if (scm_is_pair (command) && scm_car (command) == ly_symbol2scm ("volta"))
         volta_found = true;
       cs = scm_cdr (cs);
     }
 
-  if (start && end)
-    s = robust_scm2string (get_property ("doubleRepeatType"), ":|:");
-  else if (start)
-    s = robust_scm2string (get_property ("startRepeatType"), "|:");
-  else if (end)
-    s =  robust_scm2string (get_property ("endRepeatType"), ":|");
+  /*
+    Select which bar type to set
+  */
+  if (segno)
+    if (start)
+      if (end) // { segno, start, end }
+        s = robust_scm2string (get_property ("doubleRepeatSegnoType"), ":|S|:");
+      else // { segno, start }
+        s = robust_scm2string (get_property ("startRepeatSegnoType"), ".S|:");
+    else
+      if (end) // { segno, end }
+        s = robust_scm2string (get_property ("endRepeatSegnoType"), ":|S");
+      else // { segno }
+        s = robust_scm2string (get_property ("segnoType"), "S");
+  else
+    if (start)
+      if (end) // { start, end }
+        s = robust_scm2string (get_property ("doubleRepeatType"), ":|:");
+      else // { start }
+        s = robust_scm2string (get_property ("startRepeatType"), "|:");
+    else
+      if (end) // { end }
+        s = robust_scm2string (get_property ("endRepeatType"), ":|");
 
   /*
     TODO: line breaks might be allowed if we set whichBar to "".
@@ -128,6 +148,12 @@ ADD_TRANSLATOR (Repeat_acknowledge_engraver,
 
                 /* read */
                 "doubleRepeatType "
+                "startRepeatType "
+                "endRepeatType "
+                "doubleRepeatSegnoType "
+                "startRepeatSegnoType "
+                "endRepeatSegnoType "
+                "segnoType "
                 "repeatCommands "
                 "whichBar ",
 
index 54ada96164a7e6697b5a79fd74885de2d0500dcb..45f9a13638396298caedd5d921269df25f1558a8 100644 (file)
@@ -449,6 +449,19 @@ given through @var{ratio}.")
     \revert NoteHead #'stencil
   #})
 
+inStaffSegno =
+#(define-music-function (parser location) ()
+   (_i "Put the segno variant 'varsegno' at this position into the staff,
+compatible with the repeat command.")
+   (make-music 'ApplyContext
+               'procedure
+               (lambda (ctx)
+                 (let ((score-ctx (ly:context-find ctx 'Score)))
+                   (if (ly:context? score-ctx)
+                     (let ((old-rc (ly:context-property score-ctx 'repeatCommands '())))
+                       (if (eq? (memq 'segno-display old-rc) #f)
+                         (ly:context-set-property! score-ctx 'repeatCommands (cons 'segno-display old-rc)))))))))
+
 instrumentSwitch =
 #(define-music-function
    (parser location name) (string?)
index e0b45ab670b0b945b29cb0bac1872951633553ba..16a1b21b1ead90d461c8671c8ee9716d47819b71 100644 (file)
@@ -212,6 +212,8 @@ This variable is read by @rinternals{Timing_translator} at
      (defaultStrings ,list? "A list of strings to use in calculating
 frets for tablatures and fretboards if no strings are provided in
 the notes for the current moment.")
+     (doubleRepeatSegnoType ,string? "Set the default bar line for
+the combinations double repeat with segno. Default is @samp{:|S|:}.")
      (doubleRepeatType ,string? "Set the default bar line for double
 repeats.")
      (doubleSlurs ,boolean? "If set, two slurs are created for every
@@ -228,6 +230,8 @@ the symbol @samp{hihat}) as keys, and a list
 @code{(@var{notehead-style} @var{script} @var{vertical-position})} as
 values.")
 
+     (endRepeatSegnoType ,string? "Set the default bar line for the
+combinations ending of repeat with segno. Default is @samp{:|S}.")
      (endRepeatType ,string? "Set the default bar line for the ending
 of repeats.")
      (explicitClefVisibility ,vector? "@samp{break-visibility}
@@ -447,6 +451,8 @@ automatic fret calculator.")
      (searchForVoice ,boolean? "Signal whether a search should be made
 of all contexts in the context hierarchy for a voice to provide rhythms
 for the lyrics.")
+     (segnoType ,string? "Set the default bar line for a requested segno.
+Default is @samp{S}.")
      (shapeNoteStyles ,vector? "Vector of symbols, listing style for
 each note head relative to the tonic (qv.) of the scale.")
      (shortInstrumentName ,markup? "See @code{instrumentName}.")
@@ -478,6 +484,8 @@ part-combining.")
 @code{traditional}, or @code{semitone}.")
      (stanza ,markup? "Stanza @q{number} to print before the start of a
 verse.  Use in @code{Lyrics} context.")
+     (startRepeatSegnoType ,string? "Set the default bar line for the
+combinations beginning of repeat with segno. Default is @samp{.S|:}.")
      (startRepeatType ,string? "Set the default bar line for the beginning
 of repeats.")
      (stemLeftBeamCount ,integer? "Specify the number of beams to draw