mood sensing project

jimigringo's icon

Hi Guys,
I have been led to you via my university tutors for some help with my final year project.

My project consists of a pulse sensor that reads into the sound card of a computer via the microphone input, my plan is then to take the pulse rate in bpm and compare it to a list of songs to select a piece of music with a tempo equal or close to the pulse rate.

I have a program that will take the tempo of a list of songs imported into it and export the names of the songs and they're relative tempos (in bpm) in a standard .txt file.

basically, what I need is to write a program that will read this imput from my microphone based pulse sensor, I imagine some noise gateing will take place and setting this pulse as a form of click track, then the program will have to read the txt file to find the best suited song. I would like ideally for the program to play the track and then, once it is played, select the next song based on the current heart rate, but for the moment I will settle for it actually just suggesting the best suited song from the list.

I have been told that Max/MSP can help me do this but I really have no idea of how to go about it. Any help, methods or suggestions would be truely well appreciated,

Thanks,

Michael Sperone's icon

Hi,
It sounds like you're a complete newbie to max, so I'll suggest what I did when I first started Max, which was to go through the tutorials until I had enough knowledge to start working on what I wanted to do (it shouldn't take too long before you can get started on your own stuff, maybe even just an hour or 2).

Then when I got stuck, I either referred to the manual or did more tutorials... I think it was a very quick way to get started...

Also what helped was in the Max and MSP reference manuals there is a "thesaurus" at the end where you can look up keywords and there will be a short list of objects, and that helped me a lot as well.

But for a more direct answer to your question... you'll need to look into the adc~ object to get sound into Max, then some sort of trigger to convert that audio into a "bang" message, I've used the "change" object with some success, but I found it wasn't always accurate. If you look in the help files, in the bottom right corner there is always a list of related objects, so sometimes you can find an object better suited to your needs, or something that will help later.

Also max measures in milliseconds between each pulse, not in BPM, so you'll either have to do some math, or if you search on http://www.maxobjects.com and there is at least one external object that I know of that you can download that will convert ms to BPM for you ( I think it's actually called "mstoBPM").

good luck!
Michael

DonK's icon

Quote: mike@mikesperone.com wrote on Sun, 04 May 2008 08:58
----------------------------------------------------
> Also max measures in milliseconds between each pulse, not in BPM, so you'll either have to do some math, or if you search on http://www.maxobjects.com and there is at least one external object that I know of that you can download that will convert ms to BPM for you ( I think it's actually called "mstoBPM").
>
> good luck!
> Michael
----------------------------------------------------

The new "translate" object can do this and more conversions.

I don't know if it will help, but the new timing system with transport might be a way to get the pulse triggers (literally pulse triggers in this case) to "tap" out a BPM in transport? But that might open a whole new bag of worms in timing problems.

Peter Ostry's icon

jimigringo, the following does not answer your initial question but might be interesting for you:

Some years ago I experimented with heart beat to control the tempo of live playing musicians. The whole thing happened in a labor situation and I played myself and was not directly involved in the technical stuff. But we found out that the heartbeat is not enough to influence the "mood" of the music. At least it had no positive influence but qualifiying the result might not be part of your work. However, we experienced that musicians seem to adopt their heart beat (yes, they do) and their playing in a way that was counterproductive for the experiment. Sometimes we became unnecessarily fast and/or ended up with less groove than with independent playing.

This may depend on the musicians because everybody has his own way to establish a relationship between heart beat, musical tempo and interpretation. We added the measuring of skin resistance, finally what we used was basically a lie detector that controlled tempo, filters and dynamics.

I am also rather new to Max but I can assure you that the program can handle everything you need for your project, once you managed to get the signal into the computer. And it is definitely a perfect tool to experiment with the weight of different influences and their impact on music.

DonK's icon

It would be really cool if you could get use of an EEG machine to measure brainwaves (which would show more brain/emotion activity beyond heartrate) to use the performer's brainwaves as LFOs for all kinds of parameter control. Human oscillators/noise generators? Maybe that would be a good indication of emotional states? It would be interesting to use a sleeping person's dream state too. haha.

You could measure posture with even a Wii control. :)

If you are planning on taking things that far, I would look at some controllers too. Arduino, Makingthings, and Cycling has some in their store too.

How much time do you have before presentation?

marius.schebella's icon

yes, it is quite easy to create your own galvanic skin response sensor
and hook it up with an arduino... http://www.extremenxt.com/gsr.htm
the sensor will give you values for your "mood" which you could use
additionaly to your pulse mic.
marius.

Don K wrote:
> It would be really cool if you could get use of an EEG machine to measure brainwaves (which would show more brain/emotion activity beyond heartrate) to use the performer's brainwaves as LFOs for all kinds of parameter control. Human oscillators/noise generators? Maybe that would be a good indication of emotional states? It would be interesting to use a sleeping person's dream state too. haha.
>
> You could measure posture with even a Wii control. :)
>
> If you are planning on taking things that far, I would look at some controllers too. Arduino, Makingthings, and Cycling has some in their store too.
>
> How much time do you have before presentation?
>
>
> --
> -DonK
>