]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/music-functions-init.ly
Merge branch 'master' into dev/texi2html
[lilypond.git] / ly / music-functions-init.ly
index 2e2a154d7d904fc73ffbdffb44a9aab155decfb7..a9d38dbad13b9508f3bbf44370c4a5b104e7181f 100644 (file)
@@ -446,7 +446,7 @@ 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")
 
@@ -471,20 +471,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))