Heart rate into BPM for project

Julian Woods's icon

I'm new to Max having just been suggested from a friend that it'd be the best program to use for my project in which I'd like to control the bpm of a music track with my heart rate - I'll be cycling on rollers for six hours trying to maintain a heart rate of 128bpm. So far I've thought that the best way to do this would be to use my Garmin ANT+ HRM with and connect it to my PC via ANT+ USB dongle then get the output data (from HRM) into MAX...

I've tried using the 'serial' and 'hi' as my friend suggested but to no success. I thought it makes sense it didn't work considering it's not really using a serial port, and I can't find any on my PC. Thought I'd try find if there's any virtual serial ports I could use... no success. Now I'm thinking there must be a way to use the ANT+ device profile of the HRM device (found https://www.thisisant.com/developer/ant-plus/device-profiles and on the download of SimulANT+ you need to sign up which is free) which is in Python code, so I could implement the device into MAX. I'm sure someone out there must've used an ANT+ device to put a live feed into MAX... Can anyone please help?

truthc's icon

Hi Julian,

When I was looking for beat detection methods I found the "onset" and then "beat~, bonk~ and op.beatitude~".

Then I found this thread on "onset" and some help from being given a patch.

I still haven't tried externals though, which is what the the others appears to be. IMO, I'd be convenient if they were built into the package manager. I'm also curious as to which methods work best for heartbeat detection because if I ever get something for that I'd like to try it.

(FYI, still new to Max)

Julian Woods's icon

Hi Truthhc
Thanks for the tips on bpm and beat direction for the music track, that's definitely helpful. But unfortunately I'm not at that stage of the project yet as I still need MAX to read the data from my HRM. I think I should rewrite/repost to ask about ANT+ input into MAX...

truthc's icon

Hi Julian,

Good idea. Sometimes people respond better to specifics.

I can sympathize. I tried getting the Steam Controller to show as an "hi" object but didn't have any luck. My next strategy was to find an OSC or MIDI software that recognized it but didn't find any.

Have you tried searching for alternative methods to relay MIDI or OSC, etc., into Max/MSP? I just learned that Ant+ is a separate protocol, so even though I found some search results for Heart Rate Monitor OSC, https://github.com/trentbrooks/HeartRateOSC ,it only supports bluetooth. I looked at Neuromore Studio too but it only currently shows one HRM device listed as supported ( bluetooth) http://www.neuromore.com/neuromore-studio/ .

So no, I didn't have any luck searching but I found an interesting blog post involving a heart rate monitor.
http://www.sefrijn.nl/projects/immersion/

Julian Woods's icon

Oh, that's strange I thought that a Steam Controller definitely would work with 'HI'. Good idea RE MIDI or OSC - I may have a look at those.

Yeah I often find Bluetooth is the supported way for most software... I will be working on this more with some people I know more than me at programming so hopefully I'll find a way. I and a friend of mine were looking at creating a virtual serial port for the ANT+, I just need to know interface ANT+ uses, or if it has a serial interface supplied by the software.

That looks cool! Thanks for the link - intense patch in MAX!!!

Blair Z's icon

Hey Guys, Any update on this? ?

I am using the HeartRateOSC https://github.com/trentbrooks/HeartRateOSC and managed to get my hands on a Mio Alpha 2 which was working.. but now it has randomly stopped...

Has anyone else had this experience? I had tested it got it triggering some things to take to an event to show off and it stopped working the night before... no apparent reason..

the watch was still displaying HR. And in the app it finds and then reads that the watch exists in the drop down. But then just gets stuck at scanning.... not sure what changed.. maybe interference with the BLE. I have debugged my mac's bluetooth, factory reset the watch and have managed to get the watch streaming to 'Map My Run app' on my iphone... BUT it still doesnt seem to want to connect to the HeartRateOSX app..

Very strange... trying to find a work around... Any help much appreciated..