X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Flsr%2Fletter-tablature-formatting.ly;h=beaaa0f723900e39e445286458e698e6dc4b5fe5;hb=6140c6eb657080939fa4aef3d00d717bd85b5028;hp=7d1e7f414618c51c758b6a4ae5e2b822581d94e6;hpb=8dbc847638b24a60ca66110850cc020aeb69b646;p=lilypond.git diff --git a/input/lsr/letter-tablature-formatting.ly b/input/lsr/letter-tablature-formatting.ly index 7d1e7f4146..beaaa0f723 100644 --- a/input/lsr/letter-tablature-formatting.ly +++ b/input/lsr/letter-tablature-formatting.ly @@ -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.12.0" \header { - 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. + lsrtags = "staff-notation,fretted-strings" -BROKEN IN 2.11, COMMENTED OUT." + texidoc = "Tablature can be formatted using letters instead of +numbers." + doctitle = "Letter tablature formatting" } % begin verbatim -{ c'4 } + + +#(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 +} + +<< + \new Staff { + \clef "G_8" + \music + } + \new TabStaff \with { + tablatureFormat = #letter-tablature-format + } + { + \music + } +>>