Saturday, 25 February 2012

Music Composition in Ubuntu

I realised I'd been neglecting music: consumption, performing and composing. Today I was determined to get set up to do a bit of the latter.

Streaming some radio in the background I got to work getting my Ubuntu install to be a tool for composing and generally playing with music.

The Wires (jack)

First step was to install the software. It seems most applications pivot around jack so this was the starting point. The GUI tool for starting jack and controlling it is qjackctl:
    sudo apt-get install qjackctl
After installing, however, it didn't want to start.

Oddly it turned out to be that my sound card just likes to have something, anything, plugged into the microphone socket. With that fixed it was time to get MIDI working.


MIDI Synthesizer (qsynth)

To play MIDI I needed to feed jack some sounds; two things are required: a synthesizer, and a collection of instrument samples known as a soundfont. The synthesizer is qsynth:
    sudo apt-get install qsynth
which comes with a soundfont called "fluid".


After installing QSynth, the soundfont had to be registered in the "Setup..." page.



Virtual Keyboard (vkeybd)

Now to test all this, I installed a MIDI generating virtual piano keyboard.
    sudo apt-get install vkeybd
On its own this doesn't do anything except generate MIDI signals. To get sound out of the speakers it has to be connected to the synth. This is where jack shines.


Opening the jack Connections view (by clicking "Connect" in qjackctl) I could then connect the keyboard to the synth.



It now makes sounds.

I went a bit further and extended its default keymap so that I could play the virtual piano with the computer keyboard. I don't have a real MIDI keyboard yet. If you wish to do this, edit this file:
    ~/.vkeybdmap
and extend it with the key mapping you want. Each number corresponds to each semi-tone on the keyboard with 12, 24, 36, ... all being C (the "C" key on the keyboard maps to C by default).

Drums (hydrogen)

Having played a bit with Hydrogen in the past I wanted to try to integrate it into my workflow. As it turns out this is very easy.

With jack and qsynth already installed and running, Hydrogen was a breeze to install and it worked straight out of the box. Clicking the play button and other transport controls on qjackctl even made it play and stop, so it was all wired up nicely and gave me hope that I could sync the drums with other components that I write.

Composition (rosegarden)

Installing Rosegarden gave me the option to run in realtime mode. It said this wasn't advisable for a multi-user environment but I decided it's more important for me to have the lowest latency, so I clicked the box and finished the installation.
    sudo apt-get install rosegarden
Again with jack and qsynth already running it was easy to get going with Rosegarden. Unfortunately it didn't sync when I tried playing drums via Hydrogen at the same time.

To fix this Rosegarden has to be told to use the jack transport controls. Go to "Edit" | "Preferences" and tick the box that says "Use JACK transport". Now make sure the tempo is the same in both applications and it'll keep them in time.


Finally, using the "Connections" window in qjackctl again, I wired the virtual keyboard into Rosegarden's input, allowing me to record a performance from the keyboard. Wicked.

Monday, 2 January 2012

Google Docs to Kindle with Images

I'd been looking into a nice way to get content onto the Kindle with minimal effort and realised Google docs has an email export.

After trying a few formats, these are the results:

HTMLBullet lists get converted into numbered lists with broken formatting
PDFFormatting good but as always with PDFs on the Kindle, readability and browsing is less than ideal
RTFAlmost perfect. Paragraphs have extra spacing between them but otherwise it looks good.

I'd therefore recommend emailing as RTF to your.name@free.kindle.com and trying this yourself. You'll need to add your Google account to the list of users allowed to send files to your device, but you'll get an email all about this from Amazon.