Hi Kieren,
%%% SNIPPET BEGINS
\version "2.25.32"
\language "english"
hintL =
#(define-music-function
(parser location mainNote hintNote)
(ly:music? ly:music?)
#{
\grace
{ \once \omit Stem \tweak Parentheses.font-size -3 \tweak
Parentheses.padding 0.1 \parenthesize #hintNote }
{ #mainNote }
#})
hintR =
#(define-music-function
(parser location mainNote hintNote)
(ly:music? ly:music?)
#{
\afterGrace
{ #mainNote }
{ \once \omit Stem \tweak Parentheses.font-size -3 \tweak
Parentheses.padding 0.1 \parenthesize #hintNote }
#})
{
\key fs \major
\hintR as'1 bf'4
\key bf \major
bf'1
}
{
\key fs \major
as'1
\key bf \major
\hintL bf'1 as'4
}
%%% SNIPPETENDS
I think it would be superior to have a single function with a switch for which
side the hint note is on.
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?.
4. Should we *not* be using \grace and \afterGrace [in largest part because of
Issue 34]? Is there a better alternative?
No idea. The "correct" way would probably be to establish a new Grob
"HintNoteHead" instead of piggybacking in the grace mechanism, but that
is a bit of work ...
Lukas