MIDI keyboards?
21 posts
I just had someone ask me (or, more accurately, the Raspberry Pi Twitter account) how to hook up a MIDI keyboard - and although usually pretty glib, I wasn't able to help. Anyone had a go yet?
i've seen usb midi dongles around the internets so i would cautiously presume that software/drivers willing they'd work
Shameless Plug
I designed a serial based, the link to the design is in http://elinux.org/RPi_Expansion_Boards look for "RPi MIDI Breakout Board". You could build the circuit on strip board.
Tony
- Posts: 24
- Joined: Wed May 16, 2012 7:05 pm
There's a standard protocol for having MIDI through USB. Linux supports it readily.
I have an USB-pluggable MIDI keyboard I'm going to try with Raspberry Pi. It looks a lot like it'd have internal MIDI-USB chip.
I have an USB-pluggable MIDI keyboard I'm going to try with Raspberry Pi. It looks a lot like it'd have internal MIDI-USB chip.
I have an M-Audio Keystation Midi / USB keyboard. I could try that - but I can't play for toffee - and I haven't got sound working on my Pi yet.

- Posts: 207
- Joined: Tue Nov 29, 2011 9:26 pm
I also have access to a MIDI Keyboard (and a Casio electronic piano thingummy) with a MIDI -> USB cable - laughingly it wouldn't work with a Sequencer running on a Macbook but worked a treat on gold old Windows XP
Can anyone recommend a Linux MIDI Player I can try (lets do output first!) which is available for the Pi?
EDIT: Will mplayer or omxplayer do it?
Can anyone recommend a Linux MIDI Player I can try (lets do output first!) which is available for the Pi?
EDIT: Will mplayer or omxplayer do it?
Rosegarden has been around for a very long time and is a MIDI editor as well as a sequencer.
http://en.wikipedia.org/wiki/Rosegarden
http://en.wikipedia.org/wiki/Rosegarden
- Posts: 46
- Joined: Fri Dec 23, 2011 4:31 pm
I did MIDI many years ago. Connected it to a ZX spectrum. It is the standard RS232 interface but at a non-standar baudrate: 31.25 kbaud.
So yes the Pi can do MIDI. You need an RS232 converter and set the baudrate to 31.25K and off you go.
So yes the Pi can do MIDI. You need an RS232 converter and set the baudrate to 31.25K and off you go.
Gert van Loo wrote:I did MIDI many years ago. Connected it to a ZX spectrum. It is the standard RS232 interface but at a non-standar baudrate: 31.25 kbaud.
So yes the Pi can do MIDI. You need an RS232 converter and set the baudrate to 31.25K and off you go.
A "proper" MIDI connection (I mean the 5-pin din variety) is a 5mA current loop with an opto isolator between keyboard and UART / microcontroller / Pi, etc:

