Lucas Cavalcanti <lucaspi...@gmail.com> writes: > Hello! > > I'm writing (or at least trying) a function that creates a note and it's > third at once. I've managed to write the function, create the note and the > interval. But the function doesn't work well with the \relative command. Or > probably this function is just not written correctly. Either way, I'd > appreciate some help with this one! > > %%Code begins > \version "2.25.20" > termaj = > #(define-music-function > (note) > (ly:music?) > #{ > $note \transpose c e' { $note } > #}) > \relative c' {\termaj c4*1/5 c' \termaj c } > %%Code ends
make-relative helps creating a "do what I mean, not what I say" environment:
%%Code begins \version "2.25.20" termaj = #(define-music-function (note) (ly:music?) (make-relative (note) note #{ $note \transpose c e { $note } #})) \relative c' {\termaj c4*1/5 c' \termaj c } %%Code ends
-- David Kastrup