BLE MIDI Peripheral mode?

852 views
Skip to first unread message

Andreas Grässer

unread,
Sep 23, 2016, 2:03:03 PM9/23/16
to android-midi
Is there any way to set up the "MIDI peripheral port/mode" over Bluetooth LE?
I mean by using the Android M (or higher) MIDI API, not by factually writing an own custom driver.
Thanks in advance

Phil Burk

unread,
Sep 23, 2016, 2:20:52 PM9/23/16
to android-midi
I'm sorry. I don't understand your question.

Are you referring to BLE connection interval and supervisor latency?

Phil Burk

--
You received this message because you are subscribed to the Google Groups "android-midi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-midi+unsubscribe@googlegroups.com.
To post to this group, send email to androi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-midi/13eeb5cf-72d3-4031-ada5-5e8b0bceec96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andreas Grässer

unread,
Sep 23, 2016, 5:00:33 PM9/23/16
to android-midi
The idea is to sync 2 devices over MIDI without the cabling headache.

What I mean is to run an android app as a Bluetooth MIDI service, so that another device can connect to it. 
Similar to the USB connect option which lets you connect an android app to a pc or mac as a MIDI extender.

As far as I see google's Android MIDI API does not offer such a mode for the Bluetooth part. But maybe I'm missing something,


On Friday, September 23, 2016 at 8:20:52 PM UTC+2, Phil Burk wrote:
I'm sorry. I don't understand your question.

Are you referring to BLE connection interval and supervisor latency?

Phil Burk
On Fri, Sep 23, 2016 at 11:03 AM, Andreas Grässer <grae...@gmail.com> wrote:
Is there any way to set up the "MIDI peripheral port/mode" over Bluetooth LE?
I mean by using the Android M (or higher) MIDI API, not by factually writing an own custom driver.
Thanks in advance

--
You received this message because you are subscribed to the Google Groups "android-midi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-midi...@googlegroups.com.

Phil Burk

unread,
Sep 23, 2016, 6:58:37 PM9/23/16
to android-midi
I understand now.

Sorry. We do not support having Android act as a BLE MIDI peripheral.
Nice idea. I added it as a feature request for some future version.

Phil Burk


To unsubscribe from this group and stop receiving emails from it, send an email to android-midi+unsubscribe@googlegroups.com.

To post to this group, send email to androi...@googlegroups.com.

Andreas Grässer

unread,
Sep 24, 2016, 5:02:45 AM9/24/16
to android-midi
Hi Phil
Thanks a lot for the lightning fast response.
And thanks for adding it as a feature request.

It would be really useful to connect multiple Android devices over BLE MIDI. This is one of the most requested features by my users.

Andreas

Александр Фандорин

unread,
Jan 9, 2017, 5:01:28 PM1/9/17
to android-midi
I'm also interested is this feature. I want to use my MIDI controller, connected to my Android phone via USB-OTG as a wireless bluetooth device for synths that are installed on my iPad.
If this could be possible, I might use TouchDAW app to make a connection between Android phone and iPad. TouchDAW already supports MIDI relay function between two midi ports. The problem is that it can't advertise itself or the device as BLE MIDI device.
I'm wondering, what do you mean by "some future version", Phil? Future version of what? Android? How long would it take to implement this? What should I update to use this functionality, when it will be available? How will I know that it was added?
It's sad that I can you iPad as a bluetooth midi controller for my Android phone, but not vice versa, since iOS devices have much more interesting music software than Android.

суббота, 24 сентября 2016 г., 1:58:37 UTC+3 пользователь Phil Burk написал:

Phil Burk

unread,
Jan 9, 2017, 6:01:51 PM1/9/17
to android-midi
Hello,

I agree that this would be a very nice feature.

> I'm wondering, what do you mean by "some future version", Phil? Future version of what? Android?

Yes. It will appear in a future version of Android. I can't predict which release it will be a part of. We have to consider the priorities of other audio/MIDI features. We are mainly focused right now on audio performance and latency.

> How long would it take to implement this? 

I don't know. it could be awhile. But we are typing as fast as we can. ;-)

> What should I update to use this functionality, when it will be available?

It will first become available in an Android Preview Release. As a developer, you could download the SDK and experiment with it.

It will become available on user's phones when they get an OS update from their carrier.

> How will I know that it was added?

We will post an announcement on this group. And it will appear in an Android release note.

Thanks,
Phil Burk


To unsubscribe from this group and stop receiving emails from it, send an email to android-midi+unsubscribe@googlegroups.com.

To post to this group, send email to androi...@googlegroups.com.

mario...@gmail.com

unread,
Mar 23, 2019, 7:39:38 AM3/23/19
to android-midi
Hi

I agree with you, it would be a fantastic feature for the whole Android MIDI eco system.

I have just written one, a simple poc where I send MIDI messages from a tablet (acting as a peripheral) to a phone (Running MIDI+BTLE and Midi-Scope).

There are 2 ways of doing it I think

1) the neat one: provided by the system whereby upon establishing the connection with the client, on the peripheral side a new MIDI Device is created. This would as well allow sharing all the code already written to encode / decode the packets by the 2 sides which are almost the mirror image of one another. But you will have to wait a long time to actually see this

2) the easy one (the one I have partially written). Create an app, whcih advertises a midi service (with 2 ports). The app implements the bluetooth layer and writes and reads from the service. The service would actually be operational only when the bluetooth is connected, but would otherwise be always there (a bit like MidiScope)

I am going to polish my app and make it behave as 2)

mario...@gmail.com

unread,
Mar 29, 2019, 4:42:38 PM3/29/19
to android-midi
If anybody is interested this is partially 2)


What is not clean is that it should be extracted from there and turn it into a standalone app doing only this.

Andrea

Phil Burk

unread,
Mar 29, 2019, 4:54:15 PM3/29/19
to android-midi
If I understand correctly, you have implemented a Bluetooth MIDI Peripheral mode entirely within the application and provided it as a MIDI service to other apps. Is that right?
If so, that's pretty cool. That would allow an Android app to drive a laptop using BLE-MIDI.

Phil Burk

mario...@gmail.com

unread,
Mar 30, 2019, 5:02:01 AM3/30/19
to android-midi
Almost

I have not exposed it to other apps via a MIDI service yet, I was consuming the stream inside the same app.

A few things to fix / improve

1) Works with other Android devices.
2) iOS can connect but for some reason every connection creates a new Bluetooth device (in the iOS list) and I ended up having dozens of devices only one of them actually working. It is like the ID advertised is always different. not sure.
3) Some care needs to taken about the call to myPacketEncoder.writeComplete(); otherwise it gets stuck and making sure it works if the connection drops out
4) I reused an existing peripheral app so some of the code might be removed as not necessary for MIDI (see https://github.com/WebBluetoothCG/ble-test-peripheral-android)
5) the app at 4) seems to allow more that 1 BLE device to connect to a given service. I am not too sure how this works.

I think that someone with a decent knowledge of Bluetooth LE can make it a robust app and add it to midi-suite.

Andrea
Reply all
Reply to author
Forward
0 new messages