(ly:music?)
(_i "Make @var{music} absolute. This does not actually change the
music itself but rather hides it from surrounding @code{\\relative}
-commands.")
+and @code{\\fixed} commands.")
(make-music 'RelativeOctaveMusic 'element music))
acciaccatura =
\set Timing.measureLength = #mlen
#} ))
+compressMMRests =
+#(define-music-function (parser location music) (ly:music?)
+ (_i "Remove the empty bars created by multi-measure rests,
+leaving just the first bar containing the MM rest itself.")
+ (music-map
+ (lambda (m)
+ (if (eq? 'MultiMeasureRestMusic (ly:music-property m 'name))
+ #{ \once \set Score.skipBars = ##t #m #}
+ #{ #m #} ))
+ music))
+
crossStaff =
#(define-music-function (parser location notes) (ly:music?)
(_i "Create cross-staff stems")
(if (number? finger) 'digit 'text)
finger))
+fixed =
+#(define-music-function (parser location pitch music)
+ (ly:pitch? ly:music?)
+ (_i "Use the octave of @var{pitch} as the default octave for @var{music}.")
+ (let ((octave-marks (1+ (ly:pitch-octave pitch))))
+ (cond ((not (= 0 octave-marks))
+ (ly:music-transpose music (ly:make-pitch octave-marks 0 0))
+ ;;In order to leave unchanged the notes in any enclosed
+ ;; \absolute or \fixed or \relative, make a cancelling shift
+ (map (lambda (m)
+ (ly:music-transpose m (ly:make-pitch (- octave-marks) 0 0)))
+ (extract-named-music music 'RelativeOctaveMusic)))))
+ (make-music 'RelativeOctaveMusic 'element music))
+
footnote =
#(define-music-function (parser location mark offset footnote item)
((markup?) number-pair? markup? symbol-list-or-music?)
#{
\set harmonicDots = ##t
\temporary \override TabNoteHead.stencil = #(tab-note-head::print-custom-fret-label (ratio->fret ratio))
- \temporary \override NoteHead.Y-extent = #(ly:make-unpure-pure-container ly:grob::stencil-height
- (lambda (grob start end)
- (ly:grob::stencil-height grob)))
+ \temporary \override NoteHead.Y-extent = #(ly:make-unpure-pure-container ly:grob::stencil-height)
\temporary \override NoteHead.stencil = #(lambda (grob) (ly:grob-set-property! grob 'style 'harmonic-mixed)
(ly:note-head::print grob))
#(make-harmonic
(set! (ly:music-property arg 'parenthesize) #t))
arg)
+#(define (make-directed-part-combine-music
+ parser direction chord-range part1 part2
+ one-context-settings
+ two-context-settings
+ shared-context-settings)
+
+ (let ((pc-music (make-part-combine-music
+ parser (list part1 part2) direction chord-range)))
+ #{ \context Staff <<
+ \context Voice = "one" \with #one-context-settings {}
+ \context Voice = "two" \with #two-context-settings {}
+ \context Voice = "shared" \with #shared-context-settings {}
+ #pc-music
+ #(make-part-combine-marks
+ default-part-combine-mark-state-machine
+ (ly:music-property pc-music 'split-list))
+ >> #} ))
+
partcombine =
#(define-music-function (parser location chord-range part1 part2)
((number-pair? '(0 . 8)) ly:music? ly:music?)
and @var{part2} are combined into one voice where appropriate.
Optional @var{chord-range} sets the distance in steps between notes
that may be combined into a chord or unison.")
- (make-part-combine-music parser
- (list part1 part2) #f chord-range))
+ (make-directed-part-combine-music parser #f chord-range part1 part2
+ #{ \with { \voiceOne \override DynamicLineSpanner.direction = #UP } #}
+ #{ \with { \voiceTwo \override DynamicLineSpanner.direction = #DOWN } #}
+ #{ #} ))
partcombineUp =
#(define-music-function (parser location chord-range part1 part2)
((number-pair? '(0 . 8)) ly:music? ly:music?)
(_i "Take the music in @var{part1} and @var{part2} and typeset so
that they share a staff with stems directed upward.")
- (make-part-combine-music parser
- (list part1 part2) UP chord-range))
+ (make-directed-part-combine-music parser UP chord-range part1 part2
+ #{ \with { \voiceOne \override DynamicLineSpanner.direction = #UP } #}
+ #{ \with { \voiceThree \override DynamicLineSpanner.direction = #UP } #}
+ #{ \with { \voiceOne \override DynamicLineSpanner.direction = #UP } #} ))
partcombineDown =
#(define-music-function (parser location chord-range part1 part2)
((number-pair? '(0 . 8)) ly:music? ly:music?)
(_i "Take the music in @var{part1} and @var{part2} and typeset so
that they share a staff with stems directed downward.")
- (make-part-combine-music parser
- (list part1 part2) DOWN chord-range))
+ (make-directed-part-combine-music parser DOWN chord-range part1 part2
+ #{ \with { \voiceFour \override DynamicLineSpanner.direction = #DOWN } #}
+ #{ \with { \voiceTwo \override DynamicLineSpanner.direction = #DOWN } #}
+ #{ \with { \voiceTwo \override DynamicLineSpanner.direction = #DOWN } #} ))
partcombineForce =
#(define-music-function (location parser type once) (boolean-or-symbol? boolean?)