On 2019-11-25 2:26 am, Sandro Santilli wrote:
I'm trying, for backward compatibility, to keep that
highlightOutOfRange function, is that possible ?
What compatibility are you needing?
I intended \highlightPitches to be a significant upgrade to my earlier
\highlightOutOfRange, which I would no longer recommend using.
Of course, it is not a drop-in replacement, as there were several
significant changes in its interface and usage:
%%%%
% original %
\override NoteHead.color = \highlightOutOfRange c' c''
% new %
\highlightPitches outside { c' c'' }
%%%%
Of note, the \override is now encapsulated within the new music
function; and when specifying multiple pitches, they must be enclosed in
curly braces.
Yet it is that second change in interface that ultimately permits what
you had requested:
%%%%
% requested (though invalid) syntax %
instrumentRange = c' c''
\override NoteHead.color = \highlightOutOfRange \instrumentRange
% realized syntax %
instrumentRange = { c' c'' }
\highlightPitches outside \instrumentRange
%%%%
Please let me know if I am overlooking a critical detail in your use
case where my newer function would not be fit for purpose.
-- Aaron Hill