]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/music-functions-init.ly
Add docstrings to ly/music-functions-init.ly; contributed by Frederic
[lilypond.git] / ly / music-functions-init.ly
index 2e2a154d7d904fc73ffbdffb44a9aab155decfb7..2c6236a1e1044a2b5d3587901a852b2f12f4c84f 100644 (file)
@@ -1,6 +1,6 @@
 % -*-Scheme-*-
 
-\version "2.10.0"
+\version "2.12.0"
 
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -126,6 +126,7 @@ bar =
 
 barNumberCheck =
 #(define-music-function (parser location n) (integer?)
+  (_i "Print a warning if the current bar number is not @var{n}.")
    (make-music 'ApplyContext 
               'origin location
               'procedure 
@@ -139,30 +140,30 @@ barNumberCheck =
 
 bendAfter =
 #(define-music-function (parser location delta) (real?)
-             
+  (_i "Create a fall or doit of pitch interval @var{delta}.")
   (make-music 'BendAfterEvent
    'delta-step delta))
 
 %% why a function?
 breathe =
 #(define-music-function (parser location) ()
+  (_i "Insert a breath mark.")
             (make-music 'EventChord 
               'origin location
               'elements (list (make-music 'BreathingEvent))))
 
 
 clef =
-#(define-music-function (parser location type)
-   (string?)
-   (_i "Set the current clef.")
-
+#(define-music-function (parser location type) (string?)
+  (_i "Set the current clef to @var{type}.")
    (make-clef-set type))
 
 
 cueDuring = 
 #(define-music-function
-  (parser location what dir main-music)
-  (string? ly:dir? ly:music?)
+  (parser location what dir main-music) (string? ly:dir? ly:music?)
+  (_i "Insert contents of quote @var{what} corresponding to @var{main-music},
+in a CueVoice oriented by @var{dir}.")
   (make-music 'QuoteMusic
              'element main-music 
              'quoted-context-type 'Voice
@@ -173,12 +174,14 @@ cueDuring =
 
 displayLilyMusic =
 #(define-music-function (parser location music) (ly:music?)
+  (_i "Display  @var{music} to the console in LilyPond input notation.")
    (newline)
    (display-lily-music music parser)
    music)
 
 displayMusic =
 #(define-music-function (parser location music) (ly:music?)
+  (_i "Display the internal representation of @var{music} to the console.")
    (newline)
    (display-scheme-music music)
    music)
@@ -186,6 +189,7 @@ displayMusic =
 
 endSpanners =
 #(define-music-function (parser location music) (ly:music?)
+  (_i "Terminate the next spanner prematurely after exactly one note without the need of a specific end spanner.")
    (if (eq? (ly:music-property music 'name) 'EventChord)
        (let*
           ((elts (ly:music-property music 'elements))
@@ -446,14 +450,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 +480,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))