(make-procedure-with-setter ly:grob-property
ly:grob-set-property!))
-(define-public ly:paper-system-property
- (make-procedure-with-setter ly:paper-system-property
- ly:paper-system-set-property!))
+(define-public ly:prob-property
+ (make-procedure-with-setter ly:prob-property
+ ly:prob-set-property!))
(define-public (music-map function music)
"Apply @var{function} to @var{music} and all of the music it contains.
',(ly:music-property obj 'name)
,@(apply append (map (lambda (prop)
`(',(car prop)
- ,(if (and (not (markup? (cdr prop)))
- (list? (cdr prop))
- (pair? (cdr prop))) ;; property is a non-empty list
- `(list ,@(map music->make-music (cdr prop)))
- (music->make-music (cdr prop)))))
+ ,(music->make-music (cdr prop))))
(remove (lambda (prop)
(eqv? (car prop) 'origin))
(ly:music-mutable-properties obj))))))
(;; an empty list (avoid having an unquoted empty list)
(null? obj)
`'())
+ (;; a proper list
+ (list? obj)
+ `(list ,@(map music->make-music obj)))
+ (;; a pair
+ (pair? obj)
+ `(cons ,(music->make-music (car obj))
+ ,(music->make-music (cdr obj))))
(else
obj)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-(define (shift-one-duration-log music shift dot)
- " add SHIFT to ly:duration-log and optionally
+(define-public (shift-one-duration-log music shift dot)
+ " add SHIFT to duration-log of 'duration in music and optionally
a dot to any note encountered. This scales the music up by a factor
2^shift * (2 - (1/2)^dot)"
(let ((d (ly:music-property music 'duration)))
(defmacro-public def-grace-function (start stop)
- `(def-music-function (parser location music) (ly:music?)
+ `(define-music-function (parser location music) (ly:music?)
(make-music 'GraceMusic
'origin location
'element (make-music 'SequentialMusic
music
(ly:music-deep-copy ,stop))))))
-(defmacro-public def-music-function (args signature . body)
+(defmacro-public define-music-function (args signature . body)
"Helper macro for `ly:make-music-function'.
Syntax:
- (def-music-function (parser location arg1 arg2 ...) (arg1-type? arg2-type? ...)
+ (define-music-function (parser location arg1 arg2 ...) (arg1-type? arg2-type? ...)
...function body...)
"
`(ly:make-music-function (list ,@signature)
(if (and (equal? nm object-name)
(procedure? cb))
(begin
- (ly:grob-set-property! grob 'stencil Balloon_interface::print)
+ (ly:grob-set-property! grob 'stencil ly:balloon-interface::print)
(set! (ly:grob-property grob 'original-stencil) cb)
(set! (ly:grob-property grob 'balloon-text) text)
(set! (ly:grob-property grob 'balloon-text-offset) off)
(ly:make-duration 0 0) '())))
(ly:music-compress skip (ly:music-length mus))
skip))
+
+(define-public (pitch-of-note event-chord)
+
+ (let*
+ ((evs (filter (lambda (x) (memq 'note-event (ly:music-property x 'types)))
+ (ly:music-property event-chord 'elements))))
+
+ (if (pair? evs)
+ (ly:music-property (car evs) 'pitch)
+ #f)))
+