When our team was waiting for Hackathon to start, we were jamming out to the music that was playing. We proceeded to talk about music theory, and the idea for our project developed into creating a random music generator that would produce a tonal melody.

What it does

The purpose of this project was to create a random melody generator. The generator takes song length, key, starting note, and tempo as input from the user. The program then generates a random melody from the input that conforms with standard music theory rules.

How we built it

The program is written in Java and is reliant on a package developed by Mobileer Inc. called JSyn. This package is used to generate the sound in the program. The program is called "StructuredMelodyPlayer" found in the repository.

The program includes functions such as randomDouble() in order to randomize the notes of the melody. However, the order of the notes is determined following the rules of music theory. Therefore, we had to determine the probability of the following note(s).

In accordance to the user's inputs, we implemented various if-else statements as well as switch-case statements.

We integrated the code into Android Studio to develop the app.

Challenges we ran into

  • Integrate the sequence generator to the sound generator
  • Figuring out android studio
  • Several bugs happened with sound generation, which required unorthodox solutions

Accomplishments that we're proud of

  • Using the sound generator effectively
  • The program is easily alterable and modular

What we learned

  • Thinking outside the box to solve bugs
  • Had to utilize unfamiliar software through trial and error

What's next for MeloGen

  • Generating chords
  • Different note lengths
  • Song structures
  • Optional music theory rules
  • Altering probabilities of certain notes being played
  • Different instruments
  • Producing different harmonies

Built With

Share this project: