[tablatures] hammer on and pull off

[ Thread Index | Date Index | More lilynet.net/tablatures Archives ]


Hello all,

concerning hammer on and pull off, I have some proposals from
Federico and David. It seems that there is no need for indicating
hammer ons with an "H" (and pull off with "P, respectively).

On the other hands, the slurs don't look quite right in tablature.
So I tried to move them closer to the corresponding fret numbers.

I created a small test file; I hope it compiles without errors, but
I attach the corresponding pdf output, just in case...

Any comments/improvements/etc. are appreciated

Marc


\version "2.13.3"
\include "tablature.ly"

test = \relative c {
  << { c4 ( d\5 ) e ( f ) } \\ g,1 >>
  e''4\1 ( f\1 ) f\1 ( e\1 )
  e\2 ( f\2 ) f\2 ( e\2 )
  e\3 ( f\3 ) f\3 ( e\3 )
  e\4 ( f\4 ) f\4 ( e\4 )
  e,\5 ( f\5 ) f\5 ( e\5 )
  e\6 ( f\6 ) f\6 ( e\6 )
}

#(define-public (slur::draw-lowered-slur grob)
  (let* ((staff-symbol (ly:grob-object grob 'staff-symbol))
         (staff-space (ly:grob-property staff-symbol 'staff-space))
         (control-points (ly:grob-property grob 'control-points))
         (new-control-points (map (lambda (p)
                                          (cons (car p) (- (cdr p)
                                                        (* staff-space 0.35))))
                                  control-points)))
        (ly:grob-set-property! grob 'control-points new-control-points)
        (ly:slur::print grob)))



\score { % standard behaviour
  <<
      \new Staff { \clef "G_8" \test }
      \new TabStaff << 
         \new TabVoice = "1" { s1 }
         \new TabVoice = "2" { s1 }
         \clef "moderntab" \test
      >>
  >>
  \layout {
  \context {
    \TabVoice
    \override Slur #'direction = #UP
    \override Stem #'direction = #DOWN
    \revert Slur #'stencil
  }
  \context {
    \TabStaff
    \override NoteColumn #'ignore-collision = ##t
  }
}
}

\score { % improved(?) tablature slurs
  <<
      \new Staff { \clef "G_8" \test }
      \new TabStaff << 
         \new TabVoice = "1" { s1 }
         \new TabVoice = "2" { s1 }
         \clef "moderntab" \test
      >>
  >>
  \layout {
  \context {
    \TabVoice
    \override Slur #'direction = #UP
    \override Stem #'direction = #DOWN
    \override Slur #'stencil = #slur::draw-lowered-slur
  }
  \context {
    \TabStaff
    \override NoteColumn #'ignore-collision = ##t
  }
}
}

Attachment: hpslur.pdf
Description: Adobe PDF document



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/