MobMuPlat icon indicating copy to clipboard operation
MobMuPlat copied to clipboard

wishlist: bluetooth support

Open umlaeute opened this issue 7 years ago • 5 comments

it would be very nice if there was support for communicating with bluetooth devices.

i'm specifically interested in general purpose communication (which boils down to using bluetooth's serial port profile).

the basic idea is

  • to have another option-page bluetooth where you could chose a paired device.
  • to have another global send/receive pair toBluetooth (resp. fromBluetooth) that just dumps the raw data.

umlaeute avatar Mar 30 '17 10:03 umlaeute

i'm aware that this opens another can of worms if you want to transmit data in a higher-level protocol (e.g. OSC), given that there is no built-in SLIP encode/decoder in Pd.

umlaeute avatar Mar 30 '17 10:03 umlaeute

Hi, I’d really like to help work on this! I’m really green to mobile development, but I’d love to learn how to tackle this.

Even without higher level support, what’s really in the way of adding Bluetooth support? I’m assuming the audio api in use for streaming other Bluetooth mics (say, for hands-free and conference calls) isn’t suitable here, but I’m not sure.

Pinjontall94 avatar Jan 05 '20 23:01 Pinjontall94

There's a few layers here a) 'default' audio device behavior, i.e. using a BT audio device as audio input/output. b) receiving canonical transport controls and/or keyboard strikes from a BT input device c) lower-level bluetooth support, i.e. sending arbitrary device-specific messages programatically

(I believe @umlaeute is referring to c) above.)

For a) default audio input/output should work, at least on iOS. Go to the audio settings page and hit the device selector button. On Android, when you connect to a BT speaker, that should become the default audio output. I've not tried either platform for Bluetooth audio input, let me know what you find.

b) is partially implemented on iOS I think, in that BT keyboard strikes should be picked up by the 'key' object. I'm not sure if it's implemented in Android (file a bug if not). For transport controls (i.e. play/pause/etc), you'll have to connect to platform-specific APIs (i.e. MPRemoteCommandCenter on iOS) to register for them and then pipe them into MobMuPlat/PureData. I did this type of work for this Flutter audio plugin, look for 'supported media actions' in both the iOS and Android implementations: https://github.com/google/flutter.plugins/tree/master/packages/audiofileplayer

c) is the most involved; you'll need to implement some API to take a message from Pd and pipe it into a platform-specific library, i.e. CoreBluetooth on iOS.

Feel free to respond here with your desired use case if you want more pointers on how to move forward.

monkeyswarm avatar Jan 05 '20 23:01 monkeyswarm

indeed i was referring to "c)". at least iirc, it's been a long time :-)

umlaeute avatar Jan 07 '20 13:01 umlaeute

I would be really interested in having bluetooth support for MobMuplat. I found an app called Blexar that does the job. https://apps.apple.com/us/app/blexar/id1439459314 It would be really cool to being able to send kind that of low level messages!

pagarreton avatar Mar 21 '20 16:03 pagarreton