]> git.donarmstrong.com Git - lilypond.git/blobdiff - input/lsr/letter-tablature-formatting.ly
Merge commit 'origin/dev/jneeman' into systems-per-page
[lilypond.git] / input / lsr / letter-tablature-formatting.ly
index c2e7d3211b13c52715d24b3e13c9f5faa0f41210..eb2842ff6470eb2ab55141f5496cb45d379b61e3 100644 (file)
@@ -1,14 +1,42 @@
 %% Do not edit this file; it is auto-generated from input/new
 %% This file is in the public domain.
-\version "2.11.38"
+\version "2.13.0"
 
 \header {
+  lsrtags = "staff-notation,fretted-strings"
+
+  texidoc = "Tablature can be formatted using letters instead of
+numbers."
   doctitle = "Letter tablature formatting"
-  lsrtags = "guitar"
-  texidoc = "
-You can format a tablature with letters instead of numbers - so that
-0->a, 1->b, 2->c, etc. 
+} % begin verbatim
+
 
-BROKEN IN 2.11, COMMENTED OUT."
+#(define (letter-tablature-format str context event)
+  (let*
+      ((tuning (ly:context-property context 'stringTunings))
+       (pitch (ly:event-property event 'pitch)))
+    (make-whiteout-markup
+     (make-vcenter-markup
+      (string (integer->char
+         (+ (char->integer #\a)
+            (- (ly:pitch-semitones pitch)
+            (list-ref tuning (- str 1))))))))))
+
+music = \relative c {
+  c4 d e f
+  g4 a b c
+  d4 e f g
 }
-{ c'4 }
+
+<<
+  \new Staff {
+    \clef "G_8"
+    \music
+  }
+  \new TabStaff \with { 
+    tablatureFormat = #letter-tablature-format
+  }
+  {
+    \music
+  }
+>>