开发者

Communicate with external MIDI device from Android device

开发者 https://www.devze.com 2023-04-13 03:41 出处:网络
What classes are available for Android platform to communicate (in/out) with external MIDI device? I have HTC Desire smartphone开发者_JAVA百科, it has USB port, I\'d assume it is possible to connect i

What classes are available for Android platform to communicate (in/out) with external MIDI device? I have HTC Desire smartphone开发者_JAVA百科, it has USB port, I'd assume it is possible to connect it to a MIDI synthesizer, using standard USB cable + [Type A -> Mini A] converter. I'd like to write a MIDI sequencer app that would be able to record MIDI stream from the synthesizer and then play it back later.


Short answer: None. Slightly longer answer: On the HTC Desire there is no built-in support for USB host mode (which you need, since the usb-midi adapter would be the USB client). (Android 3.1 does have some support for USB Host mode, but that's not available for the HTC Desire) If you're not afraid of a soldering iron, you could go the midi-over-bluetooth route: http://nettoyeur.noisepages.com/2011/01/midi-over-bluetooth-part-iii-new-hardware/


Much has changed on this front. The following library allows for MIDI i/o with a USB OTG adapter on API 12+:

https://github.com/kshoji/USB-MIDI-Driver

It's far from perfect, and in my testing, pretty crashy, but it should at least be a good starting point for someone looking for the relevant classes.


As @edovino said, you need USB host mode, and then drivers.

If you don't mind rooting around your phone, and the hardware supports it, you do have some options. Check out this link: http://sven.killig.de/android/N1/2.2/usb_host/

This guy was able to get audio, video, keyboard, and some other stuff working. He includes audio/MIDI drivers.


Yes, as pointed above, it is not feasible using the phone because it does not provide USB-host capability. I have been working religiously over the past few months to make an XY-controller for my synthesizer so that I can transmit controller values to use for performances. I reckon, that is what you want to do with additional functionality.

Bluetooth is definitely an option and if you look up for libpd, Peter Brinkmann himself has addressed this issue and acknowledged that Bluetooth dongles for MIDI are not far away.

WiFi is also something one may be willing to look at. Using rtpMIDI, we can create sessions on the PC side of things and use just about any WiFI enabled MIDI device to transmit/receive data. IF you are looking to control software synthesizers using a phone, this seems ideal. TouchDAW and TouchOSC, applications on android, make use of this feature.

With the USB-Android driver, the only problem I see is no support for isochronous transfers using USB host. So, we cannot guarantee latency deterministic. But, considering no other bus accessories attached, the performance seems pretty decent in my tests.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号