;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 1998--2006 Jan Nieuwenhuizen <janneke@gnu.org>
;;;; Han-Wen Nienhuys <hanwen@cs.uu.nl>
;; (use-modules (ice-9 optargs))
(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.
(set! (ly:music-property m 'procedure) checker)
m))
+
+(define-public (skip->rest mus)
+
+ "Replace MUS by RestEvent of the same duration if it is a
+SkipEvent. Useful for extracting parts from crowded scores"
+
+ (if (equal? (ly:music-property mus 'name) 'SkipEvent)
+ (make-music 'RestEvent 'duration (ly:music-property mus 'duration))
+ mus))
+
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; warn for bare chords at start.
(equal? (ly:music-property x 'name) 'RequestChord))
elts)))
-(define (ly:music-message music msg)
+(define-public (ly:music-message music msg)
(let ((ip (ly:music-property music 'origin)))
(if (ly:input-location? ip)
(ly:input-message ip msg)
(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)))
+