CCRMA

Music 220b: Lecture Notes 2


Stella's Object Classes, Item Streams and SynthPatches

Stella Documentation

As you read these notes, you can have the Stella reference manual open in another Web browser window. Explanations of this week's Stella concepts can be read there, also Stella has good online help that starts from typing `?'.

Containers, containers, containers and Item Streams

The .cm file "Opus1" should be by now playable and modifiable. It contains two objects of class "thread" which each contain a sequence of objects of class "midi-note." These threads could have been filled any number of ways, playing a keyboard, typing in the data for each note or by automated process. Below is the Lisp code to create a thread by process which contains a sequence of "note" objects, the kind used to describe MusicKit events, in this case notes on the Pluck synthpatch.

   (thread plucktest ()
      (doitems (p (pitches c4 d e fs gs a c5 in random for 10))
	  (object pluck freq p rhythm .1)))
An item stream expression was used to create a list of 10 frequency values selected at random from the list of note names. You can directly fool around with such expressions to see what they produce. Please read the Lisp introduction exists and was written to "bootstrap" first time Lisp users taking 220. Please familiarize yourself with the basics presented there. A good text for the course (optional) is "Common Lisp, a Gentle Introduction to Symbolic Computation," by David Touretzky. Try out the Edit commands that pipe text directly to the Lisp window (instead of copy / paste).

MusicKit SynthPatches

The NeXT allows realtime synthesis using a small number of simultaneous voices (we play them via Scorefiles fed to the ScorePlayer application). Available instruments are synthesis algorithms called "SynthPatches" and are listed in "/LocalLibrary/Documentation/MusicKit/MusicTables.rtf" along with their parameters.

...the above example but with a different synthpatch, Fm1i and with an added feature to vary its amplitude and index parameter based on frequency...less amplitude at higher pitches...brighter sound at lower pitches...

    (thread fmtest ()
      (doitems (p (pitches c4 d e fs gs a c5 in random for 10))
	   (object fm1i freq p rhythm .1 
	       amp (expt (/ (pitch 'c4) p) 3) 	; cube of ratio of c4:freq
	       m1ind1 (* 6 (/ (pitch 'c4) p)) 	; constant of 6 times ratio of c4:freq
	       )))

Assignment

Write a short example of musical canon using different MusicKit instruments. Use rhythmic augmentation and pitch transposition. At least 3 voices should be used in parallel, created in separate threads. Complete the assignment to your own satisfaction. Turn in a .score file and a .lisp file (with your lisp code) to "nando@ccrma.stanford.edu". Files are attached to email by simply dragging their icon into the mail text that you are sending. Give the email a relevant subject heading, like "HW2".


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