Inspiration

Sometimes it's hard to find music that matches your exact mood. So we created spotivibe, a web application that generates a playlist of songs for you based on any prompt you provide.

What it does

Type in a prompt (it can be anything!) and wait for an awesome playlist to be generated.

How we built it

We built a React app with Next.js. User input is parsed and passed as a specially-formatted prompt into OpenAI's text-davinci-003, the output of which is reformatted and displayed on the page. We also spent much of our time focusing on the design and overall appearance of the web application, hence Procreate, Figma, and CSS were essential to our process.

Challenges we ran into

Under the free plan, OpenAI’s text-davinci-003 can only process a max of 4,000 tokens (~2,930 words) per request. This limitation meant that our prompt to train the model had to be short, and only one song could be suggested at a time. The latter issue was somewhat addressed by using a for loop to repeatedly query and filter out duplicates, though asking for more than 5 songs resulted in errors as the token limit would be exceeded. We had some difficulties adapting particles.js for a React app at first, but were able to solve this by switching to a npm library.

Accomplishments that we're proud of

The design! All fish were hand-drawn and animated :) We are also proud that we were able to successfully query OpenAI's text-davinci-003 and nicely format the results.

What we learned

Ideation is hard. Responsive design is hard (shoutout to designers, y'all saving us!). It was cool learning more about React and getting the chance to work with Next.js. We've also never worked with OpenAI before so learning how to use the models was a fun challenge!

What's next for spotivibe

An initial goal for this project was to pass OpenAI's output into the Spotify API to generate a playlist that users can directly save to their Spotify accounts. Unfortunately, we ran out of time to implement this, but we hope to work on this as well as more social features, like a discussion board where users can share songs and playlists, in the future!

Built With

Share this project:

Updates