AI has become an increasingly interesting field in the last few years.  A couple of years ago, we saw Watson, the IBM supercomputer, beat the best Jeopardy players at their own game.  Self-driving cars are on the brink of public deployment.  However, all of these AI programs are rather deterministic in nature; they have a very closed goal, be it to win Jeopardy or drive to a location.  My project will involve creating an AI like these, except with a more open-ended problem.  My plan is to develop an application, where the user can merely click a button (after entering a few settings) and have the computer compose a piece of music.  In the end, I hope that I can refine the algorithm to the point where the computer’s composition is nearly indistinguishable from a human’s.

The concept for this project was brought about when my piano teacher claimed that a computer could never write a fugue.  A fugue is a type of music where one hand repeats the pattern played by the other, only delayed a little bit.  A fugue has a very defined recipe and format, which would make it relatively easy for a computer to generate one.  As such, I decided to take up this challenge as my DCC capstone project.

The application will be split into two parts.  The first part will be the interface for setting up the AI to generate the song.  This will involve the user selecting a key, tempo, and style.  For instance the user could select a Waltz in F major, at 140 beats per minute.  Given these settings, the AI would compose a song for the piano, using the algorithm specified for that style of song.  The program would then output the song as a MIDI file.  A MIDI file is optimal for this application because it stores individual notes and chords, rather than the waveform data.  This will make it easier for me to translate from the AI’s output to a readable format.  The other part of this project will be the interface for playing back the MIDI file that it generated.  The main goal for this part is to allow the user to play back the song immediately after it is created.  At the bare minimum, the program would load up Windows Media Player to play the song.  On the more advanced end, I could create a graphical interface showing each of the notes on a clef.  The entire program will be programmed in either C++ or Java for Windows.

The core of this project will be the actual AI itself.  For this, I plan on employing a number of different techniques to achieve an enjoyable piece of music.  The computer will have to understand a basic level of music theory, so it can change keys without sounding awful and create nice-sounding melodies.  It will also have to understand the constraints of the style of music it is trying to create.  For instance, if the user wanted a Waltz, the music would have to be in 3/4 and play the correct chords in the left hand.  For a fugue, it would have to follow the traditional style for a fugue.  The challenge for this AI is that the goal is more open ended.  There is no specific end state for the problem; the AI will have to mimic human creativity.  There are several ways I could go about doing this.  The most basic would be to come up with an algorithm to generate pseudo-realistic music.  However, I would need to reprogram the AI for each individual style.  Some other techniques would involve programming the computer to “learn” a style of music, and then recreate that style when the user asks it to.  This could possibly be done through the use of artificial neural networks or other machine learning algorithms.

The next couple weeks will be devoted to research on the topic.  I will have to research what techniques experts have used to achieve these ends, and if there have been any previous attempts to have an AI generate music.  I will draw upon the findings made by these projects to try and make my final produce as human-like as possible.  After that, I will begin development of the application itself, beginning with a simple user interface.  Most of the development time will be spent refining the AI, utilizing the research from before to make the generated music as realistic as possible.  After the AI has reached a satisfactory level, I can make the the interface more user friendly.

 

Leave a Reply