Brad Garton, December, 2007
Mac OSX and Windows XP; Max/MSP v 4.5 or higher
java v 1.4 or higher also required
download and install maxlispj
The [mxj maxlispj] object brings the power and
elegance of the LISP (specifically
programming language into the
real-time music environment. [mxj maxlispj] uses
a java-based implementation of Common Lisp auhored by Peter Graves.
The LISP interpreter is completely encapsulated using the
Max/MSP [mxj] java object, thus extending the capabilities of
Max/MSP in the following ways:
This function can be used to build a function returning a list of three
random elements from three different lists:
(defun get3el(l1 l2 l3)
(cons (getel l1)
(cons (getel l2)
(list (getel l3))))
And the delightfully insane thing about LISP is that lists
can be lists of numbers,
lists of strings, lists of functions, lists of lists, etc.
Because LISP is an interpreted language, functions can
be defined and sent into LISP "on the fly" to operate upon Max/MSP
data. The abcl interpreter (driven from Max/MSP) is fast enough
for many extensive LISP operations.
There are a number of
on Common Lisp available.
A fairly common complaint among Max/MSP developers is the lack
of a robust set of string-manipulation and data-structuring utilities.
Obviously, LISP has powerful string-processing capabilities, and
data representation can become as arbitrarily complex as necessary.
The [mxj maxlispj] object will catch most LISP errors and
Full source for both the [mxj maxlispj] object and the
abcl interpreter are available for downloading (see below).
(we wouldn't want to call them "bugs", would we?)
- Although [mxj maxlispj] will catch and handle most LISP errors,
it cannot provide the debugging features that traditionally come with
a LISP interpeter (i.e. no interactive debugger, no backtracing. etc.).
It is probably best to develop code in a standalone Common Lisp interpreter
and then import the code (the "loadbug" message to [mxj maxlispj] is
useful) into Max/MSP.
It is possible to run abcl LISP from a Terminal window to use the
Common Lisp debugging features. Copy the file "BGabcl.jar" into a directory
other than the Max/MSP classes directory where it was installed, and then
issue the command:
java -cp [pathto]/BGabcl.jar org.armedbear.lisp.Main
where [pathto] is an absolute or relative path
to the copy of the "BGabcl.jar" file. Alternatively, download the
web site and follow the included instructions.
- [mxj maxlispj] needs to do a lot of initialization when
starting the LISP interpreter. The first [mxj maxlispj] object
instantiated in a patcher may take several seconds
(sometimes 10-20 seconds, sometimes even longer) to load. Be
patient, even if (OSX users) the 'spinning rainbow wheel of death'
appears. All subsequent [mxj maxlispj] objects will appear
quickly as the initialization only has to occur once.
NOTE: One very odd situation can occur -- if a patcher has
been saved to disk in a session prior to creating
a [mxj maxlispj] object,
the first object instantiated in the saved patcher will take
a fair amount of time (30 seconds to a minute, depending on processor speed)
as it allocates memory. A number of errors will also appear in the
Max window about not finding certain classes,
but the [mxj maxlsipj]
will eventually be created and will function normally. I'm not sure why
- It is possible -- and in fact quite easy -- to write LISP programs
that take a significant amount of time to execute. If the LISP interpreter
takes too much time, Max/MSP will not be happy. This is real time,
- I'm not sure how well [mxj maxlispj] will handle a REALLY
LARGE program. "riff-o-matic" is somewhat substantial, but I'm not
a truly sophisticated LISP hacker.
- There presently is an issue with semicolons... these are used for
comments in Common Lisp, but they function as a 'message' character
for Max/MSP. Your results will vary, but to be safe you should probably
strip semicolon comments from any LISP code coming into Max/MSP. This
does not affect the use of semicolons as comments in the internal
lisp buffer or in files loaded/saved to or from the internal buffer.
Download and Install
Click to download one of the following archives below:
(6.1 Mbytes download)
(6.1 Mbytes download)
(5.3 Mbytes download)
v 0.9 -- 1/9/2008
This archive will unpack into a single maxlispj/ folder. Inside
is a file BGabcl.jar. You will need to do two thing to get
[mxj maxlispj] running:
1. Move or copy the BGabcl.jar file into a folder Max/MSP can use
for dynamically loading java classes. On Max/MSP 4.6/OSX machines, this
may be something like:
/Applications/MaxMSP 4.6/Cycling '74/java/classes/
or on Windows it might be:
C:\Program Files\Common Files\Cycling '74\java\classes\
The BGabcl.jar file contains the java classes to run
the LISP interpreter and provide the interface to Max/MSP.
2. You will need to edit the file max.java.config.txt
to add the BGabcl.jar file to the java dynamic class
search path. The max.java.config.txt file is located in the main
Cycling '74/java/ directory (see the example paths above).
An entry showing where the BGabcl.jar file is located should
be added somewhere in the file, for example the line:
max.dynamic.class.dir "/Applications/MaxMSP 4.6/Cycling '74/java/classes/BGabcl.jar"
would be used if BGabcl.jar was placed in the default Max/MSP 4.6/OSX
location. On Windows the max.java.config.txt entry might be:
max.dynamic.class.dir "C:/Program Files/Common Files/MaxMSP 4.6/Cycling '74/java/classes/BGabcl.jar"
if the standard Windows Max/MSP install location was used.
Once these two changes have been made, you can fire up a max patcher
and create an object: [mxj maxlispj] and LISP is ready to go!
(133 Kbytes download)
(338 Kbytes download)
(31 Kbytes download)
v 0.9 -- 1/9/2008
The folder maxlispj-help/ will unpack from this archive.
Inside this folder is the patcher maxlisp.help, which contains
a number of [mxj maxlispj] examples and associated documentation.
You can open the maxlisp.help patcher directly, or you may
want to move the entire maxlispj.help/ folder (intact! don't
just move the maxlisp.help patcher!)
to the Max/MSP help folder. This will allow it
to be invoked by OPTION-clicking (OSX) or ALT-clicking (Windows)
on the [mxj maxlispj] object in an edited patch window.
Usually this help folder is in
/Applications/MaxMSP 4.6/max-help/ (OSX) or
C:\Program Files\Cycling '74MaxMSP 4.5\max-help\ (Windows, Max/MSP 4.5).
Run all the examples, they're fun!
(10 Kbytes download)
v 0.9 -- 1/9/2008
The java source code for the maxlispj.java class that provides
the link between abcl and Max/MSP. Download the abcl source from the
abcl web site.
Final Words on This Web Page
object was written by Brad Garton (hey! that's me!) and supercedes the older
object. [mxj maxlispj] is much less 'brittle', and it runs
on Windows, too. The integration of java into Max/MSP via the
[mxj] object made this project possible. As always, the
good people on various development mailing lists (especially)
were invaluable. Thanks!
I hope this may be useful for others; I'm
having a blast with it. Let me know what you think!
garton at columbia dot edu