Music 220b: Lecture Notes 4

Chords, Waveform Database, Loop Macro


Wave2.lisp demonstrates chord syntax in item streams. Square brackets associate a set of items as a chord on a parameter For example, (pitches [f3 a c4 ef]) produces four simultaneous pitches. Since rhythm should be updated per chord and not per element inside a chord, an unless-chording block takes care of accessing streams (such as rhythms) outside a chord.

Used in the Stella container, algorithm, the structure is:

(algorithm <name of algorithm> <SynthPatch> 
	   (<list of SynthPatch parameters paired with constant values>)
	   (setf <list of SynthPatch parameters paired with values always changing note-by-note>) 
	     (setf <list of SynthPatch parameters paired with values that only change each chord event>)

Waveform Database and WaveTable Interpolation

The DBwave1.lisp example invokes the MusicKit Timbre Database for wavetable "presets." These comprise a library of available spectra, see /dist/220/doc/CommonMusic/contrib/SynthPatchLibrary.rtf for the list (located at the end of the document). WaveTable synthesis can be enlivened by interpolating between different spectral envelopes during the course of a tone. The DBwave2.lisp example uses the two waveform synthpatch to cross-fade between two spectra with an time-varying envelope on interpolation.


Lisp interprets according to an interactive loop, "read - eval - print," it reads text that is typed in or sent from an Edit file, evaluates the expressions in the text and then prints the result in the Lisp window. If any symbols are set globally in the process of evaluating the text, those settings are remembered.

Globally defined variables and functions are created with setf, defvar, defparameter, and defun. These can be accessed any time after you've set them.

Locally defined variables and functions are created with the let and flet functions. Definitions with a local scope ensure that a symbol is set only within a specific context.

The loop macro is a useful way to program iterated behavior with English-like syntax. DBWave1 uses it to spawn several algorithms within a merge. The effect is the same as having written by hand a number of algorithms (which differ according to some parameters such as spectral envelope and bearing).


The above examples can be combined. Turn in a "merge" that uses 1) loop for several automatically spawned parts, 2) plays using the interpolating wavetable database synthpatch.

©1995 Fernando Lopez-Lezcano. All Rights Reserved.