\version "2.22.1" \paper { indent = 0 paper-width = 35\cm } key = #(define-scheme-function (tonic pitch-alist) ((ly:pitch? '()) (number-pair-list? '())) #{ \set chordRootNamer = #(lambda (pitch lowercase?) (let* ((tsp-pitch (ly:pitch-transpose pitch (ly:pitch-negate tonic))) (step (ly:pitch-notename tsp-pitch)) (alteration (ly:pitch-alteration tsp-pitch)) (scale-alteration (assoc-get step pitch-alist)) (true-alteration (- alteration scale-alteration))) (format "~a(~a)" (1+ step) (* 2 true-alteration)))) #(ly:music-transpose (make-music 'KeyChangeEvent 'tonic (ly:make-pitch 0 0 0) 'pitch-alist pitch-alist) tonic) #}) crds = \chordmode { c4*2/11 d e f g a b cis dis eis fis gis ais bis ces des ees fes ges aes bes f:sus4 } roots = \fixed c' { c4*2/11 d e f g a b cis dis eis fis gis ais bis ces des ees fes ges aes bes f } << \chords { \override Score.RehearsalMark.break-visibility = #end-of-line-invisible \override Score.RehearsalMark.parent-alignment-X = #LEFT \override Score.RehearsalMark.self-alignment-X = #LEFT \mark "Default chords" \crds \mark "C major" \key c \major \crds \mark "C minor" \key c \minor \crds \mark "A major" \key a \major \crds } \new Staff { \accidentalStyle forget \roots \key c \major \roots \key c \minor \roots \key a \major \roots } >>