Bear in mind that the image shows a 5V application.
- Posts: 429
- Joined: Sat Jan 28, 2012 2:33 am
liz wrote:I just had someone ask me (or, more accurately, the Raspberry Pi Twitter account) how to hook up a MIDI keyboard - and although usually pretty glib, I wasn't able to help. Anyone had a go yet?
Not quite the same thing, but I hooked up my R-Pi to a Roland XV-3080 synth module through a Roland UA-100 USB->Midi module (but you can use any ALSA-compatible USB/MIDI adapter and they needn't cost much more than $10), and it worked almost straight out of the box playing back .mid files using "amidiplay" (part of the ALSA package).
The only issue was that the USB/Midi adapter wasn't recognised on reboot, but was recognised when the module was powered off and back on.
The R-Pi is as good as any of the Roland/Yamaha sequencer modules at driving external synths using MIDI.
- Posts: 46
- Joined: Fri Dec 23, 2011 4:31 pm
gritz wrote:Gert van Loo wrote:I did MIDI many years ago. Connected it to a ZX spectrum. It is the standard RS232 interface but at a non-standar baudrate: 31.25 kbaud.
So yes the Pi can do MIDI. You need an RS232 converter and set the baudrate to 31.25K and off you go.
A "proper" MIDI connection (I mean the 5-pin din variety) is a 5mA current loop with an opto isolator between keyboard and UART / microcontroller / Pi, etc:
Bear in mind that the image shows a 5V application.
Yeah, I had this discussion with the MIDI Association a while back about anything other than 5V:
http://www.midi.org/cgi-bin/forum/forum ... 171180161/
- Posts: 77
- Joined: Thu Sep 29, 2011 7:10 am
A little late to reply, but found this thread in a search.
My progress so far re: MIDI - http://www.nielsmayer.com/bin/view/Rasp ... h+Rasbpian
Would love to hear of alternatives using built in ports as ultimately I'd like to use get TTL-level MIDI and feed it to a Yamaha db50/db60 synth clone ( http://linuxaudio.org/mailarchive/lau/2010/7/3/171112 ) then use http://qmidinet.sourceforge.net/qmidinet-index.html to turn the 'pi into a "ethersynth" .
-- Niels
http://www.nielsmayer.com/
My progress so far re: MIDI - http://www.nielsmayer.com/bin/view/Rasp ... h+Rasbpian
Would love to hear of alternatives using built in ports as ultimately I'd like to use get TTL-level MIDI and feed it to a Yamaha db50/db60 synth clone ( http://linuxaudio.org/mailarchive/lau/2010/7/3/171112 ) then use http://qmidinet.sourceforge.net/qmidinet-index.html to turn the 'pi into a "ethersynth" .
-- Niels
http://www.nielsmayer.com/
- Posts: 13
- Joined: Mon Aug 13, 2012 4:25 am
Hi Niels. I'm a bit confused by your link. have you actually got jackd running in rpi?
I've not been able to get it to run at all using the inbuilt sound device.
I've done some stuff with Fluidsynth (qsynth command line only) and amsynth you can see here
viewtopic.php?p=141908#p141908
I've not been able to get it to run at all using the inbuilt sound device.
I've done some stuff with Fluidsynth (qsynth command line only) and amsynth you can see here
viewtopic.php?p=141908#p141908
- Posts: 10
- Joined: Tue May 08, 2012 10:46 pm
The actual interface as shown here is readily adaptable for 3V3 use, but is the PI able to generate the 31.25 KBPs baudrate? That is the bigger question IMHO.
mahjongg wrote:The actual interface as shown here is readily adaptable for 3V3 use, but is the PI able to generate the 31.25 KBPs baudrate? That is the bigger question IMHO.
Easily.
- Posts: 77
- Joined: Thu Sep 29, 2011 7:10 am
Okay then, I suppose that using the UART for a MIDI port would be quite easy.
To drive the LED of the transmit opto coupler would take just a transistor and a resistor, and interfacing the photo transistor of the receiver would be even easier, the only complication would be when you want to echo the MIDI in to MIDI loop-through, but that would also be solvable with just a few transistors and resistors.
The rest is just software.
To drive the LED of the transmit opto coupler would take just a transistor and a resistor, and interfacing the photo transistor of the receiver would be even easier, the only complication would be when you want to echo the MIDI in to MIDI loop-through, but that would also be solvable with just a few transistors and resistors.
The rest is just software.
There is no opto-coupler on the transmit, only on the receive. See the schematic above showing how to do in/thru/out.
- Posts: 77
- Joined: Thu Sep 29, 2011 7:10 am
Neil wrote:There is no opto-coupler on the transmit, only on the receive. See the schematic above showing how to do in/thru/out.
Sorry was being a bit obtuse here, I meant the optocoupler in the receiver of the other MIDI device that this MIDI unit is sending current to. Calling it the "Transmit opto coupler" is indeed a bit strange.
So the PI, with the help of a simple transistor outputs a current that lights up the LED of the optocoupler in the receiver of the other MIDI device, its that optocoupler that I'm talking about, not the one built into this interface.
mahjongg wrote:Neil wrote:There is no opto-coupler on the transmit, only on the receive. See the schematic above showing how to do in/thru/out.
Sorry was being a bit obtuse here, I meant the optocoupler in the receiver of the other MIDI device that this MIDI unit is sending current to. Calling it the "Transmit opto coupler" is indeed a bit strange.
So the PI, with the help of a simple transistor outputs a current that lights up the LED of the optocoupler in the receiver of the other MIDI device, its that optocoupler that I'm talking about, not the one built into this interface.
Ok, yes, you just need two transistors (one to invert, one to drive), or you could use a 7404 hex inverter (less soldering
http://www.midi.org/techspecs/electrispec.php
Neil
- Posts: 77
- Joined: Thu Sep 29, 2011 7:10 am
Problem with a TTL inverters is that either you power them with 5V, and get problems with level conversion thrown in, or you need an inverter that works on 3V3, but have to adjust the resistors for a lower output voltage. But yes, in principle that is what should work.