Inspiration
We’ve all had the intuition that the music we listen to can affect our heart rate, whether its getting us excited or calming us down, and at least one scientific study has found some evidence to confirm this suspicion. There is even some evidence that we may match heartbeats with our partners when we’re near them.
With this in mind I attempted to create a prototype to play a melody with the goal of encouraging the user to raise or lower their heart rate to match a target.
Setup
The program measures time between beats and translates that into a BPM measurement. This measurement is averaged with the target to create a match beat halfway between the target and measured BPM. As the rates converge the music plays in time with the heart beats of the user.
Beat measurements are simulated with a pushbutton, and a modulated sound output plays an F6 arpeggio at the match rate. F6 was chosen from experience to work well both as an uplifting and calming chord for either raising or lowering heart rate.
Demo
Tech Stuff
The circuit is pretty basic. A button pulls down pin 3 to trigger an interrupt which calculates the time since the last interrupt to measure current heart rate (this represents a heart monitor). Audio output is on pin 13 (with a 100Ω resistor in series), and the onboard RGB LED cycles along with each note in the sequence.
Code and wiring: BeatMaker.zip