Sunday, June 17, 2007

Common Music

Within the last fortnight, I've been bitten by the music bug. More specifically the Midi bug. About 4 years ago, I started writing some Java classes for sending Midi events and started playing around with the idea of writing a sequencer. But that didn't last long and when I went searching for the old code, I came up empty handed.

Have been bitten and not finding my old source code, I started contemplating how I would go about it this time. Since I've been toying around with Lisp, I considered this from that angle. Thankfully, someone has already done all the hard work. And when I say hard work, this just installed out of the box and I was running tutorial code in minutes. Very nicely done.

Having previous installed and using SLIME, I was very happy to see that CM plays nicely with SLIME. I followed the tutorial and <bzzzt>, wrong answer. Everything had gone so smoothly and yet I was stymied. So, I dove into the world of elisp. With the help of a couple people on #emacs, I'd traced exactly where the problem was (thanks to toggle-debug-on-error and message). With this, I now had the right google search term, which produced a couple of messages that got me thinking about going back to first principles.

The long and short of it is that my .emacs file before installing CM was:

(setq inferior-lisp-program "/usr/bin/sbcl")
(add-to-list 'load-path "/usr/local/lisp/slime-latest-cvs/")
(require 'slime)
(slime-setup)

which just sets up SLIME. I took what was suggested by CM and added the bits they had to give me:

(setq inferior-lisp-program "/usr/bin/sbcl")
(add-to-list 'load-path "/usr/local/lisp/slime-latest-cvs/")
(add-to-list 'load-path "/usr/local/lisp/cm/")
(load "etc/xemacs/cm.el")
(enable-cm-commands)
(require 'slime)
(slime-setup)

This setup prevents CM from loading (I'm sure there is an obvious reason for this, but I'm way too inexperienced to see it today). The sad thing is that no one else seems to have run into this problem. I'm special because I already had SLIME installed, but CM is more for musos than people like myself, so they'd install CM first then SLIME and wouldn't have a preconceived .emacs file hanging about.

So I've fixed this by doing only what the documentation suggests:

(add-to-list 'load-path "/usr/local/lisp/slime-latest-cvs/")
(add-to-list 'load-path "/usr/local/lisp/cm/")
(load "etc/xemacs/cm.el")
(enable-cm-commands)

and now M-cm works and brings up CM in SLIME. Sadly, SLIME on its own is now undefined, but then I can just use CM for all my SLIME work...

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home