[tablatures] hp.ly and slurs on Staff |
[ Thread Index |
Date Index
| More lilynet.net/tablatures Archives
]
I have a question about the behaviour of hp.ly
I'm very satisfied with the way slurs are drawn in TabStaff. In fact,
as far as I can see, hammeron/pulloff in VoiceOne have the slur over
the numbers while in VoiceTwo are under. And that's exactly what I want.
But the slurs in Staff don't look nice, in particular VoiceOne.
Slurs connect stems instead of heads, so they don't look good (see
attached file).
In all the manuals I've checked slurs connect always note heads (not
stems).
There's a way to fix it?
Cheers,
Federico
--
Federico Bruni | http://www.gnurag.net/blog/
LibrePlanet Italia
http://groups.fsf.org/wiki/LibrePlanetItalia
\version "2.13.5"
#(set-global-staff-size 22.45)
% 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)))
\paper {
indent= #0
line-width= #180
}
upper= \relative c' {
\time 4/4
\key e \major
\set Staff.midiInstrument = #"acoustic guitar (steel)"
\set fingeringOrientations = #'(left)
\partial 4. <cis-1>8 e4
< cis-1 g'-3 >2 s8 \grace a16 ( \glissando b8\3 ) d ( b ) |
e\2 ( d b ) \grace ais16 ( \glissando a8 g ) s4. |
s4. < d'\3 g\2 >8 < gis,\4 d'\3 fis\2 >2\arpeggio |
}
lower= \relative c {
\set fingeringOrientations = #'(left)
\partial 4. s4. |
s4 e,4 s2 |
s2 s8 e'4. ~ |
e8 b8 ( \glissando e4\5 ) e,2 |
}
\score {
\new StaffGroup <<
\new Staff = "guitar" <<
\context Voice = "upper guitar" { \clef "G_8" \voiceOne \upper }
\context Voice = "lower guitar" { \clef "G_8" \voiceTwo \lower }
>>
\new TabStaff = "tab" <<
\context TabVoice = "upper tab" { \clef "moderntab" \voiceOne \upper }
\context TabVoice = "lower tab" { \clef "moderntab" \voiceTwo \lower }
>>
>>
\midi {
\context {
\Score tempoWholesPerMinute = #(ly:make-moment 120 4)
}
}
\layout {
\context {
\Staff
\override StringNumber #'transparent = ##t
}
\context {
\TabStaff
\revert Arpeggio #'stencil
}
\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
}
}
}