Hello everybody,

this small patch extends lilypond's tablature features.
It provides a custom callback to print a given string instead of the fret number.

This patch is needed for providing proper harmonics support (i.e. declaring
guitar harmonics by ratio or fret).

Regards,

Marc


From a34ec51095cdc2f5e06e847c85fcd86b95ae7b1e Mon Sep 17 00:00:00 2001
From: Marc Hohl <[email protected]>
Date: Tue, 23 Nov 2010 21:18:25 +0100
Subject: [PATCH] tablature: provide custom fret labels

---
 scm/tablature.scm |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/scm/tablature.scm b/scm/tablature.scm
index 419f93c..1aa766d 100644
--- a/scm/tablature.scm
+++ b/scm/tablature.scm
@@ -255,3 +255,16 @@
   (let ((width (ly:stem-tremolo::calc-width grob))
        (staff-space (ly:staff-symbol-staff-space grob)))
     (/ width staff-space)))
+
+;; define custom fret label as markup
+(define-markup-command (customFretLabel
+                                layout props fret-label) (string?)
+  #:category music
+  "Draw a custom tab fret label."
+
+  (interpret-markup layout props
+                    (markup #:vcenter fret-label)))
+
+;; use it for custom fret labels
+(define-public ((tab-note-head::print-custom-fret-label fret) grob)
+  (grob-interpret-markup grob (make-customFretLabel-markup fret)))
-- 
1.7.0.4

_______________________________________________
lilypond-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to