]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/tablature.scm
tablature enhancement: hammer on/pull off
[lilypond.git] / scm / tablature.scm
index 883b09ae1c1a8f19e84286aef09ad942e0327ab1..054f3416d13c0c1da1ab6573f83b9c37461f514b 100644 (file)
                                         (lambda (grob)
                                                 (parenthesize-tab-note-head grob))))
             ;; tab note head is invisible
-            (ly:grob-set-property! tied-tab-note-head 'transparent #t))))
\ No newline at end of file
+            (ly:grob-set-property! tied-tab-note-head 'transparent #t))))
+
+;; the slurs should not be too far apart from the corresponding fret number, so
+;; we move the slur towards the TabNoteHeads:
+#(define-public (slur::draw-tab-slur grob)
+  ;; TODO: use a less "brute-force" method to decrease
+  ;; the distance between the slur ends and the fret numbers
+  (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)))
\ No newline at end of file