David Usher using the heart midi live
The final device fit into an Altoids tin, thanks to using an Arduino Nano, and a 9v battery instead of a Duemilanove and a bunch of AA's.
The design fit in an Altoids tin
While simple in principle, the tricky part is that the human heartbeat is actually fairly irregular. Instead of being like a pendulum that swings back and forth at a stable frequency, it is more like a series of events, spaced roughly the same time interval apart. The ear picks up this irregularity very quickly.
To make this work in an aesthetically pleasing way, it was necessary to smooth out the rate, but remain reasonably responsive to changes in heart rate. Simple linear filtering was not enough, and an adaptive algorithm had to be developed.
More details about the development are available in the blog posts, and the code is available on Github:https://github.com/str4w/HeartbeatMidi