C O M M O N M U S I C N O T A T I O N
CMN is a Common Lisp program that produces standard western music notation. It is available free via anonymous ftp at ccrma-ftp.stanford.edu:pub/Lisp/cmn.tar.gz. Please send bug reports and suggestions to bil@ccrma.stanford.edu.
There's a mailing list for CMN news: cmdist@ccrma.stanford.edu. To subscribe, visit
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
This software is available to anyone who is interested, free gratis for nothing, without warranties of any kind.
Documentation is in cmn.html or cmn.txt. A brief change log is in HISTORY.cmn.
The examples are:
carl.cmn from "Archibald Douglas" by Karl Loewe franz.cmn from a piano trio by Schubert
fred.cmn from a piano concerto by Chopin fux.cmn part of a paper on automatic counterpoint gus.cmn opening of last mvt of Mahler's 3rd henry.cmn opening of "Thoreau" mvt of Ives' "Concord Sonata" joh.cmn from Brahms' "A German Requiem" mir.cmn from "Mir ist so wunderbar" in Beethoven's "Fidelio" moz.cmn opening of a piano sonata by Mozart
cmn-ex.lisp some cmn code to do various useful things
cmnt.lisp the examples in cmn.wn
duke.cmn Archduke Trio excerpt for "Computing in Musicology" vol 8
ccarh93.cmn Various examples for "Computing in Musicology" vol 9
jimmy.cmn "The Blue-tail Fly" (example of lyrics)
joe.cmn Haydn op 76, no. 1 in flashy modern layout
The core CMN program is in the files cmn0..cmn4.lisp. Other features that are occasionally useful are implemented in:
wedge.lisp wedged beams like Bartok used for the bouncing ball rhythm pedal.lisp all three piano pedals accent.lisp various 20th century articulation marks percussion.lisp random symbols said to be useful in percussion scores ring.lisp "ringing" notes -- i.e. tied off into space rests.lisp various special case rests and abbreviated names for common rests lyrics.lisp songs with multi-verse lyrics transpose.lisp score/part transposition pmn.lisp proportional notation quarter.lisp quarter-tone symbols (non-standard) rqq.lisp fancy beat subdivisions make-font.cl create PostScript type 3 font from music symbols in cmn-glyphs.lisp rgb.lisp X11 color names as cmn-style lists cmntest.cl run a million tests stf.lisp fancier staff-line handling (Anders Vinjar)
To preview results, set the output-type to :X on an X/Motif system, :Quickdraw on a Mac (the default, :postscript, generates a PostScript file that can be sent directly to a printer or viewed with ghostscript, xpsview, etc.) To build the previewer, you'll need Motif (although xcmnw.c, the X previewer, makes only very minimal use of Motif). See xcmnw.c for instructions. If there's much demand, I could make a statically linked version for Linux users. Since cmn's font does not (yet) have screen "hints", it can look ragged on the screen. It should be ok when printed however, or you can use the Sonata font -- the music-font in cmn.html.
The following describes how to get cmn going on:
An SGI Indigo with ACL, GCL, or Clisp
Any machine running NeXTStep and GCL
Any machine running Linux and ACL, Clisp, CMU-CL
A PowerPC Mac with MCL-PPC
Windows 95, 98, or NT with Clisp or ACL 5.0 (full or lite)
HPUX with ACL
LinuxPPC with Clisp and OpenMCL
Sun with Clisp or CMU-CL, perhaps ACL
Linux with Harlequin Lispworks 4.1
LinuxPPC with ACL 5.0.1 and OpenMCL
Mac OSX with Clisp or OpenMCL, perhaps ACL
SBCL in Linux, Sun, Mac-OSX
For most cases, you can probably use cmn-all.lisp to get everything compiled and loaded. Unless you're using cmn embedded in some other program (Common Music, for example), you normally need to work in the cmn package. That is, after loading cmn,
(in-package :cmn)
(cmn treble c4 q)
etc
See http://ccrma.stanford.edu/planetccrma/software/ for Fernando's RPM images.
To compile/load CMN, in general, start a lisp with CLOS, check that the directory names in cmn-all.lisp look reasonable, then (load "cmn-all.lisp") and (in-package :cmn). Special cases follow...
Linux, HPUX, or SGI with ACL:
In Franz Allegro CL, set the various directory pathnames in cmn-all.lisp (any unset directory name defaults to the current directory). Then load cmn-all.lisp.
Once CMN is compiled and loaded,
:pa cmn
and you're ready to go.
In HPUX, and presumably Solaris, before loading cmn-all.lisp, (pushnew :only-lisp features).
ACL for Linux is available free from Franz -- see http://www.franz.com.
If you have a version of ACL before 5.0, push :only-lisp on features before loading cmn-all.lisp.
SGI with GCL:
In GCL 2.1, you can get PCL loaded by following the impl/gcl/README instructions up to the saved_pcl step (which won't work due to the lack of an adequate rld on the SGI). Then go to the cmn directory, start gcl, fix up the directory names in the following sequence to point to your pcl directory (in this example, it was /snd/gcl/pcl-gcl-2.1/),
(load "/snd/gcl/pcl-gcl-2.1/sys-package.lisp")
(setq features (delete (quote kcl) features))
(load "/snd/gcl/pcl-gcl-2.1/defsys.lisp")
(push (quote kcl) features)
(setq pcl::default-pathname-extensions (cons "lisp" "o"))
(setq pcl::pathname-extensions (cons "lisp" "o"))
(load "/snd/gcl/pcl-gcl-2.1/sys-proclaim.lisp")
(compiler::emit-fn t)
(pcl::load-pcl)
followed by
(load "cmn-all.lisp")
(in-package "CMN")
Mac with MCL
If you don't have MacCompress (or MacGzip) and Tar (for the Mac), they are available in MacUtils.sea.hqx found on the pub/Lisp directory at ccrma-ftp ftp.stanford.edu. You'll want to read the associated readme files before un-tarring CMN (the main thing is to make sure the Unix ctrl-J's become Mac ctrl-M's -- this happens automatically if you set the "kind" field to TEXT. In Tar, go to Preferences and choose Convert Newlines). Since every cmn file starts with a comment, if you forget this translation, cmn will compile very rapidly and do nothing.
Before starting the compilation process, give the lisp image more heap space: select the lisp image, hit APPLE-i (i.e. FILE menu option "Get Info"), type in 8000 in the little field in the lower right hand corner of the pop-up window (the one labelled "preferred size" on my Mac). Then fire up MCL, check the cmn pathnames in cmn-all.lisp, and load cmn-all.lisp. Once compiled and loaded, you can save the state of MCL with save-application; there's an example in the Common Music file utilities.lisp. Once I become a Mac wizard, tomorrow maybe, I'll make this easier to do in CMN.
The output pathname defaults to "aaa.eps" which is ok on a Unix system, but doesn't make much sense on a Mac -- you'll want to reset cmn-output-pathname to your take local directory into account -- (setf cmn-output-pathname "HD:bil:cmn:aaa.eps") for example.
A note from Mari Masuda about the cmn postscript output:
You can use Ghostscript to look at the Postscript files,[...] and
BBEdit Lite or DropPS to send the PS file directly to a Postscript
printer. Ghostscript can be found at
http://www.cs.wisc.edu/~ghost/index.html, and BBEdit Lite and DropPS
(BBEdit Lite is a text editor has DropPS built into it) can be found
at http://www.barebones.com/ and then click on the Free Stuff link.
If you get BBEdit Lite, open the Postscript file that was created by
CMN and then under the Tools menu choose Send Postscript... Everything
should be pretty self-explanatory. Hope this helps!
Any machine with Clisp:
Clisp is a free lisp available at http://clisp.sourceforge.net/
In cmn-all.lisp fixup the pathnames that point to the cmn directory, if necessary (it defaults to the current directory). Finally, fire up Clisp and (load "cmn-all.lisp"). Once it's done, you can save the cmn image via (saveinitmem).
In Windows 95: (load "cmn-all.lisp").
In Windows 98: (pushnew :win98 features) (load "cmn-all.lisp")
(from Rick Taube):
If you want to see some example output of cm and cmn doing automatic music analysis, point your browser at:
http://www-camil.music.uiuc.edu/software/mtw/ata/ata.html#Examples
the analysis and graphic scores are generated without any human intervention. its not perfect, but its a start!
Linux with Harlequin Lispworks 4.1
If (load "cmn-all.lisp") stops prematurely with a segfault, please read the lispworks section in cmn-all.lisp for a workaround (it's at line 140 or thereabouts).
LinuxPPC with ACL Lite
This dies with a heap overflow. Presumably the "full" version would work.
OpenMCL
This is available at
http://openmcl.clozure.com/Distributions/openmcl-release-0.12.1.html
Get both the openmcl binary and the "interface" package.
To get xcmnw to work in openmcl/OSX, (pushnew :with-x11 features) before building cmn.
