]> git.donarmstrong.com Git - lilypond.git/commitdiff
Tablature: support StemTremolo correctly
authorMarc Hohl <marc@hohlart.de>
Tue, 24 Aug 2010 12:46:45 +0000 (14:46 +0200)
committerNeil Puttock <n.puttock@gmail.com>
Wed, 1 Sep 2010 23:45:14 +0000 (00:45 +0100)
ly/engraver-init.ly
ly/property-init.ly
scm/tablature.scm

index 6ecba2ddf4d372cd8ce1663e3b474ea0215c2cd7..22e588c7428fb485db3b90a9a607bff614b4f832 100644 (file)
@@ -725,6 +725,14 @@ context."
   %% too big. We have to adjust the beam settings:
   \override Beam #'beam-thickness = #0.32
   \override Beam #'length-fraction = #0.62
+  %% the same goes for tremolo beams
+  \override StemTremolo #'beam-thickness = #0.32
+  %% NOTE: in lily/stem-tremolo.cc, we have length-fraction = 1,
+  %% and the tablature staff space is scaled (1.5 by default),
+  %% so we use the inversion of the scale factor:
+  \override StemTremolo #'length-fraction = #(lambda (grob)
+                                               (/ 1 (ly:staff-symbol-staff-space grob)))
+  \override StemTremolo #'beam-width = #stem-tremolo::calc-tab-width
 
   %% No accidental in tablature !
   \remove "Accidental_engraver"
@@ -744,6 +752,7 @@ context."
   autoBeaming = ##f
   %% remove beams, dots and rests ...
   \override Beam #'stencil = ##f
+  \override StemTremolo #'stencil = ##f
   \override Dots #'stencil = ##f
   \override Rest #'stencil = ##f
   \override MultiMeasureRest #'stencil = ##f
index 0b1f2a2ea78fd52bce237d3765059cf09b555668..5a60e0ebf7673153a5268ac253c9f5143484d75d 100644 (file)
@@ -415,6 +415,7 @@ tabFullNotation = {
   \revert NoteColumn #'ignore-collision
   % beams, dots
   \revert TabVoice.Beam #'stencil
+  \revert TabVoice.StemTremolo #'stencil
   \revert TabVoice.Dots #'stencil
   \revert TabVoice.Tie #'stencil
   \revert TabVoice.Tie #'after-line-breaking
index 71b453c0fb7de0608038cfdef0d5e29e1d183802..419f93c2cf15012ba6e3deedfc915b4c5ee48dc1 100644 (file)
 
     (ly:grob-set-property! grob 'control-points new-control-points)
     (ly:slur::print grob)))
+
+;; for \tabFullNotation, the stem tremolo beams are too big in comparison to
+;; normal staves; this wrapper function scales accordingly:
+(define-public (stem-tremolo::calc-tab-width grob)
+  (let ((width (ly:stem-tremolo::calc-width grob))
+       (staff-space (ly:staff-symbol-staff-space grob)))
+    (/ width staff-space)))