← Back to list

I Spent Months Learning EEG for Fun. Here’s the First Thing I Built With It

For the past few months I’ve been quietly falling down an EEG rabbit hole — no grand plan, just curiosity. This week I finally got…

Satrio Wicaksono · 2026-07-19 07:01 · 0 claps · 1.8 min read
#eeg #bci #mental-state #python #brainwaves
Open on Medium ↗
Wiki topics: EDU · Education & Learning 🔧 · Data Engineering

I Spent Months Learning EEG for Fun. Here’s the First Thing I Built With It

For the past few months I’ve been quietly falling down an EEG rabbit hole — no grand plan, just curiosity. This week I finally got something working end to end, and I’m excited enough about it to write it up properly.

I’m calling the project BrainBeat. The concept: while I play, a compact 4-channel dry-electrode EEG headset picks up my brain activity, and a live overlay on stream shows my mental state in real time — calm or tense. There’s no performance involved here. Whatever the signal shows is what’s actually happening in my head at that moment.

The brain becomes the drummer

The more interesting part is what happens next: my mental state doesn’t just get displayed, it drives a generative drum track underneath the gameplay. When I’m relaxed, the engine lays down loose, unhurried brush-jazz drumming around 60 BPM. The moment tension creeps in, it shifts into faster, heavier “battle drums,” and the intensity keeps escalating the longer that tense state holds.

The clip I recorded is from a race in Forza Horizon 6 — you can watch the overlay flip from calm to tense right as the corners start getting hairy.

What’s actually running under the hood

  • A 4-channel dry-electrode EEG headset (256 Hz sampling) streaming over Bluetooth, with electrodes positioned across the forehead and temples
  • A Python pipeline running on a MacBook M4 Max: signal acquisition over LSL, band-power extraction (theta/alpha/beta) via BrainFlow, and a two-pass filter that specifically rejects jaw and facial-muscle noise — normally one of the biggest sources of false readings in frontal EEG
  • An adaptive threshold that calibrates itself to my own baseline in the first 60 seconds of each session, instead of relying on one-size-fits-all hardcoded values
  • FluidSynth generating the drums, with Flask-SocketIO streaming everything into a browser-based overlay built specifically for OBS

On the production side, the game runs on a separate gaming laptop, while the Mac handles all the EEG processing and audio generation. OBS pulls both feeds together into a single stream scene.

Still very early

I want to be upfront: this is a first pass, and there’s a long list of things I still want to refine. Right now the mental-state detection is threshold-based rather than a trained model — building an actual ML classifier is the next milestone.

That said, it works, it’s running live, and it’s genuinely one of the more fun things I’ve built in a while. More updates soon.


메타데이터
post_id
aadcd575e25b
slug
i-spent-months-learning-eeg-for-fun-heres-the-first-thing-i-built-with-it-aadcd575e25b
url
https://medium.com/@tio-satrio-wicaksono/i-spent-months-learning-eeg-for-fun-heres-the-first-thing-i-built-with-it-aadcd575e25b
canonical_url
https://medium.com/@tio-satrio-wicaksono/i-spent-months-learning-eeg-for-fun-heres-the-first-thing-i-built-with-it-aadcd575e25b
author_url
https://medium.com/@tio-satrio-wicaksono
status
ok
fetched_at
2026-07-27 22:11:43