A simple program which generates the accompaniment based on a given melody.
Input a
from ostinato import Ostinato
ly = Ostinato("input.ly")
ly.generate_lh()
print ly.output()
python-ly
mary_had_a_little_lamb = r""" \relative c'
{
\time 4/4
e d c d
e e e2
d4 d d2
e4 g g2
e4 d c d
e e e e
d d e d
c1
}
"""
show(ostinato(mary_had_a_little_lamb))
The original lilypond file would be:
whilst the updated one would be: