]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/letter-tablature-formatting.ly
Add a hack to packed spacing to work around extra columns.
[lilypond.git] / input / lsr / letter-tablature-formatting.ly
1 %% Do not edit this file; it is auto-generated from input/new
2 %% This file is in the public domain.
3 \version "2.11.62"
4
5 \header {
6   lsrtags = "staff-notation,fretted-strings"
7
8   texidoc = "Tablature can be formatted using letters instead of
9 numbers."
10   doctitle = "Letter tablature formatting"
11 } % begin verbatim
12
13
14 #(define (letter-tablature-format str context event)
15   (let*
16       ((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 >>