X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=input%2Flsr%2Fletter-tablature-formatting.ly;h=baf88fa35e4e8b977bc0d8b07fb7caf318911c6f;hb=b97565a9af1c13369ac7e7e9ea80c2638dbc0e51;hp=1004ca11d9fb4953f9be5198af07b12d0ce7c8dc;hpb=61982f69784ce0fe80c719b0bab53d78c24779ce;p=lilypond.git diff --git a/input/lsr/letter-tablature-formatting.ly b/input/lsr/letter-tablature-formatting.ly index 1004ca11d9..baf88fa35e 100644 --- a/input/lsr/letter-tablature-formatting.ly +++ b/input/lsr/letter-tablature-formatting.ly @@ -1,12 +1,42 @@ -%% Do not edit this file; it is auto-generated from LSR! -%% Tags: guitar -%% Do not edit this file; it is auto-generated from LSR! -\version "2.11.35" - -\header { texidoc = " -You can format a tablature with letters instead of numbers - so that -0->a, 1->b, 2->c, etc. - -BROKEN IN 2.11, COMMENTED OUT. -" } -{ c'4 } +%% Do not edit this file; it is auto-generated from LSR http://lsr.dsi.unimi.it +%% This file is in the public domain. +\version "2.13.1" + +\header { + lsrtags = "staff-notation, fretted-strings" + + texidoc = " +Tablature can be formatted using letters instead of numbers. + +" + doctitle = "Letter tablature formatting" +} % begin verbatim + +#(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 + } +>>