A little program I made to generate random melodies which, for the most part, stick to the basic "rules" for writing cheesy melodies, as one would in a music theory exam.
First I wanted to focus on the melody generation so I hardcoded in a "cheesy accompaniment". The same accompaniment pattern is generated for which ever chords are entered into the chord progression text field. This sentece may be difficult to understand but if you listen to one of the "cheesy" samples you will instantly see what I mean.
I kept the structure of the pieces constant. It is as follows:
bar for each chord
bar for each chord
modulate up one semitone
bar for each chord
bar for each chord
Each piece therefore consists of 4 bars.
The melody was generated by progressively adding random notes. However, the notes are not entirely random. Some constraints on the rhythm and pitch such as ensuring that on the main beats the current note of the melody is always one from the chord of that bar. The constraints are difficult to explain here in words, but should be easy enough to understand by looking at the source especially if you are familiar with reading and writing music.
Outputs with cheesy accompaniment:
Outputs with random accompaniment:
Enjoy!
Footnote:
Yes, I apologise for the Netbeans generated Swing GUI. We live and we learn, right?
