Its 2020 and entirely possible to control synthesizers with your thoughts, so of course its entirely possible to sync your synthesizers with your heart pulse (and for only ~$50 of hardware). This repository contains the code and instructions to hook your blood to your music.
This system is really simple and will work with basically any modern electronic instrument (as long as it has MIDI). Here's a little schematic:
A finger is connected to a pulse sensor. The pulse sensor is connected to an Arduino. The Arduino can detect a pulse and send serial data to a computer. The computer runs a server that reads the serial data which updates a web page. The web page uses Web MIDI to send out the MIDI clock to all connected synths! Music ensues.
Here's a demo of me playing with three instruments sequenced to the tempo from my heart rate:
The following instructions will give you a more detailed instruction.
You'll be able to get started with ~$50 of equipment, plus computer and MIDI instrument.
- Arduino ($23)
- Pulse sensor ($25)
- Audio isolator (optional, $9)
- Synthesizer with MIDI (basically *any* synthesizer made in the last 10 years)
- Computer
You can clone the code from Github or you can download it directly.
Simply attach a pulse sensor to the Arduino, plugging the data channel into A0
.
Now use the Arduino IDE to upload the heartbeat.ino
. Once that is uploaded, you can keep the Arduino connected and move on to the software.
First make sure you have Go installed on your computer You can download Go here. Now you can go into the heartbpm
code and simply run in a terminal:
$ go build -v
Now you'll have an executable heartbpm
in that directory. You can simply run it with
$ ./heartbpm --com COMPORT
[info] 2020/06/13 07:48:06 listening on :8054
Make sure you find your COMPORT
. The easiest way to find your com port is to look at it from the Arduino IDE.
Now, connect the pulse sensor to your finger and open a Chrome web browser to http://localhost:8054. You should be able to see some data coming out. Note: this only works with Chrome and Opera web browsers since they have Web MIDI implementations.
Attach your electronic instrument via MIDI to your computer. Most modern synthesizers have USB which doubles as a MIDI connection, so just connect by USB!
Connect your finger to the pulse sensor and then reload the web page. The web page will automatically detect the synthesizers and you can see which ones are attached.
Your average heart rate will be detected and sent to the electronic instruments as the clock. The website is getting the averaged pulse data calculated BPM from the server. This BPM is used to send MIDI clock signals every 1/24th of a quarter note, which is the standard for setting tempos on devices.
- If you are having trouble getting your pulse connected, try moving the pulse sensor just a little bit along your finger (1/8"). Sometimes if its not over your vein it will be harder to detect. Once its in the right spot it will stay there nicely, though!
- If you are getting background noise its because the synthesizers are powered off your computer which (unless is battery operated) tends to have a noisy power supply. I highly recommend getting an audio isolator to remove this noise.
Hope this is useful for you, and hope you can create something new! If you are interested in the music I've created, check out my Bandcamp or just search infinite digits
on any streaming platform.
MIT