Inspiration

Every musician knows the feeling of a melody popping into your head when you can’t tell if you wrote it or just remembered it. Apps like hum-to-search tell you what a song is, but they don’t tell you if your idea is yours or help you write something new. I wanted to build a tool on the artist’s side that protects originality instead of replacing artists.

What it does

Melodex lets you hum, sing, or tap a melody on an on-screen piano, and it tells you if that melody matches a known song, in any key and at any tempo. Its Explore mode writes new melodies with chords. You can pick a vibe like happy, sad, or jazzy, or describe a mood in your own words and let Gemini choose the settings. You can also pick the key, the instruments, and the volume of each part. Every new idea is checked against our index, and anything too close to a known song is thrown out.

How I built it

The backend uses Python, FastAPI, and NumPy, and the frontend uses React, Vite, and Tone.js for the instruments. I wrote the pitch detection from scratch along with claude with the YIN algorithm. Melodies are matched by their intervals and rhythm, so key and tempo don’t matter. Each vibe has its own songwriting rules, and the Gemini API turns your words into musical settings.

Challenges I ran into

My tests passed on fake data, but my real humming only got 0 out of 4 right at first. I analyzed my own recordings and fixed each problem until it got 9 out of 9. Windows also blocked SciPy, so I rewrote the audio processing in plain NumPy.

Accomplishments that I’m proud of

I’m proud that it recognizes my real humming, that I built the pitch detection and search from scratch, and that it throws away its own ideas when they sound too familiar. I also built it solo as a freshman in one weekend.

What I learned

I learned how pitch detection and melody matching work, and since this is my first ever personal project, I also learned how to link my backend and frontend together to create something real for the first time.

What’s next for Melodex

Next, I want a much bigger song library, better pitch tracking, MIDI export for music software, and a “check my song” mode for songwriters before they release.

Built With

Share this project:

Updates

Submission history