Hi Kieren,

1. Do you agree?

No, I think I don't. The reason is that (as Jean pointed out to me while I was working on \after) the notes should be entered by the user in the order in which they appear in print; basically that's why internally \afterGrace does not use \after but repeats the internals structure of \after.

2. What’s your advice on the best UI/UX?

I think it's not bad as it is. Maybe \afterHint and \hint (or (\hintBefore or something like that) would be easier to memorise?

3. How would you code that?

Well, we don't need parser/location arguments anymore.

There's also the smal issue that we take a ly:music? argument even though we actually only want one note. We don't have a good predicate for this. But: Isn't it safe to assume that the hint note will always be a 4 notehead? Then we might make the code more concise by accepting only a ly:pitch?.

So maybe something like this?

\version "2.25.27"
\language "english"

hintNote =
#(define-music-function (hint-pitch) (ly:pitch?)
   #{
     \single \omit Stem
     \tweak Parentheses.font-size -3
     \tweak Parentheses.padding 0.1
     \parenthesize $hint-pitch 4
   #})

hint = \grace \hintNote \etc

afterHint =
#(define-music-function (main hint-pitch) (ly:music? ly:pitch?)
 #{
   \afterGrace #main \hintNote #hint-pitch
 #})

{
 \key fs \major
 \afterHint as'1 bf'
 \key bf \major
 bf'
}

{
 \key fs \major
 as'1
 \key bf \major
 \hint as' bf'1
}
%%%  SNIPPET ENDS

Lukas

Reply via email to