summaryrefslogtreecommitdiff
path: root/ly
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2013-09-10 18:22:40 +0200
committerDavid Kastrup <dak@gnu.org>2015-10-05 12:28:52 +0200
commitdd9cdec4d7fb538b3a201f3b82a10b5ac9ef5f79 (patch)
tree1b89f538c0b1ff45bebb2cdccdba61f0a233046e /ly
parentaa2b5b377586a52fcb6b14d4dd464b94f6738560 (diff)
Issue 4131/1: Reimplement forced partcombine decisions via context properties
One music type and concept less to worry about. Since this tracks the partcombine decisions via context properties, using one forced partcombine override in one voice will not be cancelled by another forced partcombine in another. In the event stream, \once\override is indistinguishable from \override ... \revert so in order to be able to implement \once\partcombine ... in one voice, we have to retain any permanent \partcombineForce in the other.
Diffstat (limited to 'ly')
-rw-r--r--ly/music-functions-init.ly20
-rw-r--r--ly/property-init.ly21
2 files changed, 22 insertions, 19 deletions
diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index e976cb6644..5c6fb24e6e 100644
--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -1294,25 +1294,7 @@ that they share a staff with stems directed downward.")
#{ \with { \voiceTwo \override DynamicLineSpanner.direction = #DOWN } #}
#{ \with { \voiceTwo \override DynamicLineSpanner.direction = #DOWN } #} ))
-partcombineForce =
-#(define-music-function (type once) (boolean-or-symbol? boolean?)
- (_i "Override the part-combiner.")
- (make-music 'EventChord
- 'elements (list (make-music 'PartCombineForceEvent
- 'forced-type type
- 'once once))))
-partcombineApart = \partcombineForce #'apart ##f
-partcombineApartOnce = \partcombineForce #'apart ##t
-partcombineChords = \partcombineForce #'chords ##f
-partcombineChordsOnce = \partcombineForce #'chords ##t
-partcombineUnisono = \partcombineForce #'unisono ##f
-partcombineUnisonoOnce = \partcombineForce #'unisono ##t
-partcombineSoloI = \partcombineForce #'solo1 ##f
-partcombineSoloIOnce = \partcombineForce #'solo1 ##t
-partcombineSoloII = \partcombineForce #'solo2 ##f
-partcombineSoloIIOnce = \partcombineForce #'solo2 ##t
-partcombineAutomatic = \partcombineForce ##f ##f
-partcombineAutomaticOnce = \partcombineForce ##f ##t
+%% Part combine forcing to be found in ly/property-init.ly
partial =
#(define-music-function (dur) (ly:duration?)
diff --git a/ly/property-init.ly b/ly/property-init.ly
index 4a11fcf4d7..16275693e9 100644
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -405,6 +405,27 @@ palmMute =
(_i "Print @var{note} with a triangle-shaped note head.")
(style-note-heads 'NoteHead 'do note))
+%% part combiner
+
+partcombineForce =
+#(define-music-function (type) ((symbol?))
+ (_i "Override the part-combiner.")
+ (if type (propertySet 'partCombineForced type)
+ (propertyUnset 'partCombineForced)))
+
+partcombineApart = \partcombineForce #'apart
+partcombineApartOnce = \once \partcombineApart
+partcombineChords = \partcombineForce #'chords
+partcombineChordsOnce = \once \partcombineChords
+partcombineUnisono = \partcombineForce #'unisono
+partcombineUnisonoOnce = \once \partcombineUnisono
+partcombineSoloI = \partcombineForce #'solo1
+partcombineSoloIOnce = \once \partcombineSoloI
+partcombineSoloII = \partcombineForce #'solo2
+partcombineSoloIIOnce = \once \partcombineSoloII
+partcombineAutomatic = \partcombineForce \default
+partcombineAutomaticOnce = \once \partcombineAutomatic
+
%% phrasing slurs