From 958a6362485f6a9bcdd8ca88d034f06877676c33 Mon Sep 17 00:00:00 2001 From: Marc Hohl Date: Tue, 24 Aug 2010 14:46:45 +0200 Subject: [PATCH] Tablature: support StemTremolo correctly --- ly/engraver-init.ly | 9 +++++++++ ly/property-init.ly | 1 + scm/tablature.scm | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 6ecba2ddf4..22e588c742 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -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 diff --git a/ly/property-init.ly b/ly/property-init.ly index 0b1f2a2ea7..5a60e0ebf7 100644 --- a/ly/property-init.ly +++ b/ly/property-init.ly @@ -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 diff --git a/scm/tablature.scm b/scm/tablature.scm index 71b453c0fb..419f93c2cf 100644 --- a/scm/tablature.scm +++ b/scm/tablature.scm @@ -248,3 +248,10 @@ (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))) -- 2.39.2