Inspiration

One of the important concepts that gets brought up when doing creative work is the idea of the "Flow State", or "being in the zone". It is the the point when you lose yourself within what you're doing, fully engaged. The key to entering this state is to operate in a goldilocks zone of optimum difficulty, and the quickest way to get out of this state is encountering a block, when you begin to feel self conscious about what you're doing.
When it comes to rap freestyling, this block comes very often. In real time, you have to come with line after line, and this skill is not something that come naturally to most people. You run out of things to say, you feel like you don't have anything say, and you get stuck. What if we could solves this by giving you a well of ideas and suggestions that adapts to what you're saying in real-time?
What it does
RapFlow helps you never run out of ideas in your freestyles by transcribing your rapping live in real-time, and sending your rhymes to GPT-3 to have it generate responses. When you click start, a beat-plays and you freestyle. Your raps are automatically transcribed and a constantly updating suggestion box is presented. It is merely a suggestion box you can pull from. Either use it to inspire your next line or rap from it verbatim to have GPT-3 continuously generate new lines for you.
How we built it
The project is built with React and styled with Tailwind. Real-time transcription is provided by AssemblyAI's streaming transcription through a WebSocket. Music is generated through ToneJS, a Web Audio framework for creating interactive music in the browser. The transcription is automatically sorted into their respective lines by each word's start time and matching it into the correct measure which is tracked by ToneJS.
The last two lines you rap are being sent to the OpenAI API on state updates, and then rendered into an AI suggestion box.
Challenges we ran into
The hardest part was sorting each word into their respective measures, a deceptively challenging task. Since AssemblyAI's streaming can retroactively update responses to correct previous words, each line has to be calculated upon each render, which was a tough React state management task.
Accomplishments that we're proud of
This is my first Hackathon, and I'm extremely proud of how it turned out. This was a non-stop 36 hour burst of coding which I have never done before. I am also extremely grateful to my mentor, who has been extremely helpful through the entire process, helping me debug tricky points and helping me see problems in new ways.
What we learned
What's next for Rap Flow
So many places to go from here:
- Building out the music generation to allow for different styles of beats and customizable bpm and instrument selection.
- Option for user to automatically integrate AI suggestions, or quickly generate a new suggestion
Built With
- assemblyai
- openai
- react
- tonejs
Log in or sign up for Devpost to join the conversation.