The program uses a
Markov Chain to calculate the next note based on the current note and
the probabilities of the next notes. In some cases, the Markov Chain is
expanded to a point where the next note is a function of not only the
current note but also the previous note. For example, when the melody
leaps in one direction, the next note has a higher probability of
stepping in the other direction to compensate for this leap.
The
program creates a MIDI file, which can then be placed into a program
such as MidiIllustrator, which converts the MIDI file into sheet music.
Example of a Sample Song created by the Melody Generator and placed into MidiIllustrator