Introduction

The Mozart Transposition Engine is a custom-developed software toolchain for creating transposed, mirror image scores for use with the Kundalini Piano Mirroring Platform.
Toolchain
The toolchain consists of two primary parts:
- Mozart-Compile: Python script which is responsible for parsing text files in GNU LilyPond format, and creating transposed, mirror image versions of them.
- Mozart-Make: a ‘make-style’ driver program responsible for invoking Mozart-Compile and organizing the resultant output
Additional Background on GNU Lilypond
GNU LilyPond is arguably one of my overall favorite pieces of software engineering; it is a masterpiece on so many levels!!
LilyPond is a compiler which takes a textual description of a score, and produces beautifully-engraved graphical output.
For example, LilyPond creates input like this:
\version "2.18.2"
global = {
\time 2/4
\language english
}
right = \relative c' {
\key d \major
\global
<a' d fs a>8
<a fs' a>8
<a fs' a>8
(<a d fs>8)
<a cs e g>8
<a e' g>8
<a e' g>8
(<a cs e>8)
<a d fs>8
<fs a d>8
<g a e'>8
<e a cs>8
<fs a d>8
<a fs'>8
<fs d'>8
r8
}
left = \relative c, {
\key d \major
\global
d32
( d' cs d a d fs, d'
d,e fs g
a b-3 cs d
)
a( a' gs a
e a cs,
a' a, b cs d
e fs gs a)
d,(e fs g
a b-3 cs d)
a, (b cs d
e fs gs a)
d,, (d' cs d a d fs, d')
d8
r8
}
\score {
\new PianoStaff \with {
instrumentName = "Piano"
} <<
\new Staff = "right" \with {
} { \clef treble \right }
\new Staff = "left" \with {
} { \clef bass \left }
>>
\layout { }
}
and creates output like this:

The Mozart transposition Engine is responsible for taking the original lilypond input and producing a symmetrically-inverted output:
\version "2.18.2"
\pointAndClickOff
global = {
\time 2/4
\language english
}
right = \relative c''' {
\key af \major
\global
c32
( c, df c f c af' c,
c' bf af g
f ef df c
)
f'(f, gf f
bf f df' f,
f' ef df c bf af gf f)
c'( bf af g
f ef df c)
f'(ef df c bf af gf f)
c'
( c, df c f c af' c,)
c'8
r8
}
left = \relative c, {
\key af \major
\global
<f af c f>8
<f af f'>8
<f af f'>8
(
<f' c af>8
)
<f df bf g>8
<f bf, g>8
<f bf, g>8
<f bf, df>8
<f c af>8
<af f c>8
<g f bf,>
<bf f df>
<af f c>
<f af,>
<af c,>
}
\score {
\new PianoStaff \with {
instrumentName = "Piano"
} <<
\new Staff = "right" \with {
midiInstrument = "acoustic grand"
} \right
\new Staff = "left" \with {
midiInstrument = "acoustic grand"
} { \clef bass \left }
>>
\layout { }
\midi {
\tempo 4=100
}
}
Which is then ran through LilyPond again to produce the Mirror-Image output:

Next Steps
- Checkout Bach-In-The-Mirror for an example
- Checkout the source for this on Github