Creating Music with Brainwaves

Ashley Peng
3 min readAug 21, 2022
brain animation

Introduction

Music is an integral part of our society today. On social media, each post is expertly matched with a soundtrack. When you go to your local coffee shop, soft morning music wafts through the air. When you turn on your TV to watch the news, you can hear the familiar chime of NBC as newscasters declare the weather.

Wherever you go, there’s always a tune to match the ambience. Even something as simple as a nursery rhyme can bring us back to a time and place from long ago. It can also have positive impacts psychologically, with many studies showing that music can have a calming effect on the listener. Connected with the brain, we can make an even bigger impact!

I decided to work on a project that would connect your brainwaves to a computer and make music out of it! Here’s a rundown of my thoughts, processes, and takeaways of this project, and the potential uses for neurotech.

screenshot of code from GitHub

Project

For this project, I used nothing except for a laptop in order to be successful. However, you can configure the code to run with a BCI, or Brain-Computer Interface.

A Brain-Computer Interface is a type of technology that connects your brain to technology, like a computer. This tech uses your brainwaves as the main source of commands, and can be used in a multitude of ways. (Read more about BCI’s in my article here.)

In the project, I used code from GitHub (linked here) to be able to create the music. (You can read the creator’s article on the code here.)

brainflow logo

The code has several libraries, the most prominent being BrainFlow. This library allows you to use brainwave data in your code for different BCI projects! When using a synthetic board, the code generates artificial brainwaves that are inputted to produce the end product. Hence the reason why I was able to do this project without the use of any device other than my computer. The program then processes the data and outputs a file of brainwave music!

Personal Takeaways

The first couple of times I attempted to complete this project, something always seemed to go awry; a term couldn’t be defined, or there was always some error in the code. Needless to say, I spent a very long time trying to figure out exactly what was wrong. Biggest lesson: check what versions of libraries you’re using! Everything that wasn’t going the way it should be was simply from my using an updated version of BrainFlow. Sure enough, my problems were resolved from simply downloading an older version.

futuristic image

Looking Into the Future

The fact that we can even connect our brains to computers is a testament to a bright future ahead. Brain-Computer Interfaces can be utilized to aid people in their daily lives, and this project only shows an opportunity to aid the world by providing a way to create music, which can help with mindfulness and productivity. We may even be able to expand this field into a collaborative space where people can post their brain-music!

--

--

Ashley Peng

Teen working to integrate people with technology.