1\version "2.19.21"
2
3#(define (glissando::calc-extra-dy grob)
4   (let* ((original (ly:grob-original grob))
5          (left-bound (ly:spanner-bound original LEFT))
6          (right-bound (ly:spanner-bound original RIGHT))
7          (left-pitch (ly:event-property (event-cause left-bound) 'pitch))
8          (right-pitch (ly:event-property (event-cause right-bound) 'pitch)))
9
10     (if (and (= (ly:pitch-octave left-pitch) (ly:pitch-octave right-pitch))
11              (= (ly:pitch-notename left-pitch) (ly:pitch-notename right-pitch)))
12         (- (ly:pitch-alteration right-pitch) (ly:pitch-alteration left-pitch))
13         0 )))
14
15upper= \relative c' {
16  \time 4/4
17  \key e \major
18  \set Staff.midiInstrument = "acoustic guitar (steel)"
19  \set fingeringOrientations = #'(left)
20
21  \partial 4. \acciaccatura c16 \glissando cis8 e4
22  < cis-1 g'-3 >2 s8 \grace a16 ( \glissando < b-2 >8\3 ) < d-1 > ( b )
23  < e-3 >\2 ( <d-1> b ) \grace < ais-2 >16 ( \glissando a8 g ) s4.
24  s4. < d'\3 g\2 >8 < gis,\4  d'\3 fis\2 >2\arpeggio ~
25  < gis\4 d'\3 fis\2 >2 < b'\2\harmonic e\harmonic >2\fermata
26}
27
28lower= \relative {
29  \set fingeringOrientations = #'(left)
30
31  \partial 4. s4.
32  s4 e,4 s2
33  s2 s8 < e'-3 >4. ~
34  e4 \hideNotes \grace { b8 \glissando s4 } \unHideNotes < e-2 >4\5 e,2 ~
35  2 < e'\6\harmonic >
36}
37
38\score {
39  \new StaffGroup \with {instrumentName = "Guitar" } <<
40    \new Staff = "guitar" <<
41      \context Voice = "upper guitar" {
42        \clef "G_8" \voiceOne
43        \override Glissando.gap = #0.5
44        \override Glissando.extra-offset = #'(-0.5 . 0)
45        \override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
46        \override Glissando.minimum-length = #4
47        \override Glissando.extra-dy = #glissando::calc-extra-dy
48        \upper
49      }
50      \context Voice = "lower guitar" {
51        \clef "G_8" \voiceTwo
52        \override Glissando.bound-details.right.padding = #1
53        \override Glissando.bound-details.left.padding = #0.2
54        \lower
55      }
56    >>
57    \new TabStaff = "tab" <<
58      \context TabVoice = "upper tab" { \clef "moderntab" \voiceOne \upper }
59      \context TabVoice = "lower tab" { \clef "moderntab" \voiceTwo \lower }
60    >>
61  >>
62
63  \layout {
64    \context {
65      \Staff
66      \hide StringNumber
67    }
68    \context {
69      \TabStaff
70      \revert Arpeggio.stencil
71    }
72  }
73}
74