Friday, March 06, 2009

A Bit Of Electronic Instrument Geekery: Fun With MIDI Controllers

One thing I've been rather enjoying as of late (and which I've been doing both for fun and because I figure it's good to keep one's neurons forming new pathways) is playing around with a MIDI controller* keyboard and sequencer software.

My partner Matt and I got the keyboard about a month ago, as both of us were interested in learning to play some sort of piano-like instrument. Both of us have some experience musically, but not extensive amounts of it; he played saxophone in high school and I played guitar informally (but often) as a teenager. I also played the piano a bit growing up (and had a screaming-red electronic keyboard when I was nine on which I incessantly played a one-finger version of the Star Wars theme), but not very seriously and never to the point of being able to read music beyond identifying Middle C.

In any case, when we decided to get the keyboard, we had a few decisions to make and not a lot of knowledge regarding the current state of musical technology to base them on. Both obtaining and setting up the keyboard turned out to be quite a learning experience, so I figured I would write about that experience here for the sake of anyone who might be curious about embarking on a similar quest.

Hardware

Here is a picture of the setup I am using:



The setup consists of the following items:

1. The MIDI controller keyboard (this one is an Axiom 49), which plugs into the computer's USB jack.

2. A computer (here, a Dell Inspiron Mini 9 laptop, running Ubuntu Linux)

3. Speakers (just regular powered computer speakers, plugged into the laptop's headphone jack)

These items are necessary because with a MIDI controller keyboard, you do not get any sound out of it without attaching it to a computer and running the proper software**. Essentially the keyboard should be thought of as an input peripheral, similar to a mouse or standard keyboard.

When I learned this, I was initially somewhat confused, but that was because I didn't really understand the nature and purpose of the controller yet -- I was thinking initially in terms of a standalone piano-like instrument, and couldn't figure out why anyone would want a keyboard you couldn't just turn on and start playing.

When I learned a bit more, though, I realized that there was actually a lot of power in a MIDI controller setup and am now really glad I went for that option.

In any case, MIDI controllers can be used for live music performance so long as you have the proper software and a powerful enough computer to handle the audio processing in realtime. They and their accompanying software are just more geared toward composition and mixing than to being played the way you'd play a regular acoustic piano, and their features reflect this.

Hooked up to a computer, you can use a MIDI controller to enter in and record the notes for one part of a song, save the result, do this multiple times, and then mix and overlay the tracks on top of one another.

Technically, you don't even need a piano-like keyboard to do composition using MIDI software -- programs have been available for years that allow you to just plunk down the musical score (using an interface that resembles sheet music) and have the computer play it back or save it or mix it with other tracks.

However, that sort of interface is really only useful for people who are extremely well-practiced at reading and writing music and who aren't interested in realtime performance. For the rest of us, there are controller keyboards available with varying numbers of keys, ranging from about 25 (for those who want maximum space efficiency and don't mind hitting a transpose button to change octaves) to a fullsize 88 key configuration.

What I wanted, upon learning what one could do with MIDI, was something that sat someplace about halfway between "best for composition" and "best for playing", and I found it in the combination of a 49-key controller unit and the computer system I connected it to. 49 keys allows for two-handed playing in realtime while not being so huge I'd have trouble storing or using it in my teeny apartment.

Furthermore, as small as computers are getting these days (I love my little Inspiron!), I figured it wouldn't be that much bigger of a deal to have a setup that included a computer than one that didn't. This has proven true as you can see from the setup photo above -- the entire hardware suite fits nicely on a coffee table, and all the parts stow away easily and are quick to set up when you want to use them.

Software

As far as software goes --initially I had the keyboard set up with a different laptop running Windows and the demo software that came with the keyboard (something called Ableton).

