Inspiration

Caroline Fröhlich was interested in finding a way to generate "infinite music" for games. She decided to share her thoughts with me (Gil Dekel, I have an extensive background in music performance and theory) and together we decided to give it our best shot, at our first Hackathon in the US.

How it works

This simple application uses Java's MIDI libraries. The magic is in the algorithms, not the APIs. It includes several basic pentatonic scales from which it chooses the notes to play, and along with some very simple statistical computations and music theory understanding, we were able to develop a naïve but somewhat pleasant music generator that can produce simple harmonies, melodies and rhythm.

Challenges I ran into

On my end - I was facing some beginner's difficulties with Java. Carol was very helpful and guiding and together we were able to overcome all of our syntax errors, logic issues and bugs. On Carol's end - her lack of music theory knowledge required a lot of explanations by me. She was unable to successfully differentiate the bad results from the good.

Accomplishments that I'm proud of

Prior to this event, none of us was able to produce a peep with Java. We are now proud of out little product, who can produce arguably good music :) It was also a good Java refresher for Carol, and she rediscovered her affinity to back-end development.

What I learned

That teaching a computer how to generate a piece of music that can be accepted by humans and somewhat enjoyable is not an easy task. It gave me some serious perspective on notions of machine learning and A.I.

What's next for hack-Princeton-project_The-Code-of-Music

1) A simple GUI to interact with the user. Sadly, we have no UI at the moment. 2) We were planning on integrating Indico's sentiment recognition into our app by asking the users how was their day, and thus deciding the nature of the scale (happy or sad) in order to match our user's mood. 3) Also, some ideas were thrown towards using the Myo armband to produce music generated by motion and dance movement.

Built With

Share this project:

Updates