Music from your brain: Stanford students win Cal Hacks

Nov. 20, 2024, 12:51 a.m.

Sophia Zhang ’27, Justin Wu ’27 and two teammates won first place overall at Cal Hacks, the world’s largest collegiate hackathon, with a project on music generation from brainwaves.

Cal Hacks, hosted annually by UC Berkeley, gathered over 1,500 students this October and gave them 36 hours to create “something amazing,” according to the event’s website.

The team’s project, titled Duet, uses electroencephalography (EEG) technology from the company Emotiv to measure brainwaves and translate them into music. The project relies on machine learning to classify the brain’s various emotional states and create adaptive music that changes with your emotions. 

Prior to the hackathon, the team had never met in person. Wu and Zhang were friends, as were teammates Jiahui Jin, a junior at the University of British Columbia, and Wang, a junior who attends Western University. But they found each other on Slack and recognized their common interests. Collectively, the team had experience in competitive programming, video game development and brain-computer interface research. Wu and Zhang study computer science while Jin and Wang study business.

Jin had been working with EEGs before the hackathon and knew that she wanted to incorporate them into their project. The team took advantage of the many EEG startups located in San Francisco, reaching out to them before the hackathon to ask if they could use their devices for their project, with Emotiv ultimately agreeing. 

The team was inspired by existing research relying on music to read brainwaves but realized they did not see any projects attempting to do the reverse: creating music from brainwaves. 

“We wanted to see if we could revolutionize more traditional ideas and use the brainwaves themselves to generate music,” Wang explained. 

Both Wang and Wu are involved in performing and teaching music, and their experiences further informed the project.

“I’ve had the opportunity to teach students with learning disabilities and found that music was a unique way for people with nontraditional ways of communication to express themselves,” Wu said. 

The team dynamically allocated tasks based on individual strengths. While they did instantly connect and work well together, the team did encounter a few obstacles during the tournament, such as being almost unable to submit the project on time due to getting locked out. 

The team began on a rushed note. They were unable meet each other until 12 hours into their allocated project time due to conflicts with midterms and hectic flight schedules.

“We all barely slept, and in the middle of the hackathon, we went to this random apartment building, passed out on the floor and got kicked out by security,” Zhang recounted. “It was a really fun experience overall, though.”

Zhang was inspired by the “really high creative energy” that all the Cal Hacks participants exuded. Wu was similarly energized by “seeing everyone else working on their projects, which forced us to lock in on ours.” 

Jin was most excited to see everyone’s final project and to share her team’s work.

“Being able to explain in detail what we had been working on and seeing other people’s projects was so fulfilling,” Jin said. 

Cal Hacks offered $188,960 in prizes, with the first place overall winners awarded ​​Framework Laptops and special Major League Hacking Winner Pins. 

Wang enjoyed the creative spirit of all the participants in the hackathon. As someone not studying computer science, he said that he learned a lot from “seeing people building things they were genuinely passionate about.”

The team also provided advice for beginners who are interested in participating in a hackathon.

“Make something that you think is really cool, because if you think it’s really cool, it will show, and the judges will see it,” Zhang advised.

Wang suggested that people with all levels of coding experience would benefit from participating in a hackathon.

“If you’re hesitant to do a hackathon or think you can’t code, remember you can always learn and figure out how to do things, but if you don’t go to the hackathon, you’re losing out on opportunities where you can learn these skills,” Wang said.

Jin’s biggest takeaway from the entire experience is the importance of connection and openness to new ideas. 

“People are open to ideas,” Jin said. “If you’re creative and trying to make a difference, which is exactly how our project started, people will be open to hearing your thoughts.”

Aspen Singh writes for News. Contact the News section at news "at" stanforddaily.com.

Login or create an account