Re: [tablatures] hammer on and pull off

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


Federico Bruni schrieb:
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?
I changed the slur callback; please try the attached file.
For now, there is still the \slurUp workaround in it - I have to have a closer
look into the internals for \voiceOne etc.

Marc


\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
                                                           (ly:grob-property grob 'direction)
                                                           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 \stemDown \slurUp \upper }
      \context TabVoice = "lower tab" { \clef "moderntab" \voiceTwo \stemUp \slurDown \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
  }
}

}


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