Computer Aided Musical Composition

| Resources | Configuration | CM Pocket Ref |

Configuration Diagram

Gentoo GNU/Linux                  (dwm)

                Vim
                 ↓
                Limp
                 ↓
SBCL Lisp → Common Music → FOMUS
                           ↙   ↘
              EAWpatches  ↙    Lilypond
                     ↓   ↙        ↓
                 TiMidity++     Evince
                     ↓            ↓
                  speaker      printer
    
Gentoo:2.6.25-gentoo-r7
(dwm:5.2)
SBCL:1.0.14 (emerge)
Vim:7.2 (emerge)
Limp:0.3.4
Common Music:2.11.3-rev1653
FOMUS:0.2.28-rev218
Lilypond:2.10.33 (emerge)
Evince:2.22.2-r1 (emerge)
eawpatches:12-r5 (emerge)
TiMidity++:2.13.2-r5 (emerge)

Screenshots

    

Installation

Most of the required programs are installed automatically using Gentoo's emerge command. I manually install Common Music, FOMUS, and Limp under the /usr/local/ subdirectory. I also do some special tweaking of Limp so that it works more seamlessly with Common Music.

Common Music and FOMUS

Get the latest versions of Common Music and FOMUS from their SVN repositories.

    PREFIX=/usr/local
    mkdir $PREFIX/cm
    svn co http://commonmusic.svn.sf.net/svnroot/commonmusic/trunk/cm $PREFIX/cm
    mkdir $PREFIX/fomus
    svn co svn://common-lisp.net/project/fomus/svn/fomus/trunk $PREFIX/fomus

Uncomment (or add) (use-system :fomus) at the end of the cm/src/cm.lisp source file. Then make a symbolic link for cm with the following command:

    cd /usr/local/bin
    ln -s /usr/local/cm/bin/cm.sh cm

While logged in as user root, run the cm command. You need to be root only the first time you run CM so that it can generate the additional files it needs to run. Now you can login with your regular userid and run CM.

Tweaking Limp

Because I work on a terminal with a white background, I also changed the following line in Limp's vim/mode.vim file.

    hi BracketsBlock ctermbg=235 guibg=lightgray
    hi BracketsBlock ctermbg=lightgray guibg=lightgray

I don't care for the auto-folding default in Limp, so I also remove this line.

    setlocal foldmethod=marker foldmarker=(,) foldminlines=1

And finally, I changed these two lines in Limp's vim/mode.vim file to use my favorite xterm and so that the terminal stays open when I'm working from gVim. This makes for an especially nice working environment within the excellent tiling window manager dwm.

    let cmd = "xterm -e " . cmd
    let cmd = "urxvt -e " . cmd
    let b:listener_keep_open=0
    let b:listener_keep_open=1

Running Common Music

There are two ways in which to start up the Common Music environment. The first is simply to run the command cm and it will automatically detect your Lisp installation, run it, and load CM within it. The other, more useful, method is to load it up manually after Lisp is launched by Limp from within your Vim session. Then you have your full interactive environment with your editor, Lisp, and CM. In order to facilitate this method, put the following function definition in your SBCL initialization file, ~/.sbclrc, and then you can easily load Common Music by calling the function (cm-load) at the toplevel.

    (defun cm-load ()
      (load "/usr/local/cm/src/cm.lisp" :verbose nil)
      (funcall 'cm))

Using Timidity++

Play MIDI file with the following command:

    timidity opus.midi

Create FLAC file with the following command:

    timidity -OF -o opus.flac opus.midi