]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/letter-tablature-formatting.ly
baf88fa35e4e8b977bc0d8b07fb7caf318911c6f
[lilypond.git] / input / lsr / letter-tablature-formatting.ly
1 %% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it
2 %% This file is in the public domain.
3 \version "2.13.1"
4
5 \header {
6   lsrtags = "staff-notation, fretted-strings"
7
8   texidoc = "
9 Tablature can be formatted using letters instead of numbers. 
10
11 "
12   doctitle = "Letter tablature formatting"
13 } % begin verbatim
14
15 #(define (letter-tablature-format str context event)
16   (let ((tuning (ly:context-property context 'stringTunings))
17         (pitch (ly:event-property event 'pitch)))
18     (make-whiteout-markup
19      (make-vcenter-markup
20       (string (integer->char
21          (+ (char->integer #\a)
22             (- (ly:pitch-semitones pitch)
23             (list-ref tuning (- str 1))))))))))
24
25 music = \relative c {
26   c4 d e f
27   g4 a b c
28   d4 e f g
29 }
30
31 <<
32   \new Staff {
33     \clef "G_8"
34     \music
35   }
36   \new TabStaff \with { 
37     tablatureFormat = #letter-tablature-format
38   }
39   {
40     \music
41   }
42 >>