Recently I treated myself to a new keyboard (of the musical variety), one that helps you learn how to play it, which is great for someone like me who has only just started trying to play a musical instrument. Despite not being very expensive it did come with MIDI connectivity. MIDI is a standard that is as old as the hills and is still very useful for connecting musical instruments to each other and to computers, it also provides a file format for MIDI data. Searching around online I was surprised to find a MIDI to USB cable for only a few pounds so I got one and started looking around for interesting software that would run on Ubuntu that would make use of the new connection. The results were interesting and I found that MIDI makes all sorts of things possible.
The first step was to get MIDI functionality up and running on my Ubuntu machine, fortunately this turned out to be quite simple. The first step was to install JACK, this is an audio server that many applications can talk to and is capable of routing audio to different devices. The packages I installed were jackd and qjackctl (which provides a graphical program called Jack Control found under Applications → Sound & Video). I understand this is built into Ubuntu Studio so if you are using that remix you have a head start. Using JACK control it is possible to detect and set up the MIDI ports. More information can be found on the Ubuntu Wiki at: https://help.ubuntu.com/community/What%20is%20JACK.
Recording the music you play on your keyboard can be achieved by using a program called Rosegarden. This is available in the normal Ubuntu repositories and surprised me with the number of features it offers. You can record and playback your music in this multitrack environment and it will happily deal with MIDI files. It even has the ability to create musical scores from the music you play, which you can go on to edit. On its webpage Rosegarden (screenshot above) is described as an “easy-to-learn, attractive application that runs on Linux, ideal for composers, musicians, music students, and small studio or home recording environments”. It seems pretty logical to use which is great as I am not familiar with how music software works. I am looking forward to exploring it more.
Playing a tune yourself is not the only way to generate a MIDI file of course. You can also download MIDI format files from sites like Mutopia and have them play on your keyboard using Rosegarden. If the tune you want is not available it is sometimes possible to convert pre-recorded music into MIDI files. I tried the method explained here: http://www.audiorecording.me/convert-mp3-files-to-midi-files-using-amazingmidi-in-linux-ubuntu-wine.html which was quite an interesting experience. I got the AmazingMIDI software installed under WINE and converted an MP3 to a WAV file (an uncompressed format of sound file) and loaded it into the program. I found that some tunes worked better than others, the results were sometimes not very useful but there was the odd time when it produced an interesting representation of the music. Success really depends on the nature of the music in the file itself, if there are a lot of instruments playing at the same time it might struggle to create a decent MIDI file, if the tune is a bit simpler the results will be better.
A fun game that can make use of a MIDI connection is Linthesia. This is a game that uses MIDI format files to challenge players to play music on a keyboard. You can see the keys that must be pressed represented scrolling down the screen and when they reach the picture of a keyboard it is time to play. The score increases for correct notes hit. It is quite good fun and maybe slightly reminiscent of Guitar Hero or Frets on Fire. I imagine it could also be a useful practice tool when learning how to play music in the correct time.
This is a very new area for me and I am just starting out on my journey of exploring the interaction between musical instruments and computers. It is great fun though and fantastic to see what is possbile with Ubuntu, MIDI and freely available software. Lots more music packages are in the Ubuntu repositories too so it will be interesting to see what they can do, especially as (hopefully) my keyboard playing skills increase.