#{ \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?)
;; should only be attempted when the simple uses don't match the
;; given predicate.
(if (ly:music? item)
- (tweak prop value item)
+ (if (music-is-of-type? item 'context-specification)
+ ;; This is essentially dealing with the case
+ ;; \propertyTweak color #red \propertyTweak font-size #3 NoteHead
+ ;; namely when stacked tweaks end in a symbol list
+ ;; rather than a music expression.
+ ;;
+ ;; We have a tweak here to convert into an override,
+ ;; so we need to know the grob to apply it to. That's
+ ;; easy if we have a directed tweak, and otherwise we
+ ;; need to find the symbol in the expression itself.
+ (let* ((p (check-grob-path prop (*location*)
+ #:start 1
+ #:default #t
+ #:min 2))
+ (elt (ly:music-property item 'element))
+ (seq (if (music-is-of-type? elt 'sequential-music)
+ elt
+ (make-sequential-music (list elt))))
+ (elts (ly:music-property seq 'elements))
+ (symbol (if (symbol? (car p))
+ (car p)
+ (and (pair? elts)
+ (ly:music-property (car elts)
+ 'symbol)))))
+ (if (symbol? symbol)
+ (begin
+ (set! (ly:music-property seq 'elements)
+ (cons (make-music 'OverrideProperty
+ 'symbol symbol
+ 'grob-property-path (cdr p)
+ 'pop-first #t
+ 'grob-value value
+ 'origin (*location*))
+ elts))
+ (set! (ly:music-property item 'element) seq))
+ (begin
+ (ly:parser-error (_ "Cannot \\propertyTweak")
+ (*location*))
+ (ly:music-message item (_ "untweakable"))))
+ item)
+ (tweak prop value item))
(propertyOverride (append item (if (symbol? prop) (list prop) prop))
value)))
@code{\\once\\override} for the specified grob type. If @var{item} is
a music expression, the result is the same music expression with an
appropriate tweak applied.")
- (define (shape-curve grob)
+ (define (shape-curve grob coords)
(let* ((orig (ly:grob-original grob))
(siblings (if (ly:spanner? grob)
(ly:spanner-broken-into orig) '()))
- (total-found (length siblings))
- (function (assoc-get 'control-points
- (reverse (ly:grob-basic-properties grob))))
- (coords (function grob)))
-
+ (total-found (length siblings)))
(define (offset-control-points offsets)
(if (null? offsets)
coords
(if (>= total-found 2)
(helper siblings offsets)
(offset-control-points (car offsets)))))
- (once (propertyTweak 'control-points shape-curve item)))
+ (once (propertyTweak 'control-points
+ (grob-transformer 'control-points shape-curve)
+ item)))
shiftDurations =
#(define-music-function (dur dots arg)
;; p now contains at least two elements. The first
;; element is #t when no grob has been explicitly
;; specified, otherwise it is a grob name.
- ((music-is-of-type? music 'context-specification)
- ;; This is essentially dealing with the case
- ;; \tweak color #red \propertyTweak font-size #3 NoteHead
- ;; namely when stacked tweaks end in a symbol list
- ;; rather than a music expression.
- ;;
- ;; We have a tweak here to convert into an override,
- ;; so we need to know the grob to apply it to. That's
- ;; easy if we have a directed tweak, and otherwise we
- ;; need to find the symbol in the expression itself.
- (let* ((elt (ly:music-property music 'element))
- (seq (if (music-is-of-type? elt 'sequential-music)
- elt
- (make-sequential-music (list elt))))
- (elts (ly:music-property seq 'elements))
- (symbol (if (symbol? (car p))
- (car p)
- (and (pair? elts)
- (ly:music-property (car elts)
- 'symbol)))))
- (if (symbol? symbol)
- (begin
- (set! (ly:music-property seq 'elements)
- (cons (make-music 'OverrideProperty
- 'symbol symbol
- 'grob-property-path (cdr p)
- 'pop-first #t
- 'grob-value value
- 'origin (*location*))
- elts))
- (set! (ly:music-property music 'element) seq))
- (begin
- (ly:parser-error (_ "Cannot \\tweak")
- (*location*))
- (ly:music-message music (_ "untweakable"))))))
(else
(set! (ly:music-property music 'tweaks)
(acons (cond ((pair? (cddr p)) p)