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