]> git.donarmstrong.com Git - lilypond.git/commitdiff
partcombine: optional argument to control chords; issue 4198
authorKeith OHara <k-ohara5a5a@oco.net>
Sun, 16 Nov 2014 07:09:15 +0000 (23:09 -0800)
committerKeith OHara <k-ohara5a5a@oco.net>
Mon, 24 Nov 2014 06:09:30 +0000 (22:09 -0800)
input/regression/part-combine-chord-range.ly
ly/music-functions-init.ly

index 146b31c7e0f836ebb5959194527e6f874d431876..e28f6d4cdf3a0e6685b5070f9757b7b4c3122cc1 100644 (file)
@@ -1,6 +1,6 @@
 \header {
-  texidoc ="The part combiner has an internal option to set the range
-of intervals that may be combined into chords."
+  texidoc ="The part combiner has an option to set the range of
+differences in steps between parts that may be combined into chords."
 }
 
 \version "2.19.16"
@@ -15,13 +15,9 @@ vtwo = \relative e' {
   e4 e e e | e eisis d deses | c2 cisis
 }
 
-customcombine =
-#(define-music-function (parser location part1 part2) (ly:music? ly:music?)
-   (make-part-combine-music parser (list part1 part2) #f '(2 . 12)))
-
 comm = { s1_"apart" s1_"chords" s1_"apart" }
 
 \new Staff <<
-  \customcombine \vone \vtwo
+  \partcombine #'(2 . 12) \vone \vtwo
   \comm
 >>
index daf2b93a6ff804443365b0a2b4e6c57cfe60da7f..d4755cbac3ccbb952c8895212ec9723eca6a8942 100644 (file)
@@ -1131,28 +1131,32 @@ parenthesize =
        (set! (ly:music-property arg 'parenthesize) #t))
    arg)
 
-#(define partcombine-chord-range '(0 . 8))
-
 partcombine =
-#(define-music-function (parser location part1 part2) (ly:music? ly:music?)
-   (_i "Take the music in @var{part1} and @var{part2} and typeset so
-that they share a staff.")
+#(define-music-function (parser location chord-range part1 part2)
+   ((number-pair? '(0 . 8)) ly:music? ly:music?)
+   (_i "Take the music in @var{part1} and @var{part2} and return
+a music expression containing simultaneous voices, where @var{part1}
+and @var{part2} are combined into one voice where appropriate.
+Optional @var{chord-range} sets the distance in steps between notes
+that may be combined into a chord or unison.")
    (make-part-combine-music parser
-                            (list part1 part2) #f partcombine-chord-range))
+                            (list part1 part2) #f chord-range))
 
 partcombineUp =
-#(define-music-function (parser location part1 part2) (ly:music? ly:music?)
+#(define-music-function (parser location chord-range part1 part2)
+   ((number-pair? '(0 . 8)) ly:music? ly:music?)
    (_i "Take the music in @var{part1} and @var{part2} and typeset so
 that they share a staff with stems directed upward.")
    (make-part-combine-music parser
-                            (list part1 part2) UP partcombine-chord-range))
+                            (list part1 part2) UP chord-range))
 
 partcombineDown =
-#(define-music-function (parser location part1 part2) (ly:music? ly:music?)
+#(define-music-function (parser location chord-range part1 part2)
+   ((number-pair? '(0 . 8)) ly:music? ly:music?)
    (_i "Take the music in @var{part1} and @var{part2} and typeset so
 that they share a staff with stems directed downward.")
    (make-part-combine-music parser
-                            (list part1 part2) DOWN partcombine-chord-range))
+                            (list part1 part2) DOWN chord-range))
 
 partcombineForce =
 #(define-music-function (location parser type once) (symbol-or-boolean? boolean?)