(add-quotable name music))
%% keep these two together
-afterGraceFraction = #(cons 6 8)
+afterGraceFraction = 3/4
afterGrace =
-#(define-music-function (main grace) (ly:music? ly:music?)
- (_i "Create @var{grace} note(s) after a @var{main} music expression.")
+#(define-music-function (fraction main grace) ((fraction?) ly:music? ly:music?)
+ (_i "Create @var{grace} note(s) after a @var{main} music expression.
+
+The musical position of the grace expression is after a
+given fraction of the main note's duration has passed. If
+@var{fraction} is not specified as first argument, it is taken from
+@code{afterGraceFraction} which has a default value of @code{3/4}.")
(let ((main-length (ly:music-length main))
- (fraction (ly:parser-lookup 'afterGraceFraction)))
+ (fraction (or fraction (ly:parser-lookup 'afterGraceFraction))))
(make-simultaneous-music
(list
main
(make-music 'SkipMusic
'duration (ly:make-duration
0 0
- (* (ly:moment-main-numerator main-length)
- (car fraction))
- (* (ly:moment-main-denominator main-length)
- (cdr fraction))))
+ (* (ly:moment-main main-length)
+ (/ (car fraction) (cdr fraction)))))
(make-music 'GraceMusic
'element grace)))))))
(if p
(make-music 'ApplyOutputEvent
'context-type (first p)
+ 'symbol (second p)
'procedure
(lambda (grob orig-context context)
- (if (equal?
- (cdr (assoc 'name (ly:grob-property grob 'meta)))
- (second p))
- (ly:grob-set-nested-property!
- grob (cddr p) value))))
+ (ly:grob-set-nested-property! grob (cddr p) value)))
(make-music 'Music))))
#(define-music-function (music)
(ly:music?)
(_i "Return @var{music} in reverse order.")
- (retrograde-music music))
+ (retrograde-music
+ (expand-repeat-notes!
+ (expand-repeat-chords!
+ (cons 'rhythmic-event
+ (ly:parser-lookup '$chord-repeat-events))
+ music))))
revertTimeSignatureSettings =
#(define-music-function
(define (offset-control-points offsets)
(if (null? offsets)
coords
- (map
- (lambda (x y) (coord-translate x y))
- coords offsets)))
+ (map coord-translate coords offsets)))
(define (helper sibs offs)
(if (pair? offs)
(else (make-sequential-music lst))))))
unfoldRepeats =
-#(define-music-function (music) (ly:music?)
- (_i "Force any @code{\\repeat volta}, @code{\\repeat tremolo} or
+#(define-music-function (types music)
+ ((symbol-list-or-symbol? '()) ly:music?)
+ (_i "Force @code{\\repeat volta}, @code{\\repeat tremolo} or
@code{\\repeat percent} commands in @var{music} to be interpreted
-as @code{\\repeat unfold}.")
- (unfold-repeats music))
+as @code{\\repeat unfold}, if specified in the optional symbol-list @var{types}.
+The default for @var{types} is an empty list, which will force any of those
+commands in @var{music} to be interpreted as @code{\\repeat unfold}. Possible
+entries are @code{volta}, @code{tremolo} or @code{percent}. Multiple entries
+are possible.")
+ (unfold-repeats types music))
void =
#(define-void-function (arg) (scheme?)