I’m taking my very first little steps into Scheme right now by trying to write a function that can make single note heads (and accidentals) in a chord smaller (to differentiate background vocals from lead vocal when writing them all in one voice).
bgr = #(define-music-function
(parser location note)
(ly:music?)
#{
\tweak NoteHead.font-size #-2
\tweak Accidental.font-size #-2
#note
#})
or
bgr = #(define-music-function
(parser location note)
(ly:music?)
(set! (ly:music-property note 'tweaks)
(cons (cons (cons (quote NoteHead) (quote font-size))
-2)
(ly:music-property note 'tweaks)))
(set! (ly:music-property note 'tweaks)
(cons (cons (cons (quote Accidental) (quote font-size))
-2)
(ly:music-property note 'tweaks)))
note)
which should be the same.
Here is an example that uses it:
\new Voice <<
\relative c' {
c4 d e f
}
\relative c' {
\bgr e4
\bgr f
\bgr g
\bgr a
}
>>
But I would like to be able to use the function as follows, so it doesn’t only affect the next note, but a sequence of notes enclosed in { … }:
\new Voice <<
\relative c' {
c4 d e f
}
\relative c' {
\bgr { e4 f g a }
}
>>
Can somebody point me in the right direction how to do this?