X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Flsr%2Fletter-tablature-formatting.ly;h=0f7eac274074c7501ad1e5f9e6b51afd7b77331b;hb=cfc4cbf34569db6a6c8968694f86e36b206a9d05;hp=3fb01d3934945689d4bb8fe8f4cb101d458f4792;hpb=fec91b4e613b780ddc9ad9dc04b477296d60a6db;p=lilypond.git diff --git a/input/lsr/letter-tablature-formatting.ly b/input/lsr/letter-tablature-formatting.ly index 3fb01d3934..0f7eac2740 100644 --- a/input/lsr/letter-tablature-formatting.ly +++ b/input/lsr/letter-tablature-formatting.ly @@ -1,14 +1,43 @@ %% Do not edit this file; it is auto-generated from input/new %% This file is in the public domain. -\version "2.11.38" +%% Note: this file works from version 2.12.0 +\version "2.13.1" \header { - lsrtags = "fretted-strings" - 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 + } +>>