Re: [tablatures] hammer on and pull off

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


Marc Hohl wrote:
Federico Bruni schrieb:
[...]

I suggest you to add in the example two hammeron/pulloff happening at the same time in two different voices. In this case, I think slurs in the upper voice should point up (i.e. over the numbers) and slurs in lower voice point down (under the numbers). I don't know if LilyPond is able to adjust this automatically or if you have to add some code to fix this behaviour..
Have you some examples where this would be needed? It is easier for me to adapt real-life situations
than to think of all possible situations that may come across...


You find attached an example file.

I've done something wrong because even in the first bar - where the music is monophonic - slurs are far from the numbers.

How can I fix that?

Thanks in advance
\version "2.13.3"
%% \include "english.ly"
\include "tablature.ly"


upper=  \relative c' {
  \time 4/4 
  \key g \major
  g'8 ( a ) d, ( e\2 )  d ( b ) c ( d ) | 
  b4 (  c  b2 )
  b4 (  c  b2 )
  b4 (  c  b2 )
  b4 (  c  b2 )
}

lower=  \relative c {
  s1
  g'4 ( a  g2 )
  d4 ( e  d2 )
  a4 ( c  a2 )
  e4 ( f  e2 )
}

#(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 {
  \new StaffGroup <<
    \new Staff = "guitar" <<
      \context Voice = "upper guitar" { \clef "G_8" \voiceOne  \override Voice.StringNumber #'transparent = ##t  \upper }
      \context Voice = "lower guitar" { \clef "G_8" \voiceTwo  \override Voice.StringNumber #'transparent = ##t  \lower }
    >>
    \new TabStaff = "tab" <<
      \context TabVoice = "upper tab" { \clef "moderntab" \voiceOne \upper }
      \context TabVoice = "lower tab" { \clef "moderntab" \voiceTwo \lower }
    >>
  >>
  
  \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
  }
}

}

PNG image



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