Inspiration

With all the chatbots inspired by ChatGPT, we thought we should do something similar, but in the form of music! (partly inspired by MusicLM)

What it does

Basic features:

  • Generate short melodies from a text prompt.
  • Generate lyrics from an audio sample

How we built it

For the frontend:

  • React
  • FontAwesome
  • TailwindCSS

For the backend:

  • Django
  • MongoDB

For the other libraries/APIs that make our features possible:

  • mido + pydub for MIDI and audio processing
  • GPT 4 text generation

Resources and organizations that made this whole thing possible:

  • Stackoverflow
  • Discord
  • Github
  • OpenAI
  • All the staff at CalHacks!

Challenges we ran into

It was a nightmare to figure out how to get GPT 4 to play music, but eventually, we figured out GPT 4 can generate a list of pitches and durations that string together to make a melody. This can perhaps be strung together to be a fully-fledged song with its own lyrics and voice cover (if we want to get ambitious), but we ran out of time.

Then, it became another nightmare to try to figure out how to send a sound file through HTTP Requests. It was only through a stroke of luck that we learned of Base64 encoding, which allows us to encode binary into a string and decode on the other side, ultimately bypassing the JSON format limitation.

Accomplishments that we're proud of

  • Getting everything done whilst running on <6 hours of sleep.
  • Grabbing lots of donuts

What we learned

  • How to use mido and pydub
  • How to encode and decode files to send them through HTTP Requests
  • Familiarity with React
  • Familiarity with the Django backend experience
  • Prompting and processing results from GPT 4

What's next for Melody Madness

If we had more time, we want to expand Melody Madness with a whole host of extended features:

  • Generate melodies that take inspiration from an uploaded music sample
  • Generate music by completing a short uploaded music sample
  • Generate music based on a given genre
  • Generate lyrics that take inspiration from a given artist's style (and match the music)
  • Generate covers based on inputted music sample

Oh, and also add pricing. That's pretty important if we want to keep the project going.

Built With

Share this project:

Updates