> Hi Federico,
> 
> it's in the snippets:
> 
> http://lilypond.org/doc/v2.13/Documentation/snippets/fretted-strings#fretted_002dstring-harmonics-in-tablature
> 

Ok, thanks!
BTW, I think that in that snippet some pitches are not correct.
I'll write to lilypond-bug.

> > Also, I've noticed that \harmonicsOn works only in Staff and not in
> > TabStaff.  There's a reason for this behavior or it's a bug?
> A bug, probably.

I'll send a bug report.

Now I understand how harmonicsBy... work.
I have a couple of questions (see file attached):

* \harmonic prints 19th fret instead of 7th and 24th fret instead of 5th
on TabStaff.  I don't think it's desirable, because it's more likely
that 5th and 7th frets will be used.  I wonder if \harmonicByFret was
introduced to solve this problem.

* as you can see in the example, when \harmonicByFret and
\harmonicByRatio are used, string numbers don't show up in Staff (they
do if \harmonic is used).

Cheers,
Federico
\version "2.15.0"

\paper {
  indent = 0
  print-all-headers = ##t
}

harmonic = \relative c  {
  %% \harmonic works by specifying the pitch produced by the harmonic
  %% and the string number.

  %% 12th fret
  <e\6\harmonic>8 <a\5\harmonic> <d\4\harmonic>
  <g\3\harmonic> <b\2\harmonic> <e\1\harmonic>4. |

  %% 7th fret
  %% Why 19th fret is default? (it's more likely to play these notes on 7th fret)
  %% ... I'm forced to use \harmonicByFret in order to get 7th fret
  <b,\6\harmonic>8 <e\5\harmonic> <a\4\harmonic>
  <d\3\harmonic> <fis\2\harmonic> <b\1\harmonic>4. |

  %% 5th fret
  %% again, I'll (almost) never play these harmonics on 24th fret
  %% the only way is using \harmonicByFret?
  <e,,\6\harmonic>8 <a\5\harmonic> <d\4\harmonic>
  <g\3\harmonic> <b\2\harmonic> <e\1\harmonic>4. |
}


harmonicFret = \relative c, {
  %% \harmonicByFret
  %% I tell LilyPond which fret should be used (#7) on which string (e\6) ["tuning independent"]
  %% LilyPond will find the right note
  %% NOTE: string numbers in Staff are not printed (?)

  %% 12th fret
  \harmonicByFret #12 e8\6 % ok
  \harmonicByFret #12 a,\5 % why I have to put a comma on all the following harmonics?
  \harmonicByFret #12 d,\4
  \harmonicByFret #12 g,\3
  \harmonicByFret #12 b,\2
  \harmonicByFret #12 e,4.\1

  %% 7th fret
  \harmonicByFret #7 e,,8\6
  \harmonicByFret #7 a,,\5 % two commas here!
  \harmonicByFret #7 d,\4
  \harmonicByFret #7 g,,\3
  \harmonicByFret #7 b,,\2
  \harmonicByFret #7 e,4.\1

  %% 5th fret
  \harmonicByFret #5 e,,,,8\6
  \harmonicByFret #5 a,,\5
  \harmonicByFret #5 d,,\4
  \harmonicByFret #5 g,,\3
  \harmonicByFret #5 b,,\2
  \harmonicByFret #5 e,,4.\1

  %pinched harmonics (PH)
  \harmonicByFret #7 d,,,2\4
  \harmonicByFret #5 d,,4\4
  \harmonicByFret #7 a,,,4\5
}

harmonicRatio = \relative c, {
  %% \harmonicByRatio
  %% Again, as above, the pitch is computed by LilyPond.
  %% LilyPond must know the string and the point on the string (middle, third,..)
  %% where the harmonic is produced.

  %% 12th fret
  \harmonicByRatio #1/2 e8\6
  \harmonicByRatio #1/2 a,\5
  \harmonicByRatio #1/2 d,\4
  \harmonicByRatio #1/2 g,\3
  \harmonicByRatio #1/2 b,\2
  \harmonicByRatio #1/2 e,4.\1

  %% 7th fret
  \harmonicByRatio #1/3 e,,8\6
  \harmonicByRatio #1/3 a,,\5
  \harmonicByRatio #1/3 d,\4
  \harmonicByRatio #1/3 g,,\3
  \harmonicByRatio #1/3 b,,\2
  \harmonicByRatio #1/3 e,4.\1

  %% 5th fret
  \harmonicByRatio #1/4 e,,,,8\6
  \harmonicByRatio #1/4 a,,\5
  \harmonicByRatio #1/4 d,,\4
  \harmonicByRatio #1/4 g,,\3
  \harmonicByRatio #1/4 b,,\2
  \harmonicByRatio #1/4 e,,\1

}

\score {
  \new StaffGroup <<
    \new Staff { \clef "G_8" \harmonic }
    \new TabStaff { \clef "moderntab" \harmonic }
  >>
  \header {
    title = "Standard harmonic (by Pitch)"
  }
}

\score {
  \new StaffGroup <<
    \new Staff { \clef "G_8" \harmonicFret }
    \new TabStaff { \clef "moderntab" \harmonicFret }
  >>
  \header {
    title = "Harmonic by Fret"
  }
}

\score {
  \new StaffGroup <<
    \new Staff { \clef "G_8" \harmonicRatio }
    \new TabStaff { \clef "moderntab" \harmonicRatio }
  >>
  \header {
    title = "Harmonic by Ratio"
  }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to