]> git.donarmstrong.com Git - lilypond.git/blob - input/lsr/letter-tablature-formatting.ly
Merge master into nested-bookparts
[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 #(define (letter-tablature-format str context event)
14   (let*
15       ((tuning (ly:context-property context 'stringTunings))
16        (pitch (ly:event-property event 'pitch)))
17     (make-whiteout-markup
18      (make-vcenter-markup
19       (string (integer->char
20          (+ (char->integer #\a)
21             (- (ly:pitch-semitones pitch)
22             (list-ref tuning (- str 1))))))))))
23
24 music = \relative c {
25   c4 d e f
26   g4 a b c
27   d4 e f g
28 }
29
30 <<
31   \new Staff {
32     \clef "G_8"
33     \music
34   }
35   \new TabStaff \with { 
36     tablatureFormat = #letter-tablature-format
37   }
38   {
39     \music
40   }
41 >>