Learn Piano Game Play free
Home › Guides › Keyboards, MIDI and Bluetooth › How do you use a USB OTG cable with a MIDI keyboard?

How do you use a USB OTG cable with a MIDI keyboard?

Plug the OTG adapter into your phone or tablet, then connect it to your keyboard's USB "to host" port with a normal USB cable. The phone then acts as the computer, and most modern keyboards show up as MIDI devices without any extra setup.

A USB OTG ("On-The-Go") cable or adapter lets a phone or tablet act as the host, the role a computer normally plays. That is what a MIDI keyboard needs: something to send its notes to. With the right cables, a keyboard you already own can control apps and games on a device that fits in your pocket.

This guide covers what to buy, how to plug everything in, and what to check when it does not work.

What you need

Three pieces have to line up, and the mistakes almost always happen at one of these joints:

The most common setup with an older keyboard looks like this:

  1. Keyboard end: a standard USB-A to USB-B cable (the printer type).
  2. Phone end: a small OTG adapter that turns your phone's port (USB-C or micro-USB) into a full-size USB-A socket.

If your keyboard has a USB-C port and your phone has USB-C, a single USB-C to USB-C data cable often works and you do not need a separate OTG adapter. Many modern USB-C phones handle the host role by themselves, but it can vary by device.

Step by step

  1. Turn the keyboard on and set its volume to a comfortable level.
  2. Plug the OTG adapter into your phone or tablet.
  3. Plug the USB cable into the adapter, then into the keyboard's USB port.
  4. Open your music app or game. If it asks for permission to use MIDI or a USB device, say yes.
  5. Press a key. If the app reacts, you are connected.

The order is not strict, but connecting the cable before opening the app saves you from restarting it later.

Which USB port on the keyboard?

Some keyboards have two USB ports, and they do very different jobs. A port labeled "to host" (or "USB to computer") is the one that talks to phones and computers. A port labeled "to device" is usually for flash drives, to save or load songs. Plugging your phone into the "to device" port will do nothing useful.

Do you need a driver?

Usually not. Most keyboards sold in the last 15 or so years are "class compliant", which means Android recognizes them without installing anything. If you are unsure, our guide on whether you need a MIDI driver explains how to tell.

Using it with Keyfall

Keyfall, the free piano game at learnpianogame.com, accepts a keyboard over USB MIDI, and it works best in Chrome. On an Android phone or tablet, that means the OTG setup above is all you need: connect the keyboard, open the site in Chrome, allow MIDI access if Chrome asks, and play. On iPhone and iPad, Keyfall's Bluetooth connection needs the free Bluefy browser, so wireless is the route to try there. You can compare the two options in Bluetooth MIDI vs USB MIDI.

What about power?

A keyboard that plugs into a wall outlet or uses batteries powers itself, so the phone only has to pass along notes. A few small keyboards take their power from the USB connection instead, which asks your phone's battery for extra energy. Many phones can handle a small keyboard, but some refuse or drain quickly. If the keyboard will not turn on or keeps disconnecting, try putting batteries in it or using its power adapter, if it has one.

For long practice sessions you may also want to charge the phone at the same time. A powered OTG hub or an adapter with a charging port solves this, but check that it is built for data as well as charging.

Troubleshooting

If nothing happens when you press a key, work through this list:

Try one change at a time. If the keyboard works with a computer but not the phone, the cable or adapter is the most likely cause.

Sound and delay

USB MIDI itself is fast. If you hear a gap between pressing a key and hearing a sound, it is usually the app's audio output on the phone, not the cable. Our page on audio latency explains why. If you are using the keyboard's own speakers or headphone jack, you will hear no delay at all, because the keyboard makes that sound itself.

Once it works, the setup is simple: plug in, open the app, play. It is a good way to turn the keyboard you already have into a practice tool on a phone or tablet.

More about keyboards, midi and bluetooth

61 keys or 88 keys: which should a beginner choose?What should you look for in headphones for a digital piano?What is the right keyboard stand and bench height for piano practice?Bluetooth MIDI vs USB MIDI: which should you use?Can you use Bluetooth headphones with a digital piano?Digital piano vs keyboard: which should a beginner buy?Do You Need a Driver for a USB MIDI Keyboard?Do you need a sustain pedal on a digital piano?

FAQ

Can I use any USB cable with an OTG adapter?

It must be a data cable, not a charge-only one, and it must fit your keyboard's port. For many keyboards that is a standard USB-A to USB-B printer cable.

Does an OTG cable work with an iPhone or iPad?

iPhones and iPads use different adapters, such as Apple's camera adapter for Lightning or a USB-C cable on newer models. Which apps and browsers can then use the keyboard varies, so check before buying.

Do I need to install an app to make the keyboard work?

No app is needed for the connection itself, because most keyboards are recognized automatically on Android. You only need an app or website that accepts MIDI input.

Why does my phone say it cannot detect the keyboard?

The usual causes are a charge-only cable, an adapter without OTG support, or the wrong keyboard port. Try a different cable and confirm you are using the "to host" port.

Will the OTG connection drain my phone battery?

If the keyboard has its own power, the drain is small. A keyboard that takes power from USB can use noticeably more, so consider batteries or a powered hub.

Is Bluetooth MIDI better than a cable?

A cable is simple and does not need pairing, while Bluetooth is wireless but depends on your keyboard supporting it. Pick whichever your keyboard and device handle most easily.

Practise it on your own piano. Keyfall is a free piano game: notes fall toward the keys and you play them on a digital piano, keyboard, phone or computer.

Play free