This code works as expected generating two anacrusis measures c4 | 42 (see
attached image).

\version "2.19.65"
\fixed c'' {
  \partial 4 c4
  \partial 2. c2.
}


Now I would like to make the same but with second measure grey. I use \ed
function at

http://lsr.di.unimi.it/LSR/Item?id=985


and here it is the new code (at the end of this message I included the
complete code):

\version "2.19.65"
\fixed c'' {
  \partial 4 c4
  \partial 2. \ed Note {c2. }
}


This code unfortunately does not work as expected (expected to me :))
because the separator bar between c4 and c2 now has disappeared. How can I
fix it?

* * *
\version "2.19.65"

editorsColor = #grey
ed =
#(define-music-function (parser location grob col mus)
   (symbol-list-or-symbol? (color? editorsColor) ly:music?)
   ;; for abbreviations, we need a symbol instead of a one-element list
   (let ((grob (if (= 1 (length grob)) (car grob) grob)))
     (case
      grob
      ;; define abbreviations
      ;; which call the function recursively with a value
      ;; leading into the (else) clause
      ;; (or to _another_ abbreviation)
      ;; be careful to avoid infinite recursion :-)
      ;; – abbreviation names must not be actual grob names
      ;; (at least if they’re used in the corresponding
      ;; clause) or recursion will be infinite also
      ;; It is recommended to use singular forms only
      ;; for abbreviations.
      ((Caut) #{ \ed Staff.AccidentalCautionary #})
      ((LedgerLine) #{ % barline is workaround to issue 3949
        \once\hide Staff.BarLine \bar "|"
        \stopStaff
        \ed Staff.LedgerLineSpanner {
          \startStaff
          $mus
          \stopStaff
        }
        \once\hide Staff.BarLine \bar "|"
        \startStaff #})
      ((Mmr) #{ \ed MultiMeasureRest $mus #})
      ((Note) #{ \ed Staff.Accidental
                 \ed Beam
                 \ed Dots
                 \ed Flag
                 \ed LedgerLine
                 \ed NoteHead
                 \ed Rest
                 \ed Stem $mus #})
      ((Pitch) #{ \ed NoteHead $mus #})
      ((Suggest) #{ \ed Staff.AccidentalSuggestion #})
      ((StemWithFlag) #{ \ed Stem \ed Flag $mus #})
      ((Tuplet) #{ \ed TupletNumber \ed TupletBracket $mus #})
      ;; ‘normal’ case
      (else
       #{
         \override $grob . color = #col
         $mus
         \revert $grob . color
       #}))))

\fixed c'' {
  \partial 4 c4
  \partial 2. \ed Note {c2. }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to