Hello all,

based on Paul Morris’ restShifter (
https://lists.gnu.org/archive/html/lilypond-user/2013-06/msg00088.html), I
wrote a function beautifying the vertical placement of rests in a TabStaff.
Unfortunately, this does seem to break rests under beams – or rather the
beams themselves, they now sort of appear in front of the stave.
This has to do with the use of Rest.before-line-breaking – if I
use Rest.after-line-breaking it seems to work, but I don’t really
understand what either of them do, and I don’t know if this could break
something else. Is using Rest.after-line-breaking the correct way to do
this?


\version "2.19.47"

tabRestFix =
#(lambda (grob)
   (let* (
           (dur-log (ly:grob-property grob 'duration-log))
           (dot (ly:grob-object grob 'dot))
           (y-off (ly:grob-property grob 'Y-offset))
           )

     (cond
      ((= dur-log 2)
       (ly:grob-set-property! grob 'Y-offset
         (+ y-off 0.1))
       ))

     (cond
      ((> dur-log 2)
       (ly:grob-set-property! grob 'Y-offset
         (+ y-off -0.25))
       ))

     (cond
      ((= dur-log 4)
       (ly:grob-set-property! grob 'Y-offset
         (+ y-off 0.75))
       ))

     (cond
      ((and (ly:grob? dot)
            (> dur-log 4))
       (ly:grob-set-property! dot 'extra-offset '(0 . -1))
       ))
     ))

\new TabStaff \with {
  \override Rest.before-line-breaking = \tabRestFix
  %\override Rest.after-line-breaking = \tabRestFix
} <<
  \tabFullNotation
  \relative c' {
    c8[ r16 c]
  }
>>


Cheers,
Peter

--
Peter Crighton | Musician & Music Engraver based in Mainz, Germany
http://www.petercrighton.de
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to