Installing Common Music
Contents
- Before Installing
- Tarball Installation
- CVS Installation
- Starting Common Music
- Programs and Interfaces
- Appendix
Before Installing
In order 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 10 hkt admin 340 24 Mar 11:30 osc/ drwxr-xr-x 5 hkt admin 170 21 Nov 17:44 portmidi/ drwxr-xr-x 23 hkt wheel 782 16 Mar 13:29 rts/
Tarball Installation
Sources for stable and developmental releases can be downloaded as tarball archives (*.tar.gz or *.tgz).
- 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@commonmusic.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, and interfaces to Midishare, OSC messaging, Portmidi and RTS:
$ cvs checkout -P cm-gtk $ cvs checkout -P midishare $ cvs checkout -P portmidi $ cvs checkout -P rts
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, assuming you have configured your Emacs with SSLIME. Examples:$ cm -l openmcl -e Emacs $ cm -l gosh -e xemacs $ cm -l clisp -e emacs
See the document Running Common Music in Emacs for more information about using CM with 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")
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)
- Authors: James Bielman, Luís Oliveira
- 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)
A sound synthesis package for Common Lisp and Scheme (Guile/Snd).
- Author: William Schottstaedt
- 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)
A music notation package for Common Lisp that outputs to EPS.
- Author: William Schottstaedt
- 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.
- Author: 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)
A music notation package for Common Lisp that outputs to Lilypond, CMN and MusicXML.
- Author: David Psenicka
- 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.
- Author: Rick Taube
- 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.
Open Sound Control
(use-system :osc)
Support for real time OSC communication with external applications like SuperCollider, PD and Max/MSP.
- Author: Todd Ingalls
- Downloads: OSC
- Supporting: Gauche, OpenMCL, SBCL
- Requirements: RTS
- Installation: Restore the OSC sources under your Lisp installation directory.
Player Interface
(use-system :player)
An interface to Midishare's Player sequencer for Common Lisp and Gauche Scheme.
- Author: Rick Taube
- Downloads: Midishare interface
- Supporting: Clisp, CMUCL, Lispworks, OpenMCL, SBCL
- Requirements: Midishare, for Common Lisp: CFFI, for Gauche Scheme: c-wrapper
- Installation: See Midishare Interface
Portmidi Interface
(use-system :portmidi)
An interface to the Portmidi MIDI library for Common Lisp and Gauche Scheme.
- Author: Rick Taube, Todd Ingalls
- Downloads: Portmidi interface
- Supporting: Clisp, CMUCL, Gauche Scheme Lispworks, OpenMCL, SBCL
- Requirements: GCC, configure, make, CFFI for Common Lisp and c-wrapper for Gauche Scheme; Portmidi libraries and header files must be installed under /usr/local/lib and /usr/local/include, respectively.
- Installation: Restore the Portmidi Interface sources under your Lisp installation directory and make the library.
$ cd /path/to/portmidi $ ./configure $ make
See the Portmidi topic help for more information about working with Portmidi in CM.
Real Time Scheduling
(use-system :rts)
Real time scheduling services for supported Lisp/OS systems.
- Authors: Todd Ingalls, Michael Klingbeil, Rick Taube
- Downloads: RTS
- Supporting: Gauche, OpenMCL, SBCL
- Requirements: GCC, configure, make, CFFI for Common Lisp and c-wrapper for Gauche Scheme.
- Installation: Restore the RTS sources under your Lisp installation directory, then configure and make the librts library:
$ cd /path/to/rts $ ./configure $ make
See the RTS topic help for more information about working with RTS.
Sa
(use-system :sa)
A Common Lisp interface to the SndObj Audio Library.
- Author: Todd Ingalls
- Downloads: Sa
- Supporting: OpenMCL, SBCL
- Requirements: GCC, configure, make, PortAudio, SndObj, CFFI. The libraries and include files for Portaudio and SndObj must be installed under /usr/local/lib and /usr/local/include, respectively.
- Installation: Restore the Sa sources under your Lisp installation directory and see the enclosed README.
SAL
(use-system :sal)
SAL is an alternate language syntax for working with Common Music. Sal provides commands, statements and infix expressions. It lets you start working with Common Music immediately, without having to first learn Lisp notation and evaluation rules. Sal comes with its own Emacs mode (sal-mode.el) that includes syntax highlighting and command execution services via SLIME. SAL has its own lexer/parser and combines features of Lisp, Dylan, PLA and Stella.
- Author: Rick Taube
- Downloads: SAL
- Supporting: Clisp, CMUCL, OpenMCL, SBCL
- Requirements: None
- Installation:
- Restore the SAL sources under your Lisp installation directory.
- Add the following lines to your .emacs file, replacing "/path/to/sal/" with the correct path on your machine:
(add-to-list 'load-path "/path/to/sal/") (require 'sal-mode)
sal-mode
requires SLIME, see Installing and Configuring SLIME for more information.
See the SAL topic help for more information about working with SAL.
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