[tablatures] new attempt to hammer on/pull off

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


Hello tablature users,

I decided to rework the hammer on/pull off stuff almost from scratch.

After playing with some internal variables I found out how to make the stems
so short that they don't influence the slurs anymore (before making them invisible,
as it is now for tablature).

Attached is a file hp.ly which can be included in your own files for testing purposes,
and a simple, quick hptest.ly as a starting point for your tests.

@Carl: I think the slur callback has to be reworked when the slur #'details are (at least for me) not a mysterious bunch of values that I don't understand, but this depends on Patrick McCartys efforts to make these more understandable. In the meantime, a patch including the code from hp.ly into tablature.scm would improve the overall behavior of slurs (which for now are simply transparent) in tablature - when the testers do not complain about situations where hp.ly does not work :-)
What do you think? Or is my approach way too crude?

Thanks


Marc
% hp.ly

#(define-public (slur::draw-tab-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
                                                           (ly:grob-property grob 'direction)
                                                           0.35))))
                                  control-points)))
        (ly:grob-set-property! grob 'control-points new-control-points)
        (ly:slur::print grob)))


\layout {
  \context {
     \TabVoice
     \override Stem #'length = #0
     \override Stem #'no-stem-extend = ##t
     \override Stem #'flag-style = #'no-flag
     \override Stem #'details = #'((lengths 0 0 0 0 0 0)
                                   (beamed-lengths 0 0 0)
                                   (beamed-minimum-free-lengths 0 0 0)
                                   (beamed-extreme-minimum-free-lengths 0 0)
                                   (stem-shorten 0 0))
     autoBeaming = ##f
     \override NoteColumn #'ignore-collision = ##t
     \override Slur #'stencil = #slur::draw-tab-slur
   }
}
\version "2.13.4"
\include "hp.ly"

test = \relative c' {
    c8^( d e f)
    g_( a b c)
    \stemUp
    c,^( d e f)
    g_( a b c)
    \stemDown
    c,^( d e f)
    g_( a[ b] c)
}

\score {
   \new TabVoice { \test }
}


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