On 20/03/2025 11:44, Lucas Cavalcanti wrote:
Hello, Lukas. I've re-drafted a mock up of the function in question. but now the mock up actually worked... I was just not adding the hash "#" to the number argument.... Still, I'll attach the function below to see if it can be better optimized.You could write this function more briefly as below. I wonder if there is any ambiguity about transposition by, for example, one semitone: should it be \transpose c cis or \transpose c des ?
\version "2.24.0"#(define pitches (vector #{c#} #{des#} #{d#} #{es#} #{e#} #{f#} #{fis#} #{g#} #{as#} #{a#} #{bes#} #{b#} #{c'#}))
someFunction = #(define-music-function (note transposeCoeficient) (ly:music? integer?) (make-relative (note) note#{ $note \transpose c #(vector-ref pitches transposeCoeficient) $note #}))
\score {\relative c' { \someFunction c4 12 }}
--
Timothy Lanfear, Bristol, UK.
