Dear guitar players and schemers:

Summary: \harmonicByRatio is too inaccurate and \harmonicByFret won't help for fret 3.2.

I was happy to discover that \harmonicByFret and \harmonicByRatio can produce decimal fret numbers in TabStaff as described in the NR [1] and the new LSR [2].

So I was disappointed when \harmonicByRatio #1/6 produced fret (3) in tab.  Trying to play there produced only a thud.  The right answer should have been fret (3.2).

That inaccuracy motivated checking the fret arithmetic in a spreadsheet, a snapshot of which is shown in the attached figure [3] fret-harmonics.png.  It's for the ideal string without any luthier compensations, but those compensations would typically exacerbate the inaccuracies shown.

In summary, the spreadsheet shows that

        \harmonicByRatio #1/5 should be at fret (3.9) instead of (4)

        \harmonicByRatio #1/6 should be at fret (3.2) instead of (3)

For practical tab use, using (4) instead of (3.9) is probably okay (it will still produce the desired note) but using (3) instead of (3.2) won't do, especially when writing instructional material about where the natural harmonics are located.

So how can I get the tab to show (3.2)?

The LSR [2] demonstrates what I thought was a workaround to force a desired decimal value:

        \harmonicByFret #2.7 produces fret (2.7) same as \harmonicByRatio #1/7

Wonderful, so \harmonicByFret #3.2 ought to work.  It does produce fret (3.2) in TabStaff but it totally screws up the actual note in the Staff, as shown for two cases in snapshot [4] MWE-harmonics.png (the code is in [5] MWE-harmonics.ly, trimmed down from the LSR [2]).

The first case, for #1/6, shows what happens when you replace #3 by #3.2, and the second case, for #1/7, tries to replace #2.7 by #2.8. In both attempts, Lilypond reverts to showing the bare fundamental note with a diamond head, not the desired harmonic.

It seems that \harmonicByFret won't take any other numbers but the ones that are hard-coded into tablature.scm:

        (define node-positions
          (vector 12
                  7   19
                  5   12    24
                  4    9    16   28
                  3    7    12   19    31
                  2.7  5.8  9.7  14.7  21.7  33.7
                  2.3  5    8    12    17    24    36
                  2    4.4  7    10    14    19    26  38 ))

I tried copying this scheme into my MWE (with a leading #) and changing the 3 to 3.2 but it had no effect.

Can someone show me how to modify my MWE so that it shows fret (3.2) for harmonic #1/6?

(I'm fine with keeping (2.7) for #1/7.  The 2.8 was just to show that unexpected numbers aren't effective.)

Thanks,
Jeff

--

[1] https://lilypond.org/doc/v2.24/Documentation/notation/common-notation-for-fretted-strings#default-tablatures

[2] https://wiki.lilypond.community/wiki/Open-string_harmonics_in_tablature

[3] fret-harmonics.png  (attached)

[4] MWE-harmonics.png  (attached)

[5] MWE-harmonics.ly  (attached)


\version "2.24.3"

% (this attempt to redefine was ineffective)
#(define node-positions
  (vector 12
          7   19
          5   12    24
          4    9    16   28
          3.2    7    12   19    31
          2.7  5.8  9.7  14.7  21.7  33.7
          2.3  5    8    12    17    24    36
          2    4.4  7    10    14    19    26  38 ))


openStringHarmonics = {
  \textSpannerDown
  \override TextSpanner.staff-padding = #3
  \override TextSpanner.dash-fraction = #0.3
  \override TextSpanner.dash-period = #1

  %fifth harmonic
  \override TextSpanner.bound-details.left.text =
    %\markup\small "5th harm. "
    \markup\small "harm #1/6 "
  \harmonicByFret #3 e,4\6\startTextSpan
  \harmonicByFret #3.2 e,\6  % gives wrong note (ditto #3.0)
  \harmonicByRatio #1/6 e,2\6\stopTextSpan

  %sixth harmonic
  \override TextSpanner.bound-details.left.text =
    %\markup\small "6th harm. "
    \markup\small "harm #1/7 "
  \harmonicByFret #2.7 e,4\6\startTextSpan
  \harmonicByFret #2.8 e,\6  % gives wrong note
  \harmonicByRatio #1/7 e,2\6\stopTextSpan
}

\score {
  <<
    \new Staff
    \with { \omit StringNumber } {
      \new Voice {
        \clef "treble_8"
        \openStringHarmonics
      }
    }
    \new TabStaff {
      \new TabVoice {
        \openStringHarmonics
      }
    }
  >>
}

Reply via email to