1

Is it possible to configure RPi as a MIDI device? I'd like it to show up as a MIDI device on my computer when connected via USB OTG to my computer.

vaid
  • 371
  • 4
  • 13
  • have you done any research before posting your question? – jsotola May 29 '19 at 19:08
  • I understand that my question sends the vibes that I did zero research, but I have indeed done quite a lot of research. I always do. All I’ve found is how to connect MIDI devices to the RPi, and not how to turn the RPi into a recognizeable MIDI device. – vaid May 29 '19 at 21:22
  • I agree what you are saying - knowing how to connect a midi device to rpi is not the same thing as asking rpi to pretend to be a midi device. Let me think about it and see if I can suggest anything. I will start my research with the following posts - https://raspberrypi.stackexchange.com/questions/98016/use-pi-as-a-midi-controller-input/98026#98026

    https://raspberrypi.stackexchange.com/questions/96083/more-digital-inputs

    – tlfong01 May 30 '19 at 01:59
  • Now let me suggest something. First, we need to agree on the midi controller hardware. Let us start with a 16 key controller. We can use a keypad to simulate the controller - Multiple GPIO Buttons https://raspberrypi.stackexchange.com/questions/98440/multiple-gpio-buttons If we can use Rpi to detect which key is pressed, then we have completed the hardware part. Of course we can use more sophisicated key pad, such as Hall effect, which is analogue, so we can use ADC to detect more things, like pressure of key presses etc, but this is an improvement of first step. . to continue, ... – tlfong01 May 30 '19 at 03:50
  • a) You'll need a pi zero or zero w. b) it's simple as https://gist.github.com/gbaman/50b6cca61dd1c3f88f41 (though you may need to find more recent instructions as those are for jessie - but that's your research for you) – Jaromanda X May 30 '19 at 03:52
  • And second step is to convert the key data, say which key, pressure, duration etc, to midi format/code in real time, or stored in a midi file. For this, you need some sort of midi file creation utility, such as this - MIDI - read, compose, modify, and write MIDI files https://metacpan.org/pod/MIDI – tlfong01 May 30 '19 at 03:58
  • Damn, this is almost a step by step guide lol you guys are awesome. And I see @tlfong01 is back at it again. Glad to see you friend! – vaid May 31 '19 at 14:18
  • @vaid Thank you for your nice words. There is a long way for me to go. I forgot if I gave you another step by step guide to make a 16 key keypad, which is the first step to make a Hall effect keypad. You might like to skim the following post for details. At the end of the post are some ALSA MIDI tutorials which you might also find interesting.
    Connecting 32 magnetic [Hall Effect] sensors https://raspberrypi.stackexchange.com/questions/96259/connecting-32-magnetic-sensors
    – tlfong01 Jun 01 '19 at 12:13

1 Answers1

3

OTG does not work on most Pi models due to hardware restrictions.

To enable OTG on the Pi Zero, see Andrew Mulholland's blog post Raspberry Pi Zero – Programming over USB!, and the linked guide. (To summarize: add dtoverlay=dwc2 to /boot/config.txt, and load the dwc2 and g_midi modules.)

CL.
  • 571
  • 4
  • 8