From 578fd646cf403827686f096c1b746fa9abbb83fe Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Sat, 15 Nov 2014 23:09:15 -0800 Subject: [PATCH] partcombine: optional argument to control chords; issue 4198 --- input/regression/part-combine-chord-range.ly | 10 +++----- ly/music-functions-init.ly | 24 ++++++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/input/regression/part-combine-chord-range.ly b/input/regression/part-combine-chord-range.ly index 146b31c7e0..e28f6d4cdf 100644 --- a/input/regression/part-combine-chord-range.ly +++ b/input/regression/part-combine-chord-range.ly @@ -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 >> diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly index daf2b93a6f..d4755cbac3 100644 --- a/ly/music-functions-init.ly +++ b/ly/music-functions-init.ly @@ -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?) -- 2.39.5