While writing a Lilypond score for recorders (flutes), I wish I could automatically mark notes with pitches beyond the range of an instrument by changing its color.
The idea is that, for example, all absolute pitches below f and all pitches above g'' are colored red for the bass instrument. The same for tenor, alt and soprano instruments.
I found a helpful question on coloring notes, but there remains a piece of code I cannot write:
#(define (ambitus-notehead-alt grob)
( **code_i_cannot_write** )
#(define (ambitus-notehead-tenor grob)
( **code_i_cannot_write** )
#(define (ambitus-notehead-bass grob)
( **code_i_cannot_write** )
\score {
\new Staff \relative c' {
\override NoteHead #'color = #ambitus-notehead-alt
\music_altrecorder
}
\new Staff \relative c' {
\override NoteHead #'color = #ambitus-notehead-tenor
\music_tenorrecorder
}
\new Staff \relative c' {
\override NoteHead #'color = #ambitus-notehead-bass
\music_bassrecorder
}
}