Bluetooth I/O with MAX/MSP, so close, yet so far ...

Debra Peri's icon

Debra Peri

10月 12 2019 | 4:06 午前

Hello all,

I've read through a number of posts regarding using Bluetooth for communication with MAX/MSP, I haven't seen any definitive answers posted yet but found a few tidbits that seemed to indicate success, yet, it's not working. Attached are 2 screen shots, first one shows the mac can successfully connect to the device, subscribes to it's services, can read/write commands.

The second screen shot shows the MAX/MSP setup I cobbled together from one of the forum posts. It appears there's a connection but doesn't behave as such. As you can see in the max console the serial object reports an incoming bluetooth interface (but no outgoing) and it reports that it's written the message, but the message is never received by the device. Sending an "open" message to the serial object doesn't result in a connection of a status message, it doesn't seem to have the correct message set, e.g. scan, connect, pair, trust, read/write, disconnect, etc. that is a normal part of communicating with a bluetooth interface.

I have written python and C code for the raspberry pi micros and linux workstations to use bluetooth so I know these protocols well. Having this capability in MAX/MSP seems to me to be essential considering how many devices are capable of communicating via bluetooth.

Please help us Cycling '74!


Yours truly,
Debra Peri

Bluetooth connection with the device, works as expected.

MAX/MSP rig to test bluetooth.

enki's icon

enki

2月 13 2021 | 11:04 午後

Hey Debra,

I saw your post about Muse with OSC,Thank you for that. I've got a Muse1. Is a Raspberry Pi needed to capture the data in MaxMSP that Muse Monitor is outputting from the phone?

Debra Peri's icon

Debra Peri

5月 19 2021 | 9:07 午後

Hi Enki,

Sorry for the long delay.

To answer your question, no, a raspberry pi is not needed. Since Muse Monitor streams OSC over wifi you can connect to that stream in Max using the udp-receive operator. I implemented a system to capture Muse data via bluetooth so I wasn't tied to a cell phone and paying for Muse Monitor licenses. Plus I can do many more things with the raspberry pi that makes the whole system far more flexible for my needs.

This is a demo from last year of the interface I've created in Max for Muse (and other devices) EEG data. I stopped working on it because of the pandemic but plan to continue later this summer.


Take care,
Debra

Debra Peri's icon

Debra Peri

5月 19 2021 | 9:18 午後

Here's another demo, I forgot how far along I had worked on this project.

This is the part of the system that generates MIDI from the EEG signals based on various rules.

https://www.youtube.com/watch?v=EYb2XV30Y_s

And this shows using the raspberry pi to control an RGB LED display. I now use a HDMI connection to drive a video display vs. the RGB LED which is expensive and the performance is lacking (specifically synchronizing the display with the raspberry pi).