(music->lily-string music))
(ly:music-property sim 'elements)))))
-(define-extra-display-method SimultaneousMusic (expr)
- "If `sim' is an \afterGrace expression, return \"\\afterGrace ...\".
-Otherwise, return #f."
- ;; TODO: do something with afterGraceFraction?
- (with-music-match (expr (music 'SimultaneousMusic
- elements (?before-grace
- (music 'SequentialMusic
- elements ((music 'SkipMusic)
- (music 'GraceMusic
- element ?grace))))))
- (format #f "\\afterGrace ~a ~a"
- (music->lily-string ?before-grace)
- (music->lily-string ?grace))))
-
;;;
;;; Chords
;;;
(music->lily-string (ly:music-property chord 'element)))
(define-display-method MarkEvent (mark)
- (let ((label (ly:music-property mark 'label)))
- (if (null? label)
- "\\mark \\default"
- (format #f "\\mark ~a" (markup->lily-string label)))))
+ (let ((label (ly:music-property mark 'label #f)))
+ (string-append "\\mark "
+ (if label (value->lily-string label) "\\default"))))
(define-display-method KeyChangeEvent (key)
(let ((pitch-alist (ly:music-property key 'pitch-alist))
(format #f "~s" string)
string))
(markup->lily-string text)))
- (map-in-order (lambda (m) (music->lily-string m))
+ (map-in-order music->lily-string
(ly:music-property lyric 'articulations))))
(define-display-method BreathingEvent (event)
(parameterize ((*current-context* ctype))
(music->lily-string music)))))
+;; \afterGrace
+(define-extra-display-method ContextSpeccedMusic (expr)
+ "If `sim' is an \afterGrace expression, return \"\\afterGrace ...\".
+Otherwise, return #f."
+ ;; TODO: do something with afterGraceFraction?
+ (with-music-match
+ (expr (music 'ContextSpeccedMusic
+ context-type 'Bottom
+ element
+ (music 'SimultaneousMusic
+ elements (?before-grace
+ (music 'SequentialMusic
+ elements ((music 'SkipMusic)
+ (music 'GraceMusic
+ element ?grace)))))))
+ (format #f "\\afterGrace ~a ~a"
+ (music->lily-string ?before-grace)
+ (music->lily-string ?grace))))
+
+
;; special cases: \figures \lyrics \drums
(define-extra-display-method ContextSpeccedMusic (expr)
(with-music-match (expr (music 'ContextSpeccedMusic
num den
(new-line->lily-string))
(format #f
- "\\time #'~a ~a/~a~a"
+ ;; This is silly but the latter will also work for #f
+ ;; and other
+ (if (key-list? structure)
+ "\\time ~{~a~^,~} ~a/~a~a"
+ "\\time #'~a ~a/~a~a")
structure num den
(new-line->lily-string)))))
(music 'ContextSpeccedMusic
context-id "null"
context-type 'NullVoice)
- ?pc-music))))
+ ?pc-music
+ ?pc-marks))))
(with-music-match
(?pc-music (music 'PartCombineMusic))
(format #f "~a" (music->lily-string ?pc-music)))))