]> git.donarmstrong.com Git - lilypond.git/commitdiff
Issue 3057: misbehavior of \deadNotesOn et al at start of music
authorDavid Kastrup <dak@gnu.org>
Wed, 20 May 2015 15:31:32 +0000 (17:31 +0200)
committerDavid Kastrup <dak@gnu.org>
Mon, 25 May 2015 13:14:00 +0000 (15:14 +0200)
User-level commands that do not move to a particular context will tend
to be applied at Bottom context when following any notes or similar
events, but at arbitrary level when being at the start of music.  That's
a bad idea.  This patch moves the head styling overrides to Bottom
level.  While this means that

    \new Staff { \deadNotesOn ...

will only affect the default Voice instead of the whole Staff, one can
still get per-Staff behavior with

    \new Staff \with { \deadNotesOn } { ...

so no functionality is really lost here.

ly/property-init.ly

index a50cf82635b857aad7f4327fc65fb5b7516c583c..fd41de8befb5d7a10cf73988d8fd4ef282486f87 100644 (file)
@@ -10,8 +10,9 @@
 %% (palm mute, harmonics, dead notes, ...)
 defaultNoteHeads =
 #(define-music-function (parser location) ()
-   (_i "Revert to the default note head style.")
-   (revert-head-style '(NoteHead TabNoteHead)))
+  (_i "Revert to the default note head style.")
+  (context-spec-music
+   (revert-head-style '(NoteHead TabNoteHead)) 'Bottom))
 
 accidentalStyle =
 #(define-music-function
@@ -224,8 +225,9 @@ glissando = #(make-music 'GlissandoEvent)
 
 harmonicsOn =
 #(define-music-function (parser location) ()
-   (_i "Set the default note head style to a diamond-shaped style.")
-   (override-head-style '(NoteHead TabNoteHead) 'harmonic))
+  (_i "Set the default note head style to a diamond-shaped style.")
+  (context-spec-music
+   (override-head-style '(NoteHead TabNoteHead) 'harmonic) 'Bottom))
 harmonicsOff = \defaultNoteHeads
 harmonicNote =
 #(define-music-function (parser location note) (ly:music?)
@@ -394,8 +396,9 @@ 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))
+  (_i "Set the default note head style to a triangle-shaped style.")
+  (context-spec-music
+   (override-head-style 'NoteHead 'do) 'Bottom))
 palmMuteOff = \defaultNoteHeads
 palmMute =
 #(define-music-function (parser location note) (ly:music?)
@@ -732,8 +735,9 @@ allowVoltaHook =
 
 xNotesOn =
 #(define-music-function (parser location) ()
-   (_i "Set the default note head style to a cross-shaped style.")
-   (override-head-style '(TabNoteHead NoteHead) 'cross))
+  (_i "Set the default note head style to a cross-shaped style.")
+  (context-spec-music
+   (override-head-style '(TabNoteHead NoteHead) 'cross) 'Bottom))
 xNotesOff = \defaultNoteHeads
 xNote =
 #(define-music-function (parser location note) (ly:music?)