\version "2.19.65"
myscale.sharp = #(make-semitone->pitch
(music-pitches #{ c cis d dis e f fis g gis a ais b #}))
myscale.flat = #(make-semitone->pitch
(music-pitches #{ c des d es e f ges g as a bes b #}))
sequence =
#(define-music-function (start end step scale)
(ly:pitch? ly:pitch? number? symbol?)
#{ $@(map #{ \myscale.#scale #}
(iota (1+ (/ (modulo (- (ly:pitch-semitones end)
(ly:pitch-semitones start))
(if (negative? step) -12 12))
step))
(ly:pitch-semitones start)
step))
#})
\displayLilyMusic \sequence a g 1 sharp
\displayLilyMusic \sequence f a -2 flat
2 of 2
No meta comments in post (also please just stay registered and we can address issues rather than just having them be abandoned.)
Dom
- 48k
- 24
- 158
- 287
user44693