Heartbeat metronome.
Using my heart beat to control the tempo.

Using my heart beat to control the tempo.
Yes, its 2020 and entirely possible to control synthesizers with your thoughts, so of course its entirely possible to control your synthesizers with your pulse. In fact, its entirely possible to control your synthesizers with your heart rate with only ~$50 of equipment.
“Why?”, you ask? I don’t know. Why not? It would make dadas proud. Also, who says that a tempo needs to be fixed, lets make things more dynamic. Lets make the music that flows in your blood!
The code is here: https://github.com/schollz/heartbpm
Here’s a video of me using my heart rate to control three synthesizers.
Although you can do this with almost any synthesizer (more on that below), for this I’m using the Roland SH01a, and the Teenage Engineering OP-1 and Pocket Operator PO-33. Luckily my pulse rate averaged around 80 BPM which is what I would like for this particular song.
The system is really simple. Here’s a little schematic:
Connect a pulse sensor to your finger. 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!
The following instructions will give you a more detailed instruction.
First get the code. You can clone from Github or you can download it directly.
First you can set up the pulse sensor. Simply attach the pulsesensor to the arduino.
Now use the
Arduino IDE to upload the heartbeat.ino
:
int pulseSensorPurplePin = 0;
int signal;
int Threshold = 550;
int counter = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
signal = analogRead(pulseSensorPurplePin);
Serial.println(signal);
if (signal > Threshold && counter == 0) {
Serial.println("b");
counter = 1;
}
if (counter == 1 && signal < Threshold) {
counter = 0;
}
delay(10);
}
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 (download
on my Github) 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 web browser to http://localhost:8054. You should be able to see some data coming out.
To get it working with synthesizers, just attach your synthesizer via MIDI USB to your computer. Most modern synthesizers have USB which doubles as a MIDI connection. The website will automatically detect the synthesizers, so just attach them and reload the page. Then you will see which ones are attached.
The website is getting the averaged pulse data calculated BPM. 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.
That’s it! I mentioned it was simple ;)
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.