Building Keykit on Raspberry Pi

[KeyKit](http://nonsuch.com/keykit/] is an interesting programming environment for midi music, combining graphical and programmatic control. The interface is extensible. Best of all, it was written before 2000, so it doesn't require a beasty machine.

There was no pre-built package for the raspberry pi, so I thought I'd have a go myself. I haven't done much compiling from sources since my early days using Linux.

I'm running the standard Raspbian distro.

Registering at the download site allows downloading the source. I was just interested in the alsa version-- haven't tried the raw midi version at all.

Extracting the zip creates a keykit77b folder, but running make installlinuxalsa fails with different errors. There is a useful readme_linux.txt file, but it didn't solve my immediate problems. Here's what I did to get it working:

It then compiles successfully-- though it doesn't create files in /usr/local/bin like the documentation says, the files are created in key77b/bin. The program runs under x, so startx if it's not running already.

The key77b/doc file has tutorials, as well as other documentation-- the multiport one was useful.

Initially I the program was seg faulting whenever i tried to get some sound. This turns out to have been an issue with my midi port setup. This is probably properly handled by creating a keylocal.k file but I haven't got that far yet. Adding the Port Enabler tool to the window, and using it to enable midi input and output prevented further segmentation faults.

To actually get midi doing something required I use the alsa tools to map keykit's ports to the system's midi ports.

I had an old Edirol UM-1 USB-midi cable which I plugged into the usb hub connected to the pi. With keykit running and the midi ports enabled, from a console command line

aconnect -i 

lists the midi inputs

aconnect -o 

lists the midi outputs

Both the UM-1 and keykit showed up, with a major/minor number.

aconnect 128:1 20:0

connects the midi in on keykit to the midi out of the UM-1. At this point I could connect my iphone (through yet another midi interface) and run Midi Monitor and see events generated by keykit's Mouse Matrix tool. Running BS-16i on the iphone let me hear stuff. BS-16i has a General Midi soundfont; very handy.

Using aplay midifile from the console was very handy getting this working.

aplaymidi -p20:0 filename

Once that was working, I connected the midi cable from the UM-1's output to my MeeBlip synthesiser, switched it to receive on channel 1, and spent a fun few hours playing with keykit.

Keykit's documents say it only works for external midi; but I imagine since they were written, the state of soft synths has advanced considerably; since the connection is handled by alsa, I don't see why it won't work.

Resources

Tags: raspberrypi, synth

Date created: 2013-04-28