summaryrefslogtreecommitdiff
path: root/scm
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 /scm
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 'scm')
-rw-r--r--scm/define-context-properties.scm3
-rw-r--r--scm/define-event-classes.scm2
-rw-r--r--scm/define-music-properties.scm1
-rw-r--r--scm/define-music-types.scm5
-rw-r--r--scm/part-combiner.scm13
5 files changed, 14 insertions, 10 deletions
diff --git a/scm/define-context-properties.scm b/scm/define-context-properties.scm
index 3ad11f4913..df664bd98f 100644
--- a/scm/define-context-properties.scm
+++ b/scm/define-context-properties.scm
@@ -495,6 +495,9 @@ Changing this creates a new text spanner.")
translator during music interpretation.")
+ (partCombineForced ,symbol? "Override for the partcombine
+decision. Can be @code{apart}, @code{chords}, @code{unisono},
+@code{solo1}, or @code{solo2}.")
(partCombineTextsOnNote ,boolean? "Print part-combine texts only on
the next note rather than immediately on rests or skips.")
(pedalSostenutoStrings ,list? "See @code{pedalSustainStrings}.")
diff --git a/scm/define-event-classes.scm b/scm/define-event-classes.scm
index dd976e1b04..4eebdfac0e 100644
--- a/scm/define-event-classes.scm
+++ b/scm/define-event-classes.scm
@@ -31,7 +31,7 @@
extender-event span-event rhythmic-event dynamic-event
break-event label-event percent-event key-change-event
string-number-event stroke-finger-event tie-event
- part-combine-event part-combine-force-event
+ part-combine-event
beam-forbid-event script-event tempo-change-event
tremolo-event bend-after-event fingering-event
glissando-event harmonic-event hyphen-event
diff --git a/scm/define-music-properties.scm b/scm/define-music-properties.scm
index 0bcc5a20af..4df3f93340 100644
--- a/scm/define-music-properties.scm
+++ b/scm/define-music-properties.scm
@@ -96,7 +96,6 @@ a sequential iterator. Takes a single music parameter.")
(footnote-text ,markup? "Text to appear in a footnote.")
(force-accidental ,boolean? "If set, a cautionary accidental should
always be printed on this note.")
- (forced-type ,symbol? "Override for the part-combiner.")
(grob-property ,symbol? "The symbol of the grob property to set.")
(grob-property-path ,list? "A list of symbols, locating a nested grob
diff --git a/scm/define-music-types.scm b/scm/define-music-types.scm
index 5ae59799f6..e0190eda55 100644
--- a/scm/define-music-types.scm
+++ b/scm/define-music-types.scm
@@ -386,11 +386,6 @@ Syntax: @code{\\override} [ @var{context} @code{.} ]
(types . (break-event page-turn-event event))
))
- (PartCombineForceEvent
- . ((description . "Override the part-combiner's strategy.")
- (types . (part-combine-force-event event))
- ))
-
(PartialSet
. ((description . "Create an anacrusis or upbeat (partial measure).")
(iterator-ctor . ,ly:partial-iterator::constructor)
diff --git a/scm/part-combiner.scm b/scm/part-combiner.scm
index 71b5e56526..94860cdf6f 100644
--- a/scm/part-combiner.scm
+++ b/scm/part-combiner.scm
@@ -345,9 +345,16 @@ LilyPond version 2.8 and earlier."
(define (analyse-forced-combine result-idx prev-res)
(define (get-forced-event x)
- (and (ly:in-event-class? x 'part-combine-force-event)
- (cons (ly:event-property x 'forced-type)
- (ly:event-property x 'once))))
+ (cond
+ ((and (ly:in-event-class? x 'SetProperty)
+ (eq? (ly:event-property x 'symbol) 'partCombineForced))
+ (cons (ly:event-property x 'value #f)
+ (ly:event-property x 'once #f)))
+ ((and (ly:in-event-class? x 'UnsetProperty)
+ (eq? (ly:event-property x 'symbol) 'partCombineForced))
+ (cons #f (ly:event-property x 'once #f)))
+ (else #f)))
+
(define (part-combine-events vs)
(if (not vs)
'()