Greetings,

I have added a few docstrings (patch attached). However I'm looking at
NR Appendix 1.15 (Available music functions), and wondering if we
couldn't do something much better with it, like Nicolas did with the
"overview of markup commands" appendix.

Currently you have, in bulk, user-oriented functions like \breathe,
and more developer-oriented functions like \assertBeamQuant. By
categorizing these functions we could subdivide this appendix and make
it a lot more usable, even add @cindex and @lilypond examples in the
doc-strings, etc.

Which brings me to another question: some predefined overrides like
\harmonicsOn are defined in a pure-LilyPond way, while others are
defined as music-functions (the attached patch aims to bring more
consistency in this regard). Do we want to keep it that way? Rewriting
the entire property-init.ly in Scheme may not be very useful. But I'm
not completely comfortable with the current situation either.

Cheers,
Valentin
From 8c07277e11c6647b371ec972abaa01a64ab8c58d Mon Sep 17 00:00:00 2001
From: Valentin Villenave <[email protected]>
Date: Fri, 5 Mar 2010 14:17:06 +0100
Subject: [PATCH] Doc: add doc-strings to music-functions

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 |    3 ++-
 ly/property-init.ly        |   31 +++++++++++++++++++++++--------
 2 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/ly/music-functions-init.ly b/ly/music-functions-init.ly
index d3d14e7..f49797e 100644
--- a/ly/music-functions-init.ly
+++ b/ly/music-functions-init.ly
@@ -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))
 
 
 
diff --git a/ly/property-init.ly b/ly/property-init.ly
index 954dae2..21644f2 100644
--- a/ly/property-init.ly
+++ b/ly/property-init.ly
@@ -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))
 
 
-- 
1.7.0.1

_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to