]> git.donarmstrong.com Git - lilypond.git/commitdiff
Doc: add doc-strings to music-functions
authorValentin Villenave <valentin@villenave.net>
Fri, 5 Mar 2010 13:17:06 +0000 (14:17 +0100)
committerValentin Villenave <valentin@villenave.net>
Sat, 6 Mar 2010 09:42:16 +0000 (10:42 +0100)
The \harmonicsO[n|ff] commands have been
rewritten as music-functions, to be more
like other definitions such as \palmMute.

This commit also adds a \harmonicNote command,
for consistency's sake with \deadNote etc.,
and a \defaultNoteHeads that acts as a common
definition for all note head styles reverting
(i.e. \deadNoteOff, \harmonicsOff etc.).

ly/music-functions-init.ly
ly/property-init.ly

index d3d14e7f379b379b93e3bc5b0d26b21d656ccd85..f49797ec81871c7cf777e5d0352dcae837d7cf21 100644 (file)
@@ -379,7 +379,8 @@ makeClusters =
 
 musicMap =
 #(define-music-function (parser location proc mus) (procedure? ly:music?)
-            (music-map proc mus))
+    (_i "Apply @var{proc} to @var{mus} and all of the music it contains.")
+    (music-map proc mus))
 
 
 
index 954dae2b5fc85b3e8a0acee7cc0656c922d1ece6..21644f2d71582dd8c808ea215715002ee1f1b636 100644 (file)
@@ -6,6 +6,14 @@
 #(define (make-simple-dash-definition dash-fraction dash-period)
     (list (list 0 1 dash-fraction dash-period)))
 
+%% common definition for all note head styles reverting
+%% (palm mute, harmonics, dead notes, ...)
+defaultNoteHeads=
+#(define-music-function (parser location) ()
+   (_i "Revert to the default note head style.")
+   (revert-head-style 'NoteHead))
+
+
 
 %% arpeggios
 
@@ -198,8 +206,15 @@ glissando = #(make-music 'GlissandoEvent)
 
 %% harmonics
 
-harmonicsOn  = \override NoteHead #'style = #'harmonic
-harmonicsOff = \revert NoteHead #'style
+harmonicsOn =
+#(define-music-function (parser location) ()
+   (_i "Set the default note head style to a diamond-shaped style.")
+   (override-head-style 'NoteHead 'harmonic))
+harmonicsOff = \defaultNoteHeads
+harmonicNote =
+#(define-music-function (parser location note) (ly:music?)
+   (_i "Print @var{note} with a diamond-shaped note head.")
+   (style-note-heads 'NoteHead 'harmonic note))
 
 
 %% hideNotes
@@ -259,12 +274,12 @@ defaultTimeSignature = \revert Staff.TimeSignature #'style
 
 palmMuteOn =
 #(define-music-function (parser location) ()
+   (_i "Set the default note head style to a triangle-shaped style.")
    (override-head-style 'NoteHead 'do))
-palmMuteOff =
-#(define-music-function (parser location) ()
-   (revert-head-style 'NoteHead))
+palmMuteOff = \defaultNoteHeads
 palmMute =
 #(define-music-function (parser location note) (ly:music?)
+   (_i "Print @var{note} with a triangle-shaped note head.")
    (style-note-heads 'NoteHead 'do note))
 
 
@@ -533,12 +548,12 @@ voiceNeutralStyle = {
 
 xNotesOn =
 #(define-music-function (parser location) ()
+   (_i "Set the default note head style to a cross-shaped style.")
    (override-head-style '(TabNoteHead NoteHead) 'cross))
-xNotesOff =
-#(define-music-function (parser location) ()
-   (revert-head-style '(TabNoteHead NoteHead)))
+xNotesOff = \defaultNoteHeads
 xNote =
 #(define-music-function (parser location note) (ly:music?)
+   (_i "Print @var{note} with a cross-shaped note head.")
    (style-note-heads '(TabNoteHead NoteHead) 'cross note))