]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/music-functions-init.ly
Merge commit 'origin' into beamlets2
[lilypond.git] / ly / music-functions-init.ly
index 2e2a154d7d904fc73ffbdffb44a9aab155decfb7..a112b67e64a55107686bd736531034558ffa42e2 100644 (file)
@@ -1,6 +1,6 @@
 % -*-Scheme-*-
 
-\version "2.10.0"
+\version "2.12.0"
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -446,14 +446,19 @@ markups), or inside a score.")
 %% doing
 %% define-music-function in a .scm causes crash.
 
-octave =
+octaveCheck =
 #(define-music-function (parser location pitch-note) (ly:music?)
    (_i "octave check")
 
    (make-music 'RelativeOctaveCheck
               'origin location
               'pitch (pitch-of-note pitch-note) 
-              ))
+           ))
+
+ottava = #(define-music-function (parser location octave) (number?)
+  (_i "set the octavation ")
+  (make-ottava-set octave))
+
 partcombine =
 #(define-music-function (parser location part1 part2) (ly:music? ly:music?)
                 (make-part-combine-music parser
@@ -471,20 +476,24 @@ pitchedTrill =
                      (ly:music-property ev-chord 'elements))))
        (sec-note-events (get-notes secondary-note))
        (trill-events (filter (lambda (m) (music-has-type m 'trill-span-event))
-                             (ly:music-property main-note 'elements)))
-
-       (trill-pitch
-        (if (pair? sec-note-events)
-            (ly:music-property (car sec-note-events) 'pitch)
-            )))
-     
-     (if (ly:pitch? trill-pitch)
-        (for-each (lambda (m) (ly:music-set-property! m 'pitch trill-pitch))
-                  trill-events)
-        (begin
-          (ly:warning (_ "Second argument of \\pitchedTrill should be single note: "))
-          (display sec-note-events)))
+                             (ly:music-property main-note 'elements))))
 
+     (if (pair? sec-note-events)
+        (begin
+          (let*
+              ((trill-pitch (ly:music-property (car sec-note-events) 'pitch))
+               (forced (ly:music-property (car sec-note-events ) 'force-accidental)))
+            
+            (if (ly:pitch? trill-pitch)
+                (for-each (lambda (m) (ly:music-set-property! m 'pitch trill-pitch))
+                          trill-events)
+                (begin
+                  (ly:warning (_ "Second argument of \\pitchedTrill should be single note: "))
+                  (display sec-note-events)))
+
+            (if (eq? forced #t)
+                (for-each (lambda (m) (ly:music-set-property! m 'force-accidental forced))
+                          trill-events)))))
      main-note))