]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix definitions for deadNotesOn/Off, palmMuteOn/Off
authorCarl Sorensen <c_sorensen@byu.edu>
Tue, 11 Aug 2009 14:36:54 +0000 (08:36 -0600)
committerCarl Sorensen <c_sorensen@byu.edu>
Tue, 11 Aug 2009 14:36:54 +0000 (08:36 -0600)
input/regression/dead-notes.ly
input/regression/palm-mute.ly
ly/property-init.ly

index 253fdd5bf3ab09845c031c8ceb625a45e21ef1f5..a002adf33352ec10bbd618c756c43edee1c56407 100644 (file)
@@ -4,8 +4,11 @@
                     within normal staves and tablature."
        }
 
-deadnotes = \relative c,, {
-   e8. \deadNotesOn e16 \deadNotesOff g4 a b |
+mynotes = \relative c,, {
+   \deadNotesOn
+   e8. e16
+   \deadNotesOff
+   g4 a b |
    e8. \deadNote e16 g4 a b |
    e,4. \deadNote { e8 e e } e4 |
    < e, \deadNote b' e >8 < e \deadNote b' e > < e \deadNote b' e >4 < e \deadNote b' e >4 r
@@ -13,14 +16,24 @@ deadnotes = \relative c,, {
 }
 
 \context StaffGroup <<
-  \context Staff <<
-    \clef "bass_8"
-    \deadnotes
-  >>
-  \context TabStaff <<
-    \set TabStaff.stringTunings = #bass-tuning
-    \deadnotes
-  >>
+  \context Staff {
+    \context Voice {  % Warning: explicit voice instantiation is required
+                      %   to have deadNotesOff work properly
+                      %   when deadNotesOn comes at the beginning
+                      %   of the piece
+      \clef "bass_8"
+      \mynotes
+    }
+  }
+  \context TabStaff {
+    \context TabVoice {  % Warning:  explicit voice instantiation is
+                         %   required to have deadNotesOff work properly
+                         %   when deadNotesOn comes at the beginning
+                         %   of the piece
+      \set TabStaff.stringTunings = #bass-tuning
+      \mynotes
+    }
+  }
 >>
 
 
index ac730f1fac423b7663897206149d1833f1f3b25a..12833b680529e93456b0f7dfcf78f769e424b5a3 100644 (file)
@@ -8,8 +8,10 @@ is supported by triangle-shaped note heads."
 
 palmmute = \relative c, {
     \time 4/4
+    \palmMuteOn
     e8^\markup { \musicglyph #"noteheads.u2do"  = palm mute }
-    \palmMuteOn e e \palmMuteOff  e e  \palmMute e e e |
+    e e
+    \palmMuteOff  e e  \palmMute e e e |
     e8 \palmMute { e e e } e e e e |
     \palmMuteOn < e b' e >8 e e e < e b' e >2 \palmMuteOff |
     < \palmMute e b' e >8 \palmMute { e e e } < \palmMute e b' e >2
@@ -17,10 +19,15 @@ palmmute = \relative c, {
 }
 
 \context StaffGroup <<
-  \context Staff <<
-    \clef "G_8"
-    \palmmute
-  >>
+  \context Staff {
+    \context Voice {  % Warning: explicit Voice instantiation is
+                      %    required to have palmMuteOff work properly
+                      %    when palmMuteOn comes at the beginning of
+                      %    the piece.
+      \clef "G_8"
+      \palmmute
+    }
+  }
   \context TabStaff <<
     \palmmute
   >>
index ae8d3382488df179c1295ef34ec802e9f139a960..48cf00f94cb21f673a3ab99f0e7c0ae9096313d7 100644 (file)
@@ -427,25 +427,25 @@ pointAndClickOn = #(define-music-function (parser location) ()
                       (ly:set-option 'point-and-click #t)
                       (make-music 'SequentialMusic 'void #t))
 
-palmMuteOn = {
- #(override-head-style 'NoteHead 'do)
-}
+palmMuteOn =
+#(define-music-function (parser location) ()
+   (override-head-style 'NoteHead 'do))
 
-palmMuteOff = {
- #(revert-head-style 'NoteHead)
-}
+palmMuteOff =
+#(define-music-function (parser location) ()
+   (revert-head-style 'NoteHead))
 
 palmMute =
 #(define-music-function (parser location note) (ly:music?)
     (style-note-heads 'NoteHead 'do note))
 
-deadNotesOn = {
-  #(override-head-style '(TabNoteHead NoteHead) 'cross)
-}
+deadNotesOn =
+#(define-music-function (parser location) ()
+   (override-head-style '(TabNoteHead NoteHead) 'cross))
 
-deadNotesOff = {
-  #(revert-head-style '(TabNoteHead NoteHead))
-}
+deadNotesOff =
+#(define-music-function (parser location) ()
+   (revert-head-style '(TabNoteHead NoteHead)))
 
 deadNote =
 #(define-music-function (parser location note) (ly:music?)