(define (pitch= pitch1 pitch2)
(and (= (ly:pitch-notename pitch1) (ly:pitch-notename pitch2))
(= (ly:pitch-alteration pitch1) (ly:pitch-alteration pitch2))))
- (let* ((pitches (ly:parser-lookup 'pitchnames))
- (result (rassoc ly-pitch pitches pitch=)))
+ (let* ((result (rassoc ly-pitch pitchnames pitch=)))
(and result (car result))))
(define-public (octave->lily-string pitch)
(new-line->lily-string))))
(define-display-method PropertyUnset (expr)
- (format #f "\\unset ~a~a~a"
+ (format #f "~a\\unset ~a~a~a"
+ (if (ly:music-property expr 'once #f) "\\once " "")
(if (eqv? (*current-context*) 'Bottom)
""
(format #f "~a . " (*current-context*)))
(define-display-method RevertProperty (expr)
(let* ((symbol (ly:music-property expr 'symbol))
(properties (ly:music-property expr 'grob-property-path
- (list (ly:music-property expr 'grob-property)))))
- (format #f "\\revert ~{~a~^.~}~a"
+ (list (ly:music-property expr
+ 'grob-property))))
+ (once (ly:music-property expr 'once #f)))
+ (format #f "~a\\revert ~{~a~^.~}~a"
+ (if once "\\once " "")
(if (eqv? (*current-context*) 'Bottom)
(cons symbol properties)
(cons* (*current-context*) symbol properties))
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)))))