\version "2.12.0"
stemUp = \override Stem #'direction = #UP
-stemDown = \override Stem #'direction = #DOWN
+stemDown = \override Stem #'direction = #DOWN
stemNeutral = \revert Stem #'direction
slurUp = \override Slur #'direction = #UP
slurDashed = {
\override Slur #'dash-definition = #'((0 1 0.4 0.75))
}
-slurDashPattern =
+slurDashPattern =
#(define-music-function (parser location dash-fraction dash-period)
(number? number?)
#{
phrasingSlurDashed = {
\override PhrasingSlur #'dash-definition = #'((0 1 0.4 0.75))
}
-phrasingSlurDashPattern =
+phrasingSlurDashPattern =
#(define-music-function (parser location dash-fraction dash-period)
(number? number?)
#{
tieDashed = {
\override Tie #'dash-definition = #'((0 1 0.4 0.75))
}
-tieDashPattern =
+tieDashPattern =
#(define-music-function (parser location dash-fraction dash-period)
(number? number?)
#{
\set Timing.measurePosition = #ZERO-MOMENT
}
-% dynamic ly:dir? text script, articulation script ly:dir?
+% dynamic ly:dir? text script, articulation script ly:dir?
oneVoice = #(context-spec-music (make-voice-props-revert) 'Voice)
voiceOne = #(context-spec-music (make-voice-props-set 0) 'Voice)
voiceTwo = #(context-spec-music (make-voice-props-set 1) 'Voice)
% For drawing vertical chord brackets with \arpeggio
-% This is a shorthand for the value of the print-function property
-% of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether
-% cross-staff brackets are desired.
+% This is a shorthand for the value of the print-function property
+% of either Staff.Arpeggio or PianoStaff.Arpeggio, depending whether
+% cross-staff brackets are desired.
arpeggio = #(make-music 'ArpeggioEvent)
glissando = #(make-music 'GlissandoEvent)
-fermataMarkup = \markup { \musicglyph #"scripts.ufermata" }
+fermataMarkup = \markup { \musicglyph #"scripts.ufermata" }
hideNotes = {
% hide notes, accidentals, etc.
\revert Staff.BassFigureAlignmentPositioning #'direction
}
-predefinedFretboardsOff = {
+predefinedFretboardsOff = {
\set FretBoards.predefinedDiagramTable = ##f
}
(make-music 'SequentialMusic 'void #t))
palmMuteOn = {
- \override NoteHead #'style = #'do
+ #(override-head-style 'NoteHead 'do)
}
palmMuteOff = {
- \revert NoteHead #'style
+ #(revert-head-style 'NoteHead)
}
palmMute =
#(define-music-function (parser location note) (ly:music?)
- ;; are we inside a <...>?
- (if (eq? (ly:music-property note 'name) 'NoteEvent)
- ;; yes -> add a tweak
- (begin (set! (ly:music-property note 'tweaks)
- (acons 'style 'do (ly:music-property note 'tweaks)))
- note)
- ;; no -> use predefined commands to switch to triangle-shaped note heads
- #{
- \palmMuteOn
- $note
- \palmMuteOff
- #}))
+ (style-note-heads 'NoteHead 'do note))
deadNotesOn = {
- \override TabNoteHead #'style = #'cross
- \override NoteHead #'style = #'cross
+ #(override-head-style '(TabNoteHead NoteHead) 'cross)
}
deadNotesOff = {
- \revert TabNoteHead #'style
- \revert NoteHead #'style
+ #(revert-head-style '(TabNoteHead NoteHead))
}
deadNote =
#(define-music-function (parser location note) (ly:music?)
- ;; are we inside a <...>?
- (if (eq? (ly:music-property note 'name) 'NoteEvent)
- ;; yes -> add a tweak
- (begin (set! (ly:music-property note 'tweaks)
- (acons 'style 'cross (ly:music-property note 'tweaks)))
- note)
- ;; no -> use predefined commmands for changing
- ;; note head and tablature fret signs
- #{
- \deadNotesOn
- $note
- \deadNotesOff
- #}))
+ (style-note-heads '(TabNoteHead NoteHead) 'cross note))
tabFullNotation = {
% time signature
\revert TabVoice.Tie #'stencil
\revert TabVoice.Tie #'after-line-breaking
\revert TabVoice.RepeatTie #'stencil
- \revert TabVoice.RepeatTie #'after-line-braking
+ \revert TabVoice.RepeatTie #'after-line-breaking
\revert TabVoice.LaissezVibrerTie #'stencil
\revert TabVoice.Slur #'stencil
\revert PhrasingSlur #'stencil
(make-music type
'span-direction span-dir))
-(define-public (set-mus-properties! m alist)
+(define-public (override-head-style heads style)
+ "Override style for @var{heads} to @var{style}."
+ (make-sequential-music
+ (if (pair? heads)
+ (map (lambda (h)
+ (make-grob-property-override h 'style style))
+ heads)
+ (list (make-grob-property-override heads 'style style)))))
+
+(define-public (revert-head-style heads)
+ "Revert style for @var{heads}."
+ (make-sequential-music
+ (if (pair? heads)
+ (map (lambda (h)
+ (make-grob-property-revert h 'style))
+ heads)
+ (list (make-grob-property-revert heads 'style)))))
+
+(define-public (style-note-heads heads style music)
+ "Set @var{style} for all @var{heads} in @var{music}. Works both
+inside of and outside of chord construct."
+ ;; are we inside a <...>?
+ (if (eq? (ly:music-property music 'name) 'NoteEvent)
+ ;; yes -> use a tweak
+ (begin
+ (set! (ly:music-property music 'tweaks)
+ (acons 'style style (ly:music-property music 'tweaks)))
+ music)
+ ;; not in <...>, so use overrides
+ (make-sequential-music
+ (list
+ (override-head-style heads style)
+ music
+ (revert-head-style heads)))))
+
+ (define-public (set-mus-properties! m alist)
"Set all of ALIST as properties of M."
(if (pair? alist)
(begin