I am attempting write a small function to add a bit of text above an artificial harmonic in tablature.

But I am getting an error. See script and log output below. If I had hard code the value for the note it works ok but not when I try to use a parameter variable.

The desired result example is below on the first note.   I just want to add a some text above the harmonic to indicate the harmonic fret.




If I hard code the note value instead of using the variable (refer to commented line below) I get the desired result.

Parsing...

G:/My Drive/Sheet Music/Lilypond/tests/marmonics.ly:16:3: warning: Unattached TextScriptEvent

\ah #4 g4\3 "16"


\version "2.24.4"



ah =
#(define-music-function (sfrt note hfrt ) (number? ly:music? string? )
   #{
%     \harmonicByFret #sfrt g4\3 ^\markup { \center-align \teeny \concat {< #hfrt > }}      \harmonicByFret #sfrt #note ^\markup { \center-align \teeny \concat {< #hfrt > }}
   #})

frettedStrings = {
  \harmonicByFret #4 g4\3 ^\markup { \center-align  \teeny "<16>" }
  \ah #4 g4\3 "16"
}

\score {
  \layout {
    \context {
      \TabStaff
      \revert TextScript.stencil
    }
  }
  <<
    \new TabStaff {
      \new TabVoice {
        \frettedStrings
      }
    }
  >>
}



Walt North

Reply via email to