Installing Common Music
Contents
Pre-installation
To build Common Music from its sources you must have write permission in an installation directory, a working Lisp command on your execution path and some familiarity with the shell, or terminal, application. If you are going to use CM in conjunction with other lisp programs like CLM or Fomus, or with Lisp interfaces to external programs such as Portmidi and Midishare, consider creating a common "parent" directory to contain the different Lisp systems so that you can load them transparently using use-system. It does not matter where on the file system this Lisp installation directory is located; for sake of illustration this document assumes that the lisp software systems are all installed under "/usr/local/lisp".
Installing Lisp music packages under a common parent directory will allow you to load the separate systems transparently using use-system. This listing shows the various lisp systems and interfaces discussed in this document.
$ ls -l /usr/local/lisp drwxr-xr-x 15 hkt admin 510 14 Nov 13:56 cffi/ drwxr-xr-x 188 hkt admin 6392 14 Nov 09:57 clm-3/ drwxr-xr-x 9 hkt admin 306 21 Nov 09:59 cm/ drwxr-xr-x 11 hkt admin 374 5 Oct 17:28 cm-gtk/ drwxr-xr-x 64 hkt admin 2176 25 Oct 12:46 cmn/ drwxr-xr-x 64 hkt admin 2176 11 Nov 08:10 fomus/ drwxr-xr-x 7 hkt admin 238 26 Oct 18:04 midishare/ drwxr-xr-x 5 hkt admin 170 21 Nov 17:44 portmidi/
Installing Sources
Sources for stable and developmental releases can be downloaded as tarball archives (cm.tar.gz) or via anonymous CVS.
Tarball Installation
- Stable release tarballs are available from CM's Sourceforge Project page.
- A tarball of the most current development sources is available as a nightly CVS snapshot.
To install CM from a tarball simply download the archive and restore it under your Lisp installation directory:
$ cd /usr/local/lisp $ tar -zxf cm.tar.gz
CVS Installation
Sources to Common Music are maintained in a CVS repository organized into release branches and tagged by release numbers. By convention, even numbered branches denote stable software releases and odd numbered branches denote unstable, or developmental, branches. The CVS head branch — the branch you get if you do not specify any release tag — points to the very latest developmental sources.
To install the latest developmental sources via CVS:
-
Change directories to your Lisp installation directory.
$ cd /usr/local/lisp
-
Set the shell variable CVSROOT to point to the CVS repository:
$ export CVSROOT=":pserver:anonymous@cvs.sourceforge.net:/cvsroot/commonmusic"
-
Use
cvs login
to connect to the Sourceforge CVS server, press Enter when prompted for a password:$ cvs login CVS password:
-
Use
cvs checkout
to restore CM's source tree to your Lisp installation directory:$ cvs checkout -P cm
After the source tree has been restored you do not need to
use login
or checkout
again. You can
periodically update your CM installation tree to the most recent file
versions from the Sourceforge repository by executing cvs
update
from inside the top-level CM directory:
$ cd /usr/local/lisp/cm $ cvs update
You can also checkout several optional packages from the same Sourceforge repository: a GTK GUI, an interface to Midishare and an interface to Portmidi:
$ cvs checkout -P cm-gtk $ cvs checkout -P midishare $ cvs checkout -P portmidi
Starting Common Music
Once the sources have been installed on your local machine and you have a Lisp command that starts a supported lisp implementation, you can start Common Music. There are a number of different ways to do this, here are some typical strategies:
-
To start Common Music from the Shell use the
cm.sh
script located in CM's binary directory. You must have a valid Lisp command installed on your path for this to work.$ /usr/local/lisp/cm/bin/cm.sh
Consider installing a global command that runs cm.sh without having to type its pathname. This example adds a
cm
command to /usr/bin that starts the script simply by typingcm
to the shell prompt:$ sudo ln -s /usr/local/lisp/cm/bin/cm.sh /usr/bin/cm $ cm
By specifying the
-l
and-e
options you can launch CM under Emacs in any supported Lisp. Examples:$ cm -l openmcl -e Emacs $ cm -l gosh -e xemacs $ cm -l clisp -e emacs
-
To start Common Music from the Common Lisp REPL load "cm.lisp" from CM's source directory and then use the
(cm)
function to make the CM symbol package and readtable current:> (load "/usr/local/lisp/cm/src/cm.lisp") > (cm)
-
To start Common Music from the Scheme REPL load "cm.scm" from CM's source directory:
> (load "/usr/local/lisp/cm/src/cm.scm")
-
To start Common Music from inside Emacs add the following code to your ~/.emacs file. The example code assumes you have installed the
cm
shell command described in the first example:(add-to-list 'load-path "/usr/local/lisp/cm/etc/xemacs") (load "cm.el") (setq inferior-lisp-program "cm")
Restart Emacs and type C-x l to start CM in a dedicated Emacs buffer. See Running Common Music under Emacs for more information.
Regardless of which method you use to start CM the system will automatically generate, compile and load files as needed during the startup process. Once the files have been loaded CM will look for your "~/.cminit.lisp" customization file and automatically load it if it exists.
Programs and Interfaces
Once CM is running you can load in other Lisp programs and interfaces
using the use-system
function. This facility works transparently if the other Lisp software
packages all share the same parent directory as your CM installation
directory. To load programs and interfaces as part of CM's normal
start up process add the
appropriate use-system forms
to either
cm.lisp or to your personal
~/.cminit.lisp file. The use-system
facility will automatically
compile source code as necessary during the loading process.
The following Common Lisp packages can be loaded with use-system:
CFFI
(use-system :cffi)
- Homepage: http://common-lisp.net/project/cffi/
- Downloads: http://common-lisp.net/project/cffi/tarballs/
- Supporting: Allegro, CLISP, CMUCL, Lispworks, OpenMCL, SBCL
- Installation: Restore CFFI sources under your Lisp installation directory.
CLM
(use-system :clm)
Common Lisp Music, by William Schottstaedt. A sound synthesis package for Common Lisp and Scheme (Guile/Snd).
- Homepage: http://www-ccrma.stanford.edu/software/clm/
- Downloads: ftp://ftp-ccrma.stanford.edu/pub/Lisp/clm-3.tar.gz
- Requirements: GCC, X Windows (OSX: XCode developer)
- Supporting: Linux, OS X: Allegro, CMUCL, OpenMCL, SBCL
- Installation: Restore CLM sources under your Lisp installation directory.
CLM instrument files must be compiled inside the CM package in order to work with the process macro.
CMN
(use-system :cmn)
Common Music Notation, by William Schottstaedt. A music notation package for Common Lisp.
- Homepage: http://www-ccrma.stanford.edu/software/cmn/
- Downloads: ftp://ftp-ccrma.stanford.edu/pub/Lisp/cmn.tar.gz
- Supporting: Allegro, Clisp, CMUCL, OpenMCL, SBCL
- Installation: Restore CMN sources under your Lisp installation directory.
CM-GTK
(use-system :cm-gtk)
Graphical User Interface for CM implemented in GTK+2, by Rick Taube.
- Downloads: cm-gtk
- Requirements: X Windows, GTK+ 2.0 (OSX: XCode developer, Fink)
- Supporting: Linux: SBCL 0.7.9 or higher, CMUCL 19b or higher; OSX: OpenMCL 1.0 or higher
- Installation: Restore CM-GTK sources under your Lisp installation directory.
See the Plotter and CMIO topic help for more information about working with the GUI tools.
Fomus
(use-system :fomus)
Fomus, by David Psenicka. A music notation package for Common Lisp.
- Homepage: http://common-lisp.net/project/fomus
- Downloads: CVS only
- Supporting: Linux, OS X: CMUCL, OpenMCL, SBCL
- Installation: Restore sources under your Lisp installation directory using this CVS command:
cvs -z3 -d :pserver:anonymous:anonymous@common-lisp.net:/project/fomus/cvsroot co fomus
Midishare Interface
(use-system :midishare)
A Common Lisp interface to Midishare, a real-time MIDI operating system by Grame.
- Downloads: Midishare interface
- Supporting: Clisp, CMUCL, Lispworks, OpenMCL, SBCL
- Requirements: Midishare, CFFI
- Installation:
- Download and restore the most recent Midishare distribution
- Use msDriver to configure your MidiShare driver ports and then test your connections with msController (called msControl32 on XP).
- Windows XP: copy the Midishare .DLLs and .INIs into your /WINDOWS/ directory.
- Restore the Midishare Interface sources under your Lisp installation directory.
See the midishare topic help for more information about working with Midishare in CM.
Player Interface
(use-system :player)
A Common Lisp interface to Midishare's Player sequencer.
- Downloads: Midishare interface
- Supporting: Clisp, CMUCL, Lispworks, OpenMCL, SBCL
- Requirements: Midishare, CFFI
- Installation: See Midishare Interface
Portmidi Interface
(use-system :portmidi)
A Common Lisp interface to the Portmidi MIDI library.
- Downloads: Portmidi interface
- Supporting: Clisp, CMUCL, Lispworks, OpenMCL, SBCL
- Requirements: CFFI, on Linux /usr/local/libportmidi.so and usr/local/libporttime.so. (OS X and Windows libraries are included in tarball).
- Installation: Restore the Portmidi Interface sources under your Lisp installation directory.
See the Portmidi topic help for more information about working with Portmidi in CM.
Appendix
A. Lisp Commands
In order to run Common Music you must be able to start one of the
supported lisp
implementations. Most implementations provide a shell
command that lets you to start Lisp simply by typing the
command name to the shell prompt.
If you are on OS X, Linux or Cygwin you can use the which
command to see if a Lisp command is installed on your path:
$ which clisp /usr/local/bin/clisp $ which openmcl /Lisp/bin/openmcl $ which guile /sw/bin/guile
Here are the command names of the supported Lisp implementations. Note that several implementations require you install the command yourself:
Implementation Command Allegro: none CLISP: clisp
1CMUCL: lisp
Gauche: gosh
Guile: guile
Lispworks: none OpenMCL: openmcl
2SBCL: sbcl
STklos: stklos
1. Installing a CLISP.BAT file on Windows 2000/XP:
Copy this batch file contents and paste it into a new window in Note Pad.
@echo off
REM Edit the clispdir pathname inside "" to point to REM the clisp installation directory on your machine. set clispdir="\Lisp\clisp-2.35"
pushd %clispdir%
.\full\lisp.exe -B . -M .\full\lispinit.mem %1 %2 %3 %4 %5 %6 %7 %8 %9
popdSet the pathname in green to the true CLISP installation directory on your machine.
Save the text in a file called "clisp.bat".
Move clisp.bat to a directory on your path, for example C:\WINNT\System32\
2. Installing the openmcl
script from the ccl distribution:
-
Edit the file ccl/scripts/openmcl and set the CCL_DEFAULT_DIRECTORY variable to the OpenMCL installation directory on your machine, for example:
CCL_DEFAULT_DIRECTORY=/usr/local/lisp/ccl
-
Copy the file to a directory on your path, for example:
$ sudo cp /usr/local/lisp/ccl/scripts/openmcl /usr/bin