CCRMA

Introduction to ccrma and clm


Lecture Slides


Introduction to CCRMA


Introduction to CLM (Common Lisp Music)

Take a look at the whole sheebang... the score producer (if you use it) is Common Music / Stella (this will be part of 220b, we will not use Common Music is 220a). It writes a file in one of many possible syntaxes that the sound producing programs know how to interpret or play. CLM is also part of lisp, MusicKit, for example, is not part of the lisp image, it is an external software package that is part of the NeXT operating system...

Here's a more detailed look at the lisp world as usually used here at ccrma... Three different packages are compiled as part of the Common Lisp executable, CLM (sound synthesis and processing), CMN (common music notation) and CM (algorithmic composition).

Several ways to run lisp at ccrma... During 220a we will be using Linux or Irix and we'll be running the common lisp executable image as a subprocess of the xemacs editor.

A tour of CLM

This shows how a clm instrument generates both compiled lisp code for the initialization section and highly optimized C code for the sample generating loop...

The source files are usually ".lisp" or ".ins" (instrument) files. The compilation process generates a fast load compiled file, ".fasl"/".fisl" or ".fusl" depending on the platform you are running and a object file ".o" or ".so" depending on the platform.

A very simple instrument, just one sine wave with an envelope. You'll see the basic components of an instrument repeated over and over. The basic components are always the same...

Let's split it into three parts so that we can analyse it easily. The first part declares the instrument (defines and names the instrument and its parameters), the second part defines the "unit generators" or black boxes that will be connected together in the third part. The third part is the "run" loop that generates the samples that are merged into the output soundfile. It "connects" together the unit generators and creates a sample (number) for each iteration of the loop.

"make-oscil" creates the oscillator, "oscil" uses it; "make-env" creates the envelope, "env" uses it.

and here's the text:

(definstrument simp (start-time duration frequency amplitude 
		        &key (amp-env '(0 0 50 1 100 0)))
  (multiple-value-bind (beg end) (get-beg-end start-time duration)
    (let ((s (make-oscil :frequency frequency))
	  (amp (make-env :envelope amp-env :scaler amplitude)))
      (run 
       (loop for i from beg to end do
	 (outa i (* (env amp) (oscil s))))))))
Some ways to use our sinewave oscillator through the "with-sound" macro:

This is what you do to interact with clm, first create a file with the instrument code in it, compile and load it in the lisp interpreter, test it. If not happy then edit it and go back to the beginning of the loop. Sometimes testing involves just changing parameters to the instrument call and that does not require a recompilation...


The computing Environment at CCRMA

Too many platforms... Old and slow (but trusty) NeXTs running NEXSTEP and Alegro Common Lisp 3.1.20. PC's dual booting into NEXTSTEP or Linux, the latter running Alegro Common Lisp 4.3. A couple of SGI workstations that also have Alegro Common Lisp 4.3...

The NEXTSTEP world (both "black hardware" and PC's...). PC's are no good under NEXTSTEP because of the lack of a good lisp...

The Linux world, Pentium and Pentium Pro PC's running acl 4.3.

The Irix world, an Indy and an O2, both running acl 4.3.

A map of available CCRMA machines...


©1996 Fernando Lopez-Lezcano. All Rights Reserved.
nando@ccrma.stanford.edu