]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/music-functions.scm
* lily/parenthesis-engraver.cc (acknowledge_grob): don't do
[lilypond.git] / scm / music-functions.scm
index 36c4b84877c43c7daa6bfb133baa6915a7ccdc5c..724165a88f399d9e02d4877f256990bd1763860b 100644 (file)
@@ -2,7 +2,7 @@
 ;;;;
 ;;;;  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)) 
@@ -22,9 +22,9 @@
   (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.
@@ -583,6 +583,17 @@ of beat groupings "
     (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.
 
@@ -592,7 +603,7 @@ of beat groupings "
                 (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)
@@ -830,7 +841,7 @@ if appropriate.
     (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)
@@ -952,3 +963,14 @@ use GrandStaff as a context. "
           (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)))
+