lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 5 string Banjo Tab


From: David Kastrup
Subject: Re: 5 string Banjo Tab
Date: Wed, 24 Jan 2018 11:34:19 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Richard Hoadley <address@hidden> writes:

>  I just joined Lilypond, so am very new at this program. I can’t read
> music and depend totally on Tabs. I need a table or list that shows
> what letters create each of the notes on a Tab. Some samples of the
> text would be helpful. Most of my Tabs are in Clawhammer style and
> open G tuning.

One problem is that a tab contains less musical (and often more
execution) information than notes and LilyPond wants you to enter notes.
In tab, there is no difference between Dβ™― and Eβ™­ while in notes there
is, and it is important to pick the right one in order to get good
representation of scales.  Naturally, this is both a problem for human
or computer converting tab info into note input.

Of course, when the only output you'd ever want to see are tabs, you
might care less about the intermediate stage...

I have some file where info is indeed entered mostly in tab form (by
using note letters in lieu of fret numbers, something which is
reasonably natural to do for lute tablature though probably not as much
for more common form of tablature).

If anybody sees a nice way to make this more palatable to tab users...

\version "2.19.50"

lute-tuning = \stringTuning <d, g, c f a d' g'>

tabtranslate =
#(define-music-function (pitches tuning music) (ly:music? pair? ly:music?)
   (define my-pitch (make-semitone->pitch (event-chord-pitches pitches)))
   (define string-number? (music-type-predicate 'string-number-event))
   (define semivec (list->vector (map ly:pitch-semitones tuning)))
   (map-some-music
    (lambda (m)
      (and (music-is-of-type? m 'note-event)
           (let* ((strs (ly:music-property m 'articulations))
                  (no
                   (case (length strs)
                     ((0) (ly:music-warning m "Needs string number") 1)
                     ((1) (ly:music-property (car strs) 'string-number))
                     (else (ly:music-warning m "Multiple string numbers")
                           (ly:music-property (car strs) 'string-number))))
                  (pit (ly:music-property m 'pitch))
                  (ab? (> (ly:pitch-notename pit) 4))
                  (num (+ (ly:pitch-steps pit) (if ab? 2 9)))
                  (no (if (and (integer? no)
                               (<= 1 no (vector-length semivec)))
                          (1- no)
                          (begin
                            (ly:music-warning (car strs)
                                              "Invalid string number")
                           0))))
             (set! (ly:music-property m 'pitch)
                   (my-pitch (+ (vector-ref semivec no) num)))
             m)))
    (tabChordRepeats music)))
%%

"|" = {
  \partial 1*0 \bar "|"
}

content =
\tabtranslate <c cis d dis e f fis g gis a bes b> \lute-tuning
{
  \set Staff.midiInstrument = "acoustic guitar (nylon)"
  \time 4/8
  \set Timing.measureLength = #(ly:make-moment 100000)
  \set Timing.beamExceptions = #'()
  \set Timing.baseMoment = #(ly:make-moment 1/4)
  <e\4 d\3 c\2>4
  q8 d\2 |
  <c\4 c\3 d\2>16
  c\2 c8\2
  <a\4 a\3 c\2>16
  a32\2 d\3 a8\2 |
  <e\5 e\4 c\3 c\2>16. e32\4 d16\4 g\5
  <e\5 d\4 c\3 c\2> e\4 e\5 d\4 |
  <c\6 e\5 e\4 d\3 c\2>8 <d\3 c\2>16 c\6 <b\6 c\3 c\2>8 a\2
  <c\6 e\5 e\4 d\3> <e\4 d\3>16 c\6 <e\5 e\4 c\3>8
  <c\3 c\2>16 e\5 <a\4 a\3 c\2>8 a16\2 c\3 |
  <e\5 d\3 c\2 a\1>8 c16\3 a\1 <c\5 d\2> a\3 <a\5 a\3 c\2>8 |
  <e\6 a\2>16 e\4 d\4 c\2 <c\6 a\3 d\2>8 c16\2 c\6 |
  <e\5 c\3 c\2>8 <c\3 c\2 a\1>16 e\5
  <a\4 a\3>8 d\2 <c\4 c\3> <d\3 c\2> <c\4 d\3 a\2 a\1> a16\6 a\2
  <a\5 c\4 d\3 c\2>8 d16\3 a\2 |
  <a\5 c\4 d\3 c\2> d\2 <a\5 a\1> c\2
  <d\7 a\4 a\3 d\2> <a\6 c\2>32 a\2 <c\6 d\3>16 <e\6 a\2> |
  <a\5 c\4 d\3 c\2>8 <d\3 c\2>16 a\5 <e\6 c\4 a\2>8 <e\5 c\3 c\2> |
  <b\5 a\3 c\2> <b\4 a\3 a\2> <d\5 c\3 e\2> <e\5 d\4 c\3 c\2> <c\6 e\5 e\4 d\3 
c\2>
  <d\3 c\2>16 c\6 <c\5 a\4 a\2>8 <a\3 a\2>16 a\5  d8\6 a\2
  <c\6 e\5>32 f\3 e\3 c\3 e16\3 c\6 |
  <c\5 a\3 a\2>4 r8 <e\6 b\4 b\2>8 q8. a16\2 <e\5 d\3>8 c16\3 c\5 |
  a\5 c\3 a8\3 <e\6 e\5 c\3> d16\5 e\6 |
  <e\5 d\4 c\3>4 <e\5 c\3 c\2>8 <c\6 e\5 e\4 e\3> |
  <c\5 b\4 a\2> c\4 <b\5 c\2>16 c\4 <c\5 b\4> a\2 |
  <e\5 d\4> d\3 e\4 a\2 <e\5 e\4 c\3 c\2>8 d16\4 a\2 |
  <c\6 a\3 d\2>8 c16\2 c\1 e\5 a\1 <e\6 a\2> <a\5 c\4 d\3 c\2>16. d32\2
  <a\6 c\3 a\2 a\1>16 <c\6 d\2>32 c\2 d16\3 |
  e\4 c\6 <a\6 c\3>8 <d\7 e\4 d\3>16. d32\3 <c\3 a\2>16 a\3 |
  <c\7 e\6 e\5 d\4 c\3 c\2>8. c16\2 q4 |
}

\score {
  \new StaffGroup
  <<
    \new Staff \with { \clef "treble_8"
                       \omit StringNumber
                     } \content
    \new TabStaff \with { stringTunings = \lute-tuning
                          tablatureFormat = #fret-letter-tablature-format
                          fretLabels = \markuplist \fontsize #2 \lower #0.2
                          { 𝖆 𝖇 π–ˆ 𝖉 π–Š 𝖋 π–Œ 𝖍 π–Ž 𝖐 𝖑 𝖒 𝖓 𝖔 𝖕 }
                        } \content
  >>
  \layout {}
}

\score {
  \new TabStaff \with { stringTunings = \lute-tuning } \content
  \midi {}
}

-- 
David Kastrup

reply via email to

[Prev in Thread] Current Thread [Next in Thread]