Dynamically generated heartbeat using ECG variables.

Max Birge's icon

Hello,

I’m a [medical] doctor working for a Cardiology and Immersive Technologies laboratory, and we have a project brewing for which I need some technical advice.

We’re interested in using data from a live ECG (electrocardiogram) recording as variables and want to explore effecting sounds with them. Initially, I want to dynamically control the sound of a heartbeat using variables derived from the processed ECG signal.

For example, we can use these variables to control the rate of the heartbeat, the amplitude and the spectrum of the sound. As I understand it, Max or Max for Live would be ideal for these purposes. Is this correct?

As a complete novice to these tools, however, I’m having a little trouble visualising exactly what we would need to do here and be very grateful is someone can fill in the missing pieces before we begin building. I will need to poll a local webserver on a box where the signal processing occurs to get access to the variables, and believe that this should be possible with javascript? I will also need a heartbeat sound to effect, and was thinking a square wave with filters/envelopes on would be a good enough place to begin. Does this sound sensible? I have distant but decent experience with ableton live, and am a capable programmer, but imagining how everything will fit together is where I am stumbling.

Thanks very much.

[Also posted on the reddit forum!]

janick's icon

Hi Max,

I'm working with Bitalino and i used the ECG and EMG with this device. But i'm work with the data of it, not with the sound of the heart.

On the other hand I did not really understand the chain of your project, why should you use a beat sound for the tests? why don't you use the data from your ECG system?
I think using the "peak" object in max can help you whether it's a sound or a piece of data. Is that i dot.
Then after it's possible to create a patch with Max 4 Live.
Stay connected to share our respective projects

Jajaturnta

Source Audio's icon

It would be helpful to precise what kind of input will be arriving into Max.
Audio ?
Some data over serial port ?
And what exactly should be the output ?
Audio again ? Or also some visual representation ?
In any case, I would go with Max and not Ableton,
it would just make stuff more complicated.

Aaron Pereira's icon

Hi, check this out.

https://www.janneysound.com/project/heartbeat/

We extensively use Max to filter out the raw heartbeat from an ECG machine and then do all sorts of things with it. Would be happy to help out if you have any questions.

Max Birge's icon

Hello,

Thanks for the replies [it was getting lonely here]. To summarise, at the moment i need to be able to connect to a websocket on a remote server where the signal processing takes place (i'm assuming Max will allow me to use Javascript for this) and subscribe to receive variables. In Max, i assume i will be able to generate a sine/square wave and apply effects to it, some of which will be dynamically generated by the variables recieved over websocket. The output is sound, later perhaps video.

We are aware of arduino based ECG (and other physiological sensors), but for now the quality of the signal and signal processing we do will not allow us to use it. I understand it would make life simpler as i can feed it into Max. We might try this later.

AARON, this looks intriguing. You're websites embedded links won't load (security) and prevent me from seeing most of the page. I'd like to understand your technical setup.


Aaron Pereira's icon

Sorry about the website not working right. We use a hospital grade G&E ECG machine for our performances and a wireless telemerty device to hook up to the performer, that's how we get the signal from the ECG machine into Max via an audio interface. The signal you do get in is very noisy as it not only picks up the heartbeat but also the contractions of all the muscles around the heart so we have some heavy filtration to get a clean signal which then drives a sample of a heartbeat.

You can definitely use a websocket to interface with Max and do all sorts of wizadry inside it. I'm based in the Boston area if you want I can show you how we run our setup.

Thomas's icon

Hi Aaron, i need to monitor the heart of 2 acrobats. But i don't find the good way to have the heart data. I tried AD8232 but it's not stable, to bad. I saw your videos, and it's very nice, very efficient. Do you have a specific model of ECG machine to indicate ?
Thomas