That setup, sort of worked, but I found the Ableton software to be ridiculously slow and cumbersome. Furthermore, all the synthesizer sounds included had bizarre, non-descriptive names like "Uncle DJ's Blue Elephant Breakfast" (not a real example but I swear that's about how weird the names were) and it was just a major pain to have to try each and every one before getting anything that sounded remotely like the instrument you were actually looking for.

Granted, some of the annoyingness of that software could be related to the fact that it was only a demo version I was using, but the interface just wasn't very nice to use -- it seemed to be overcomplicating things that could have been done a lot more simply. To its credit, some of the sounds available in that software were pretty neat, and eventually I might try using it if I decide to do something really wild like create soundtracks for short surreal sci-fi films recorded on my digital camera (maybe in an Alternate Universe of Copious Free Time...), but overall I just didn't like it very much. YMMV.

Matt disliked the Ableton software even more than I did, and because of this, he was intensely motivated to find some way to run the keyboard interface using Linux. He did some searching and managed to find a software combination that was not only totally free, but which so far seems to be working wonderfully (and with a nice, clean interface on top!).

The software set we are currently using runs under Ubuntu, and consists of:

1. JACK Audio Connection Kit (which permits audio to be piped between different processes and applications with minimal latency; important when you're dealing with realtime music)

2. Fluidsynth software synthesizer, with Qsynth serving as a front end (the synthesizer receives the inputs from the peripheral device and renders them to audio)


JACK and Qsynth on the laptop screen



3. Rosegarden sequencing / composition / editing suite (main interface for playing and composing music)


Rosegarden on the laptop



JACK and Qsynth don't need to be messed with much once you've launched them -- they both have various controls associated with them, which may affect sound in interesting and potentially useful ways, but I've so far just left them in their default states and let them sit in the background.

Rosegarden is where you actually select instrument parameters (i.e., what "voice" you want the music to have, whether you want it to sound like a piano or a violin or an electric guitar or an ocean wave), and you'd do your track mixing and composing. So when using the instrument, whenever you're doing things in software, you'll probably be doing them mainly via the Rosegarden interface.

Making the Music Happen

With the combination of hardware and software above, I now follow these steps to make the music happen:

1. Plug speakers into wall power and into the computer's headphone jack
2. Plug MIDI controller into computer using USB cable (note that the keyboard is powered via USB)
3. Turn on the computer
4. Launch JACK
5. Launch QSynth
6. Launch Rosegarden
7. Turn on keyboard
8. Select Instrument Parameter (in Rosegarden)
9. Play!

I have not yet actually tried any composition or mixing, but I really hope to do some of this in the future as I learn more about how to play and use the software. As I mentioned at the beginning of this article, I never really learned to read music -- it just always seemed like such an annoying abstraction set between the sounds and my ability to make them. Hence, I'm very much a "play by ear" sort of person. I don't know how much progress I'll make at learning to read music, but I'm intrigued by the fact that with the setup I have now, I can press a key and have the computer show me what note it is, rather than the other way around. Who knows, perhaps that will help me learn what notes go with what sounds.

The video below is my (very, very) amateurish rendition of the level 3 theme from Castlevania.



As you will see (and hear) if you watch it, my rhythm is a bit off, and I pause in a few places, and there are a number of screwups, but overall I'm excited at even having been able to get as far as I have in figuring out the song. I know full well that my playing is still extremely amateurish -- I certainly did not post this with any illusions about being awesome or particularly well-practiced -- but considering I figured out the notes basically by ear and mostly from memory, I don't think I'm doing too horribly.

Furthermore this video demonstrates the fact that despite the synthesizer being based in a very small "netbook"-type computer, there's really no perceptible latency or crackling or clipping.

This is probably the thing that's impressed me the most about the whole setup -- the fact that I've got this full-featured musical suite in my living room now running entirely on cheap, readily-available hardware (which I figure was not designed with this kind of thing in mind!) and free software.



* MIDI stands for "Musical Instrument Digital Interface", and is a protocol specifically for transmitting musical data within an electronic system.

** There are some standalone playable keyboards out there that have MIDI interfaces (even my old red circa-1989 keyboard apparently had this capability, though I never used it), but they tend to be bulkier and more expensive than the plain controllers, and may actually limit what you can do in the long run without even more expensive upgrades or replacements.

8 comments:

Matthew said...

Very cool! I have seen different musicians use all kinds of midi synthesizer inputs - the oddest was a midi clarinet. You blew into a pressure sensor for note amplitude, and used a clarinet appearing stick with switches for the pitch. You could control it with a guitar midi input device:
http://www.starrlabs.com/

guitar sound to midi converter:
http://home.epix.net/~joelc/midi_git.html

AnneC said...

Matthew: Wow, I've never heard of a MIDI clarinet - that sounds utterly odd, but not entirely surprising either. Conceptually it reminds me vaguely of how some of the newer handheld game systems (Nintendo DS?) have come equipped with some sort of air transducer, which allows the player to make things on the screen happen by blowing on it.

And, yeah, while I am definitely all for the preservation of "analog" musical skills and instruments, electronic interfaces are really getting awesomely complex and cheap, which is super neat for those of us with neither the space or money for a studio or orchestra. :P

Anderson said...

For some reason, this got me thinking about...all your base are belong to us

:)
So, will you take requests for other video game music?

AnneC said...

Anderson: Sure I will take requests, though I will prioritize songs from games I've actually played (nostalgia is weirdly motivating for me).

Anderson said...

Ok, I've had 'Contra' music in my head, on and off, and with goofy timing, for a few weeks.

AnneC said...

Anderson: Oooh, good choice. Contra has some *great* music. There are some nice remixes out there as well, i.e., on OCRemix.com (one of my favoritest music sites) -- I particularly like this one (a remix of the "Snow Field" music).

Anderson said...

That is a good one. I found this article you should check out:

http://www.newscientist.com/article/dn16782-duetting-guitarists-brains-fire-to-the-same-beat.html?DCMP=OTC-rss&nsref=brain

Valonia said...

I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.


Joannah

http://linuxmemory.net