From: David Kastrup Date: Wed, 20 May 2015 15:31:32 +0000 (+0200) Subject: Issue 3057: misbehavior of \deadNotesOn et al at start of music X-Git-Tag: release/2.19.22-1~68^2~34 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=dda2d06bc6aba17049c16c3c814d43d097b48f67;p=lilypond.git Issue 3057: misbehavior of \deadNotesOn et al at start of music 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. --- diff --git a/ly/property-init.ly b/ly/property-init.ly index a50cf82635..fd41de8bef 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -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?)