I am looking for a Lilypond function to transpose sequences of notes between modes that have different intervallic structure (e. g. from major to harmonic minor). My assumption is that the modes have identical number of pitches.
For example, I'd like to transpose this C-major sequence:
music = { c b d e}
to relative harmonic minor key, expecting these notes as the output:
a gis b c
- If use the
\transpose
function I will get transposition to A major:
\transpose c' a {\music}
% result: a gis b cis
- If I use the
\modalTranspose
function I will get transposition to A natural minor (not harmonic minor, as I expect):
majorScale = { \relative { c' d e f g a b } }
\modalTranspose c' a \majorScale { \music }
% result: a g b c
It does not help to define a harmonic minor scale in the same way as majorScale
, pitches that do not overlap will be left unmodified.
Is there a way to do this kind of transposition using built-in functions? Or do you perhaps have an example of a custom function for this?