Music 220b: Lecture Notes 5

Lisp Functions, Simple FM Synthpatch


Functions are created with defun or flet. A reason for using a general-purpose programming language in composition is to be able to manipulate detail. Control is delegated to functions, as demonstrated in FMnoon1.lisp. An algorithm specifying 12 gong tones is abstracted into a single lisp function called play-at-noon using defun. To avoid global function definition, FMnoon2.lisp defines play-at-noon using flet instead.

Simple Frequency Modulation SynthPatches

For an interactive explanation of simple (2-oscillator) FM synthesis, visit /dist/220/Apps/ Use its soundfile writing feature in conjunction with /dist/220/Apps/ to see the effect of increasing modulation index level. The gong sounds of the above FMnoon examples demonstrate inharmonic partials created with the Fm1i SynthPatch (Wave SynthPatch classes are limited to only harmonic spectra). A third example, simpleFM.lisp, contains two more algorithms for comparison of FM generated spectra, the first gives the FM version of a clarinet (odd-only harmonics) and the second takes a spin around the simple FM spectral pallette.


The example streaming1.lisp demonstrates an illusion resulting from the ear's tendency to group a rapid note sequence according to register. The "streaming effect" is encountered when a musical line of alternating registers is played slowly and then faster. You can hear multiple voices in the rapid part. Streaming also occurs for other musical reasons. Starting with streaming1.lisp, create a version with the a similar repeated sequence using 4 pitches but which are within one octave. Instead of register, give the sequence an alternation of 3 distinct timbres, for example, bright-sustained, dull-inharmonic-sustained, and bright-transient. Use envelopes and FM parameters to create the differences. A timbre streaming effect should be possible.

©1995 Fernando Lopez-Lezcano. All Rights Reserved.