We and a lot of our friends love coming up with tunes and lyrics, but it’s often difficult to get feedback on how well they might do in an actual song. Eric and I created MusicToMyEarz to make it easy for both non-songwriters and songwriters to quickly predict how well their ideas will do without having to go through the hassle of writing a whole song.
What We Learned
This was our first time programming machine learning models in a practical setting and it was super exciting learning about Pandas and Numpy and Scikit-learn. We’ve always wanted to make a machine learning project and we had a ton of fun learning about how to preprocess features and which models are good for what scenarios. We also learned about building web apps with Flask and CSS libraries, and we focused a lot on the aesthetics and user experience since artists themselves will be using the app.
How We Built It
Machine Learning: Used numpy and pandas to read in the data and perform preprocessing. Leveraged ML models, specifically RandomForestRegressor, from scikit-learn to predict popularity given a song’s properties. The Web App was built with Flask, HTML, and CSS libraries. User input is submitted to an HTML web form. Flask and Jinja2 template engine allowed user input to be converted into Python data structures. From here, the web app passes the data to the ML model for prediction.
Challenges We Faced
Persisting the model was a challenge. Initially, we did not know how to save the pretrained model and load it for prediction. The solution was to dump the RandomForestRegressor Python object to disk using joblib, loading the file to obtain the pretrained model, and running the model on the given input. This is much more time efficient than training the model from scratch every time the web app is run. Many issues with Git version control emerged, but were eventually resolved with much patience, hard work, and combing through Git documentation. Working virtually through Zoom proved to be much easier than we thought it would be, but it still posed challenges with regards to audio and computer lag. Demoing virtually was also a challenge because of the poor audio quality.
Best Art and Gaming Hack
Art and games are amazing because they allow you to briefly escape the world and roam around in a parallel universe created just for that moment. Our app helps songwriters see which of their ideas will touch the most people and how to tweak their music to better connect with their listeners. And for non-songwriters, MusicToMyEarz is not only an interesting way to see how song ideas might play out, but it’s also inspirational to potential artists that might never have dreamed of making a song. We hope our app will motivate all kinds of artists, whether they like singing in the shower or on the stage.
Best Domain Registered with Domain.com
We registered this domain with Domain.com: musictomyearz.space
Best User Experience Design
We put in a lot of effort in designing a UI that maximizes ease of use. The hallmark of the UI is in its intuitive design: dropdown menus for genres, elegant switches for modes (major/minor), slick sliders for numeric values, and aesthetic radio buttons for keys and time signature. Furthermore, the sliders make it super intuitive to adjust quantities -- song writers can easily test different values for features to maximize the popularity of their song.
Setup / Running
Install flask and run 'FLASK_APP=main.py FLASK_ENV=development flask run,' then go to ‘localhost:5000’ on a web browser to open the web app. To edit the code, you might want to install Numpy, Pandas, Scikit-learn, joblib
Dataset source: https://www.kaggle.com/zaheenhamidani/ultimate-spotify-tracks-dbDescription of Features: https://developer.spotify.com/documentation/web-api/reference/tracks/get-audio-features/
Try It out