From e084ca3d8b087bb3d92b10c8af6ec365e6175c32 Mon Sep 17 00:00:00 2001 From: Carl Sorensen Date: Tue, 11 Aug 2009 08:36:54 -0600 Subject: [PATCH] Fix definitions for deadNotesOn/Off, palmMuteOn/Off --- input/regression/dead-notes.ly | 33 +++++++++++++++++++++++---------- input/regression/palm-mute.ly | 17 ++++++++++++----- ly/property-init.ly | 24 ++++++++++++------------ 3 files changed, 47 insertions(+), 27 deletions(-) diff --git a/input/regression/dead-notes.ly b/input/regression/dead-notes.ly index 253fdd5bf3..a002adf333 100644 --- a/input/regression/dead-notes.ly +++ b/input/regression/dead-notes.ly @@ -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 + } + } >> diff --git a/input/regression/palm-mute.ly b/input/regression/palm-mute.ly index ac730f1fac..12833b6805 100644 --- a/input/regression/palm-mute.ly +++ b/input/regression/palm-mute.ly @@ -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 >> diff --git a/ly/property-init.ly b/ly/property-init.ly index ae8d338248..48cf00f94c 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -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?) -- 2.39.5