Drw wave with serial data from Ardino, analyse with Max/msp

I aim to measure heart rates through the arduino using an infra red led and a IR phototransistor to detect the pulse in my finger. This creates a data list in the serial window. From there i need to transform the data into a visually identifiable wave form using processing, send the wave to Max/ Msp which can analyse the waves for peaks and troughs, and then control the speed of a captured sound file of waves crashing against the beach using the frequency of the heart beat. There is 10 days to do this. I am sort of hoping that its not quite as difficult as it sounds. I have discovered pachube. Any help or advice would be gold dust, thanks everyone.

nice project, it is more or less exactly what I did, although I used synthesis to create the waves instead of a .wav and using vbap to spatialize the sound.
I’m not sure why you want to include processing and not take the whole thing into max though.
just ask if you need more help

Attachments:

what I suggest is that you take a look at the icubeX website (http://infusionsystems.com/catalog/), they have heartbeat sensors that fit their system (but they fit arduino’s too). In any case are they normal adc sensors with a 0-1024 scale.

Hi. the heart rate monitor is a little out of my budget. Its good to struggle though as its an educational project. I have previously installed the maxuino library but im really sweating it trying to see the bigger picture of how to bring things together. My heart rate monitor does scale between 0- 1024 though. My previous patch above was the wrong one, here is the one im using to collect serial data.

This paart of the project is now up and running. Thanks brendan for that link. The serial data from the arduino can now be indeed be translated into a graph using the the patch found at http://arduino.cc/en/Tutorial/Graph. I am now looking to analyse the graph for peaks and use this to drive the speed of a sound file (containing the sound of waves hitting the beach) within the Max/ Msp patch. My project will be completed and handed into university by the 17th and I will publish my entire project on the forum. Its only a creative beginners project but hopefully someone may find something of interest. In the mean time, anyone who can help us with the task in hand please add a post. Thanks to everyone on the forum, your all stars

"I am now looking to analyse the graph for peaks and use this to drive the speed of a sound file (containing the sound of waves hitting the beach) within the Max/ Msp patch"

Is this the remaining task you need help with? How do you wish to apply the data peaks, as a discrete trigger or continuous control value?

Here is a quick mock-up of how to evaluate peaks, and extract control data for playback speed; there are better (more aesthetic) ways to do this, this is a demo of the kind of thing you can easily do in Max:

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.

Hey Brendan, in response to your post,"discrete trigger or continuous control value"; i'm not entirely sure. I'm thinking it would be a discrete trigger as I am using a prerecorded audio file. Ive taking some screen shots to show you what i have been up to. My first problem has been the graph patches interpretation of the wave. The serial data enters the patch as two values; the raw value and the value (check arduino sketch, 5th post). This is separated by a delimiter(,). Pic 1 shows how a used a 2 axis graph to display the heart beat using a spread sheet.
This led me to look at max basics tutorials, Data 2. I was trying to incorporate the part of the patch showing in pic2 so that the patch could read the .wav file and display it to the full potential in the graph by using the Peak and Trough objects to Analyse the beats range of values, adapting the graph to only show the minimum and maximum values ignoring those out of range. This would let me see what was going on better.
Pic 3 shows how i have added your patch which is working with the audio file, I'm so happy. I guess I just need to adjust the button argument values which are triggered to control the rate. Is that what the patch is doing? I really need to fix my graph readings. This is a massive help. I think ones I fix my incoming serial data for the graph and make a few tweaks to the values I will be up and running with this. Having thought this through discrete values would be fine.
thanks Brendan for all your help

Attachments:

sorry about this, patch one seems to be crashing my computer as i pasted some patches together without thinking and Im getting some sort of conflict disabling my keyboard and stalling Max. Don’t open it, thanks

Attachments:

Im looking at 3 things at the moment. 1.Is the multislider capable of displaying this data
2. are the two values in each line in the serial data x, Y coordinates
3. How can I change the patch to recognise two values in the same line separated by the delimiter (,), and how can I graph them

This makes the input compatible with the MAx/Msp patch which expects one value per line. Ive figured there was no need for the other printed values. I keep the raw value and it seems to be working to some degree of success although further calibration of the alpha value is needed. Hope I dont get into trouble for posting to much here, lol, its turning into a blogg

Hi, the problem im facing is that the out put from the multislider is measuring the peak amplitude of the waves while I need to measure the frequency. Does anyone know how I could approach this dilemma? Im sure there has to be something in MSP, some sort of counter

Interesting thread. I know the initial call was a few months ago now, but this is a recurring area on this forum, so I thought I’d share my own recent work, using Pulse Oximenters with Arduino FIO, Xbee etc.

The sensors are connected to two Arduino FIO’s, and this data is transmitted to my Mac using XBee based Zigbee wireless connection. The Max patch includes the Arduino code for both the Breath sensor and Pulse sensor (they are different!).

I use the "dot.schmitt" schmitt trigger object by Joseph Malloch, Stephen Sinclair, and Marlon Schumacher, to determine beats and inter beat intervals, then extract various parameters from there…

I’m still looking for help to implement Frequency Domain (LOMB) analysis of the heart RATE variations… any suggestions?

Hope its useful to other exploring this area. Always happy to discuss issues, opportunities etc.