music composition

Here are a few compositions I created between Sept. and Dec. 2003, using Nyquist. The compositions use a few samples, which are documented in the code or in the adjoining notes. I also use gran.lsp which
you can find in the Nyquist distribution. Between June and Aug. 2003, I was playing with CSOUND.

NOTES on Using Nyquist on OSX (also useful hints if you port
Nyquist to new platforms)

(0) Be sure to set XLISPPATH to the location of your Nyquist runtime
and libraries. E.g., in C shell:

setenv XLISPPATH /Applications/nyquist/runtime:/Applications/nyquist/lib

(1) Save yourself a lot of trouble of dealing with Nyquist interacting
directly with your sound device, and insert

(sound-off)

in runtime/init.lsp in the Nyquist distribution directory. This will
prevent direct audio output (which you’ll eventually learn is more
of a bane than a feature, since the first rendering of a composition
is not yet normalized, so you’ll have clipping-distortion galore)

(2) Be aware that you will usually have to render your composition
twice, the first time Nyquist determines the peak and a normalization
factor, and the second time, your sound is normalized using that
normalization factor. On the first run of “Opstel 3″ below, you will
get something like:

AutoNorm: peak was 34.8602,
     peak after normalization was 34.8602,
     new normalization factor is 0.0258174

and on the second run, Nyquist will normalize the audio
so your peak amplitude is not 34x (line 2, above) the maximum, but rather a sane
value like 0.9 of the maximum amplitude (as shown in line 2 below):

AutoNorm: peak was 34.8602,
     peak after normalization was 0.9,
     new normalization factor is 0.0258174

(3) The rendered sound file, in “.wav” format, will be in the
file named yourusername-tmp.wav. E.g., when I do a rendereing,
the output file is “pip-tmp.wav”.

(4) What I do is, i usually leave a copy of Quicktime player
open on the output file as I tweak a piece, replaying whenever
i re-render (remember, render 2 times). If the length of the piece
changes however, you have to re-click on the output .wav to restart
quicktime. All fairly obvious but worth saying nonetheless.

(5) Don’t use the “(replay)” or “(r)” function. It will cause sound to
be output directly to the audio subsystem, defeating all the work
we’re doing not to get the sound not to go to the soundcard, invariably
severely buggering OSX sound system (and your ears)!

(6) given a Nyquist composition in a file, e.g. “opstel3.lsp”,
at the Nyquist Xlisp prompt:

> (load "opstel.lsp")
; loading "opstel.lsp"
Saving sound file to ./pip-temp.wav


Samples:

fire.wav. This is a recording of the fire alarm test in Hamerschlag Hall, Second Floor. A rather noisy recording with some distortion. This sample is used in “Het Vuren”.

laura-message-fred.aiff. Text to speech synthesis applied to a message from a friend of a friend.


Title: Opstel 3

Notes: none.

;;
;;	Title: "Opstel 3"	
;;


;;	Oscillating pan, will pan a sound from left to right,
;;	starting at whatever phase,  of the pan, 
;;	(actually, shift-time doesnt what we want (phase))
(defun oscpan (somesound wobblerate phase)
	(let '(sndlen (snd-stop-time somesound))
		(pan somesound (shift-time (lfo wobblerate sndlen) phase))
	)
)


;;	A 'snare' like sound (?!) by hpf'ing white noise
;;	and applying an envelope to it:
(defun snare ()
	(mult (pwl 0.01 1 0.08 0)(hp (noise 0.09) 15000.0))
)


;;	Play the snare instrument
(defun playsnare ()
	(mult (pwl 0.01 1 0.45 1 0.48 0) (scale 0.5 (pan 1.0 (seq 
				(snare)(snare)(snare)(snare)(snare)(snare)
				))))
)


;;	Try to create a melody instrument
(defun keys (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.9 duration) 1 duration 0)
		(mult 
			(osc pitch duration)
			(osc pitch duration)
			(osc pitch duration)
			(osc (+ 1 pitch) duration)
		)
	)
)

;;	Just so we can alter the length of time for which we play
(defun hhgoa (playlen)
	(sim
		(scale 0.6 (oscpan (mult 	(scale 20 (lfo 1.0 playlen))
				(osc 31 playlen)(osc (* 31 1.414) playlen)
				(osc 33 playlen)(osc (* 33 1.414) playlen)
				(osc 37 playlen)(osc (* 37 1.414) playlen)
			) 0.5 0))
		(scale 0.4 (oscpan (mult (scale 35 (lfo 1.0 playlen))
				(osc 30 playlen)(osc 31 playlen)(osc 33 playlen)
			) 1 1))
		(at 0 (playsnare))
		(at 1 (playsnare))
		(at 3 (playsnare))
		(at 4 (playsnare))
		(at 4.5 (playsnare))
		(at 6 (playsnare))
		(at 7 (playsnare))
		(at 7.5 (playsnare))

		(at 0.0 (keys c4 1))
		(at 0.5 (keys d4 1))
		(at 1.0 (keys c4 1))
		(at 1.5 (keys b4 1))

		(at 2.5 (keys a4 1))
		(at 3.0 (keys c4 1))
		(at 3.5 (keys a4 1))
		(at 4.0 (keys c4 1))
		(at 4.5 (keys b4 1))
		(at 4.7 (keys a4 1))
		(at 4.8 (keys c4 1))

		(at 5.5 (scale 3 (keys c3 1)))
		(at 6.0 (scale 3 (keys d3 1)))
		(at 6.5 (scale 3 (keys c3 1)))
		(at 7.0 (scale 3 (keys b2 1)))

		(at 7.8 (scale 3 (keys a2 2)))
	)
)

(play (hhgoa 10.0))

Title: Het Vuren (Holle ohne ausweg)

Notes: You are stuck in a burning
building, with mean spirited robots prodding you with sharpened pencils.

;;
;;	Title: "Het Vuren (Holle ohne ausweg)"
;;

;;
;;	We use the lib/reverb.lsp library
;;
(if (not (boundp 'reverb))
	(load "lib/reverb.lsp")
)


(defun fibonacci-wave ()
	(setf *fibonacci-table*
		(sim
			(scale 0.1 (build-harmonic 0 2048))
			(scale 0.1 (build-harmonic 1 2048))
			(scale 0.2 (build-harmonic 1 2048))
			(scale 0.3 (build-harmonic 2 2048))
			(scale 0.5 (build-harmonic 3 2048))
			(scale 0.8 (build-harmonic 5 2048))
			(scale 0.01 (build-harmonic 8 2048))
			(scale 0.01 (build-harmonic 1 2048))
			(scale 0.02 (build-harmonic 2 2048))
			(scale 0.03 (build-harmonic 3 2048))
			(scale 0.05 (build-harmonic 4 2048))
			(scale 0.08 (build-harmonic 5 2048))			
			(scale 0.13 (build-harmonic 6 2048))))
(setf *fibonacci-table* (list *fibonacci-table* (hz-to-step 1) T)))

(if (not (boundp '*fibonacci-table*)) (fibonacci-wave))


;;
;;	This is the oscillating pan i wrote for opstel 3, revamped.
;;	Oscillating pan, will pan a sound from left to right,
;;	starting at whatever phase,  of the pan, (actually,
;;	shift-time doesn't really do what we want (phase))
;;
(defun oscpan (somesound wobblerate phase)
	(let '(sndlen (snd-stop-time somesound))
		(pan somesound (shift-time (lfo wobblerate sndlen) phase))
	)
)

;;
;;	This is a wrapper for play, to bandpass filter the final
;;	sound to prevent aliasing and the effect of very low
;;	frequencies on Nyquist's normalisation. Works only on mono sounds
;;	
(defun	mplay (somesound)
	(let '(filtsnd (lp (hp somesound 20000) 20))
	(let '(sndlen (snd-stop-time somesound))
		(play 
			(mult
				(pwl (* 0.1 sndlen) 1 (* 0.9 sndlen) 1 sndlen)
				filtsnd
			)
		)
	))
)


;;
;;	Improved (from opstel 3) percussive instrument.
;;
(defun instrument0 ()
	(mult (pwl 0.01 1 0.08 0 0.09) (hp (noise 0.09) 15000.0))
)


;;	Play the percussive instrument
(defun i0 ()
	(mult (pwl 0.01 1 0.45 1 0.54) (scale 0.3 (oscpan (seq 
				(instrument0)(instrument0)
				(instrument0)(instrument0)
				(instrument0)(instrument0)
				) 4.0 0)))
)

;;
;;	Instrument 1, Using Ring Modulation. There are 16 sinusoids
;;	with the frequencies determined by a Fibonacci Sequence. The
;;	resulting sound is like the 'crackle and pop' from a vinyl
;;	record. This was an accidental discovery. I was trying to make
;;	something 'melodic'. The pitch parameter affects the pitch of
;;	the crackle.
;;
(defun i1 (pitch duration)
		(scale 0.6 (reverb (mult 
			(osc (hz-to-step (+ 0 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 2 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 3 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 5 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 8 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 13 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 21 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 34 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 55 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 89 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 144 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 233 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 377 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 610 (step-to-hz pitch))) duration)
		) 6))
)


;;
;;	fm-lfo from class
;;
(defun fm-lfo (amp freq)
	(sound-srate-abs *default-control-srate*
		(mult amp (hzosc freq))
	)
)


;;
;;	Instrument 2, FM Synthesis, sine table
;;
(defun i2 (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.9 duration) 1 duration)
	(stretch duration
		(fmosc pitch (fm-lfo c2 (mult (pwl 1 1000 1)(osc d4))))
	)
	)
)


;;
;;	Instrument 4, FM Synthesis, custom table
;;
(defun i4 (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.9 duration) 1 duration)
	(stretch duration
		(fmosc pitch (fm-lfo a2 (mult (pwl 1 1000 1)(osc b2))) *fibonacci-table*)
	)
	)
)

;;
;;	Instrument 1, Using Ring Modulation. There are 16 sinusoids
;;	with the frequencies determined by a Fibonacci Sequence. The
;;	resulting sound is like the 'crackle and pop' from a vinyl
;;	record. This was an accidental discovery. I was trying to make
;;	something 'melodic'. The pitch parameter affects the pitch of
;;	the crackle.
;;
(defun i5 (pitch duration)
		(mult (pwl (* 0.01 duration) 1 (* 0.9 duration) 1 duration)
		(reverb (mult 
			(osc (+ pitch 0) duration)
			(osc (+ pitch 1) duration)
			(osc (+ pitch 3) duration)
			(osc (+ pitch 5) duration)
		) 10)
		)
)


;;
;;	Don't we all think Grid computing is a joke ? Read sample from file
;;
(if (not (boundp 'a-snd))
	(setf a-snd
		(s-read "fire.wav" :srate 44100.0)
	)
)

;;
;;	Just so we can alter the length of time for which we play
;;	'at' only takes mono sounds, so we use the phase (really, offset)
;;	in oscpan to get 'at' behavior
;;
(defun rabbits (playlen)
	(sim
		(at 0	(oscpan (scale 0.2 (i1 c0 playlen)) 0.10 0))
		(at 0	(oscpan (scale 0.2 (i1 c4 playlen)) 0.10 0))
		(at 1	(oscpan (scale 0.2 (i1 c1 1)) 0.10 0))
		(at 1	(oscpan (scale 0.2 (i1 c2 1)) 0.20 0))
		(at 2	(oscpan (scale 0.2 (i1 c3 2)) 0.30 0))
		(at 3	(oscpan (scale 0.2 (i1 c4 3)) 0.50 0))
		(at 5	(oscpan (scale 0.2 (i1 c3 5)) 0.80 0))
		(at 8	(oscpan (scale 0.2 (i1 c2 8)) 0.130 0))
		(at 13	(oscpan (scale 0.2 (i1 c3 13)) 0.210 0))
		(at 21	(oscpan (scale 0.2 (i1 c1 21)) 0.340 0))

		;;	FM
		(at 10.0	(oscpan (i2 b0 1.0) 0.0 0))
		(at 11.0	(oscpan (i4 b1 1.0) 1.0 0))
		(at 11.0	(oscpan (i2 b2 2.0) 2.0 0))
		(at 12.0	(oscpan (i2 c2 3.0) 3.0 0))
		(at 13.0	(oscpan (i2 cs2 5.0)5.0 0))

		(at 25.0	(oscpan (i4 cs2 1.0) 1.0 0))
		(at 26.0	(oscpan (i2 d0 1.0)  0.0 0))
		(at 26.0	(oscpan (i2 c3 2.0)  0.0 0))
		(at 27.0	(oscpan (i2 c2 3.0)  3.0 0))
		(at 27.0	(oscpan (i2 c2 5.0)  0.0 0))


		;;
		(at 31.0	(mult (pwl 0.01 1 0.45 1 0.5) 
			(scale 0.1 (reverb (seq (i5 d4 0.125)
			(i5 c2 0.125)(i5 d4 0.125)(i5 c3 0.125)) 4.0))))

		(at 35.0	(oscpan (mult (pwl 0.01 1 0.85 1 1.0) 
			(scale 0.1 (reverb (seq (i5 b4 0.25)(i5 a2 0.25)
			(i5 b4 0.25)(i5 a3 0.25)) 2.0))) 0.5 0))

		(at 45.0	(oscpan (mult (pwl 0.01 1 0.75 1 1.0) 
			(scale 0.1 (reverb (seq (i5 c4 0.25)(i5 c2 0.25)
			(i5 c4 0.25)(i5 c3 0.25)) 5.0))) 1 0))
		
		(at 48.0	(mult (pwl 0.01 1 0.45 1 0.5) 
			(scale 0.1 (reverb (seq (i5 b4 0.125)(i5 a2 0.125)
			(i5 b4 0.125)(i5 a3 0.125)) 2.0))))

		(at 49.0	(mult (pwl 0.01 1 0.45 1 0.5) 
			(scale 0.1 (reverb (seq (i5 b4 0.125)
			(i5 a2 0.125)(i5 b4 0.125)(i5 a3 0.125)) 3.0))))

		(at 52.0	(scale 0.6 (oscpan (mult 
			(pwl 0.01 1 0.75 1.9 2.0) (scale 0.1 
			(reverb (seq (i5 c4 0.25)(i5 c2 0.25)(i5 c4 0.25)
			(i5 c3 0.25)(i5 c2 0.25)(i5 cs2 0.25)(i5 c1 0.25)
			(i5 b1 0.25) ) 0.6))) 2 0)))

		;;	Rapid snare trills
		(at 30.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 0.5)))
		(at 31.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 1.5)))
		(at 31.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 0.5)))
		(at 32.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 0.5)))
		(at 33.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 3.5)))
		(at 35.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 0.5)))
		(at 38.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 2.5)))
		(at 40.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 0.5)))
		(at 41.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 8.5)))
		(at 41.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 0.5)))
		(at 42.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 1.5)))
		(at 43.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 0.5)))
		(at 45.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 0.5)))
		(at 49.0	(mult (pwl 0.01 0.7 2.4 0.7 2.7) (reverb (seq (i0)(i0)(i0)(i0)(i0)) 2.5)))

		;;	Samples from file
		(at 49.5		(sound a-snd))
	)
)

;;
;;	Wrap play, to bandpass filter the final sound
;;	to prevent aliasing and the effect of very low
;;	frequencies on Nyquist's normalisation
;;
(play (mult (pwl 0.1 1 59 0.8 60) (lp (hp (rabbits 60.0) 20000) 35)))

Title: Hartverscheurend, Jij Weerzinwekkend Smeerlap!

Notes: none.

;;
;;	Title: "Hartverscheurend, Jij Weerzinwekkend Smeerlap!"
;;

;;
;;	To prevent it from playing out loud when rendering
;;
(sound-off)

;;
;;	We use the lib/reverb.lsp library
;;
(if (not (boundp 'reverb))
	(load "lib/reverb.lsp")
)

;;
;;	We use gran.lsp
;;
(if (not (boundp 'sf-granulate))
	(load "gran.lsp")
)

(defun x-wave ()
	(setf *x-table*
		(sim
			(scale 0.1 (build-harmonic 0 25))
			(scale 0.1 (build-harmonic 1 50))
			(scale 0.2 (build-harmonic 1 75))
			(scale 0.3 (build-harmonic 2 100))
			(scale 0.5 (build-harmonic 3 125))
			(scale 0.03 (build-harmonic 34 16))
			(scale 0.05 (build-harmonic 55 4096))
			(scale 0.08 (build-harmonic 89 12))			
			(scale 0.13 (build-harmonic 144 13))))
(setf *x-table* (list *x-table* (hz-to-step 1) T)))

(if (not (boundp '*x-table*)) (x-wave))



;;
;;	Oscillating pan, will pan a sound from left to right,
;;	starting at whatever phase,  of the pan, (actually,
;;	shift-time doesn't really do what we want (phase))
;;
(defun oscpan (somesound wobblerate phase)
	(let '(sndlen (snd-stop-time somesound))
		(pan somesound (shift-time (lfo wobblerate sndlen) phase))
	)
)



;;
;;	fm-lfo from class
;;
(defun fm-lfo (amp freq)
	(sound-srate-abs *default-control-srate*
		(mult amp (hzosc freq))
	)
)

;;
;;	Instrument 1 from previous composition, same concept, but modified
;;
(defun i1 (pitch duration)
		(scale 0.9 (reverb (mult 
			(osc (hz-to-step (+ 0 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 3 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 8 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 21 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 55 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 144 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 610 (step-to-hz pitch))) duration)
		) 10))
)

;;
;;	This is the "fire" instrument developed for previous composition
;;
(defun i2 (pitch duration)
		(scale 0.6 (reverb (mult 
			(osc (hz-to-step (+ 0 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 2 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 3 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 5 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 8 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 13 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 21 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 34 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 55 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 89 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 144 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 233 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 377 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 610 (step-to-hz pitch))) duration)
		) 6))
)

;;
;;	Instrument 3, FM Synthesis, sine table
;;
(defun i3 (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.8 duration) 1 duration)
	(stretch duration
		(fmosc pitch (fm-lfo c2 (mult (pwl 0.001 64 0.2 32 1 1024 1.0001)(osc c4))))
	)
	)
)


;;
;;	Instrument 4, AM Synthesis, custom table
;;
(defun i4 (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.8 duration) 1 duration)
	(stretch duration
		(amosc pitch (fm-lfo a0 (mult (pwl 0.2 0.5 1 2048 1.0001)(osc d0))) *x-table*)
	)
	)
)


;;
;;	Drone
;;
(defun drone (playlen)
	(sim
		(at 0	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.1 (i1 c0 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.2 (i1 c1 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.4 (i1 c1 playlen)) 0.20 0)))
		(at 2	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.8 (i1 c2 playlen)) 0.30 0)))
		(at 3	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.1 (i1 c3 playlen)) 0.50 0)))
		(at 5	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.2 (i1 c5 playlen)) 0.80 0)))
		(at 8	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.3 (i1 a0 playlen)) 1.30 0)))
		(at 13	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.4 (i1 a1 playlen)) 2.10 0)))
		(at 21	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.2 (i1 a1 playlen)) 3.40 0)))
		(at 34	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.4 (i1 a2 playlen)) 5.50 0)))
		(at 55	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.6 (i1 a3 playlen)) 0.89 0)))
		(at 89	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.8 (i1 a5 playlen)) 0.14 0)))
		(at 144	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.1 (i1 d0 playlen)) 0.23 0)))
		(at 233	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.5 (i1 d1 playlen)) 0.37 0)))
		(at 177	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 1.0 (i1 d0 playlen)) 0.01 0)))
	)
)


;;
;;	Fire. Same notes as drone, different offsets.
;;
(defun fire (playlen)
	(sim
		(at 0	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c0 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.6 (i2 c1 playlen)) 0.10 1)))
		(at 1	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.8 (i2 c1 playlen)) 0.20 1)))
		(at 2	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c2 playlen)) 0.30 2)))
		(at 3	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c3 playlen)) 0.50 3)))
		(at 5	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.6 (i2 c5 playlen)) 0.80 5)))
		(at 8	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.7 (i2 a0 playlen)) 1.30 8)))
		(at 13	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.9 (i2 a1 playlen)) 2.10 13)))
		(at 21	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 1.3 (i2 a1 playlen)) 3.40 21)))
		(at 34	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.4 (i2 a2 playlen)) 5.50 3.4)))
		(at 55	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 a3 playlen)) 0.89 5.5)))
		(at 89	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.6 (i2 a5 playlen)) 0.14 8.9)))
		(at 144	(mult (pwl (* 0.96 playlen) 1 playlen)(oscpan (scale 1.5 (i2 d0 playlen)) 0.23 14.4)))
		(at 233	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 1.0 (i2 d1 playlen)) 0.37 0.3)))
		(at 177	(mult (pwl (* 0.98 playlen) 1 playlen)(oscpan (scale 1.6 (i2 d0 playlen)) 0.01 23.7)))
		(at 277	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 1.1 (i2 d0 playlen)) 4.0 0.7)))
	)
)



;;
;;	All of the following samples are taken from the IBM "Grid Computing"
;;	introductory video. (http://www-1.ibm.com/grid/index.shtml)
;;
(if (not (boundp '1-snd))
	(setf 1-snd
		(s-read "atanytime.wav" :srate 44100.0)
	)
)

(if (not (boundp '2-snd))
	(setf 2-snd
		(s-read "battlecreature.wav" :srate 44100.0)
	)
)

(if (not (boundp '3-snd))
	(setf 3-snd
		(s-read "chicago.wav" :srate 44100.0)
	)
)

(if (not (boundp '4-snd))
	(setf 4-snd
		(s-read "doinwhatalreadydoin.wav" :srate 44100.0)
	)
)

(if (not (boundp '5-snd))
	(setf 5-snd
		(s-read "evryoneconectedtoit.wav" :srate 44100.0)
	)
)

(if (not (boundp '6-snd))
	(setf 6-snd
		(s-read "faster.wav" :srate 44100.0)
	)
)

(if (not (boundp '7-snd))
	(setf 7-snd
		(s-read "hereinpennsylvnia.wav" :srate 44100.0)
	)
)

(if (not (boundp '8-snd))
	(setf 8-snd
		(s-read "ibmcanbuildgrid4u.wav" :srate 44100.0)
	)
)

(if (not (boundp '9-snd))
	(setf 9-snd
		(s-read "securityofrecords.wav" :srate 44100.0)
	)
)

(if (not (boundp '10-snd))
	(setf 10-snd
		(s-read "theyunderstandglobus.wav" :srate 44100.0)
	)
)

(setf 1-name "atanytime.wav" :srate 44100.0)

(setf 2-name "battlecreature.wav" :srate 44100.0)

(setf 3-name "chicago.wav" :srate 44100.0)

(setf 4-name "doinwhatalreadydoin.wav" :srate 44100.0)

(setf 5-name "evryoneconectedtoit.wav" :srate 44100.0)

(setf 6-name "faster.wav" :srate 44100.0)

(setf 7-name "hereinpennsylvnia.wav" :srate 44100.0)

(setf 8-name "ibmcanbuildgrid4u.wav" :srate 44100.0)

(setf 9-name "securityofrecords.wav" :srate 44100.0)

(setf 10-name "theyunderstandglobus.wav" :srate 44100.0)

(setf 11-name "flim-break1.wav" :srate 44100.0)

(setf 12-name "flim-break2.wav" :srate 44100.0)

(setf 13-name "flim-break3.wav" :srate 44100.0)


(defun all ()
	(sim
		;;	Granular Drum breaks
		(at 0 (mult (pwl 3 1 15 1 17) (reverb	(seq
				(stretch 5 (sf-granulate 11-name 0.3 0.1 0.1 0.001 1.2 0 0))
				(stretch 5 (sf-granulate 12-name 0.3 0.1 0.1 0.001 1.2 0 0))
				(stretch 5 (sf-granulate 13-name 0.3 0.1 0.1 0.001 1.2 0 0))
			) 5)
		))

		;;	AM synth
                (at 10.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))
                (at 10.5 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.81 (i3 d4 2)) 0.10 0)))
                (at 11.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))
                (at 11.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 b4 2)) 0.10 0)))
                (at 12.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 a4 2)) 0.10 0)))
                (at 13.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))
                (at 13.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 a4 2)) 0.10 0)))
                (at 14.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))
                (at 14.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 b4 2)) 0.10 0)))
                (at 14.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 a4 2)) 0.10 0)))
                (at 14.8 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))


		;;	Granular vocal samples
		(at 30 (seq
			(stretch 10 (sf-granulate 1-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 2-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 3-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 4-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 5-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 6-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 7-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 8-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 9-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 10-name 0.3 0.1 0.1 0.001 1.2 0 0))
			)
		)

		;;	Perpetual drone and "fire balls" of different kinds
		(at 0	(drone 100))
		(at 50	(fire 70))


		;;	Clean vocal samples
		(at 5	(scale 0.5 (oscpan (cue 4-snd) 0.1 0)))
		(at 10	(scale 0.6 (oscpan (seq (cue 4-snd)(cue 1-snd)(cue 6-snd)) 0.1 0)))
		(at 110	(scale 0.6 (oscpan (seq (cue 4-snd)(cue 1-snd)(cue 7-snd)) 0.2 0)))
		(at 160	(scale 1.0 (oscpan (seq (cue 8-snd)(cue 1-snd)(cue 6-snd)) 3.0 0)))
		(at 200	(scale 1.3 (reverb (oscpan (seq (cue 6-snd)(cue 6-snd)
			(cue 6-snd)(cue 6-snd)(cue 6-snd)) 3.0 0) 10)))
		(at 300	(mult (pwl 0.5 1 20 1 26) (scale 1.0 
			(oscpan (seq (cue 8-snd)(cue 7-snd)(cue 10-snd)
			(cue 10-snd)(cue 10-snd)(cue 10-snd)(cue 10-snd)
			(cue 10-snd)(cue 10-snd)(cue 10-snd)(cue 10-snd)
			(cue 10-snd)(cue 10-snd)(cue 10-snd)(cue 10-snd)
			(cue 10-snd)(cue 10-snd)) 0.2 0))))


		;;	FM synthesis
                (at 50.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))
                (at 50.5 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.51 (i3 d4 2)) 0.10 0)))
                (at 51.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))
                (at 51.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 b4 2)) 0.10 0)))
                (at 52.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 a4 2)) 0.10 0)))
                (at 53.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))
                (at 53.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 a4 2)) 0.10 0)))
                (at 54.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))
                (at 54.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 b4 2)) 0.10 0)))
                (at 54.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 a4 2)) 0.10 0)))
                (at 54.8 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))


		;;	AM synthesis
                (at 60.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))
                (at 60.5 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.71 (i4 d4 2)) 0.10 0)))
                (at 61.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))
                (at 61.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 b4 2)) 0.10 0)))
                (at 62.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 a4 2)) 0.10 0)))
                (at 63.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))
                (at 63.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 a4 2)) 0.10 0)))
                (at 64.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))
                (at 64.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 b4 2)) 0.10 0)))
                (at 64.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 a4 2)) 0.10 0)))
                (at 64.8 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))


		;;	Another batch of granular drum breaks @ t=100s
		(at 100 (mult (pwl 3 1 20 1 25) (reverb	(seq
				(stretch 15 (sf-granulate 12-name 0.3 0.2 0.1 0.001 1.2 0 0))
				(stretch 15 (sf-granulate 13-name 0.3 0.2 0.1 0.001 0.2 0 0))
				(stretch 15 (sf-granulate 11-name 0.3 0.2 0.1 0.001 1.2 0 0))
			) 1)
		))


		;;	More granular drums @ t=250s
		(at 250 (mult (pwl 3 1 20 1 25) (reverb	(seq
				(stretch 10 (sf-granulate 12-name 0.3 0.1 0.1 0.001 1.2 0 0))
				(stretch 5 (sf-granulate 11-name 0.3 0.1 0.1 0.001 1.2 0 0))
				(stretch 10 (sf-granulate 13-name 0.3 0.1 0.1 0.001 1.2 0 0))
			) 10)
		))


		;;	Batch of odd ringmod melody
                (at 300.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 300.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 d4 2)) 0.10 0)))
                (at 301.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 301.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 b4 2)) 0.10 0)))
                (at 302.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 a4 2)) 0.10 0)))
                (at 303.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 303.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 a4 2)) 0.10 0)))
                (at 304.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 304.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 b4 2)) 0.10 0)))
                (at 304.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 a4 2)) 0.10 0)))
                (at 304.8 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
	)
)

(play (all))

Title: Hakblok

Notes: Yes.

;;
;;	Title: "Hakblok"
;;

;;
;;	To prevent it from playing out loud when rendering
;;
(sound-off)

;;
;;	We use the lib/reverb.lsp library
;;
(if (not (boundp 'reverb))
	(load "lib/reverb.lsp")
)

;;
;;	We use gran.lsp
;;
(if (not (boundp 'sf-granulate))
	(load "gran.lsp")
)

(defun x-wave ()
	(setf *x-table*
		(sim
			(scale 0.1 (build-harmonic 0 25))
			(scale 0.1 (build-harmonic 1 50))
			(scale 0.2 (build-harmonic 1 75))
			(scale 0.3 (build-harmonic 2 100))
			(scale 0.5 (build-harmonic 3 125))
			(scale 0.03 (build-harmonic 34 16))
			(scale 0.05 (build-harmonic 55 4096))
			(scale 0.08 (build-harmonic 89 12))			
			(scale 0.13 (build-harmonic 144 13))))
(setf *x-table* (list *x-table* (hz-to-step 1) T)))

(if (not (boundp '*x-table*)) (x-wave))



;;
;;	This is the oscillating pan i wrote for hw3, revamped.
;;	Oscillating pan, will pan a sound from left to right,
;;	starting at whatever phase,  of the pan, (actually,
;;	shift-time doesn't really do what we want (phase))
;;
(defun oscpan (somesound wobblerate phase)
	(let '(sndlen (snd-stop-time somesound))
		(pan somesound (shift-time (lfo wobblerate sndlen) phase))
	)
)



;;
;;	fm-lfo from class
;;
(defun fm-lfo (amp freq)
	(sound-srate-abs *default-control-srate*
		(mult amp (hzosc freq))
	)
)

;;
;;	Instrument 1 from previous composition, same concept, but modified
;;
(defun i1 (pitch duration)
		(scale 0.9 (reverb (mult 
			(osc (hz-to-step (+ 0 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 3 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 8 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 21 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 55 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 144 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 610 (step-to-hz pitch))) duration)
		) 10))
)

;;
;;	This is the "fire" instrument developed for previous composition
;;
(defun i2 (pitch duration)
		(scale 0.6 (reverb (mult 
			(osc (hz-to-step (+ 0 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 2 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 3 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 5 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 8 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 13 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 21 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 34 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 55 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 89 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 144 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 233 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 377 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 610 (step-to-hz pitch))) duration)
		) 6))
)

;;
;;	Instrument 3, FM Synthesis, sine table
;;
(defun i3 (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.8 duration) 1 duration)
	(stretch duration
		(fmosc pitch (fm-lfo c2 (mult (pwl 0.001 64 0.2 32 1 1024 1.0001)(osc c4))))
	)
	)
)


;;
;;	Instrument 4, AM Synthesis, custom table
;;
(defun i4 (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.8 duration) 1 duration)
	(stretch duration
		(amosc pitch (fm-lfo a0 (mult (pwl 0.2 0.5 1 2048 1.0001)(osc d0))) *x-table*)
	)
	)
)


;;
;;	Drone
;;
(defun drone (playlen)
	(sim
		(at 0	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.1 (i1 c0 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.2 (i1 c1 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.4 (i1 c1 playlen)) 0.20 0)))
		(at 2	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.8 (i1 c2 playlen)) 0.30 0)))
		(at 3	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.1 (i1 c3 playlen)) 0.50 0)))
		(at 5	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.2 (i1 c5 playlen)) 0.80 0)))
		(at 8	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.3 (i1 a0 playlen)) 1.30 0)))
		(at 13	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.4 (i1 a1 playlen)) 2.10 0)))
		(at 21	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.2 (i1 a1 playlen)) 3.40 0)))
		(at 34	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.4 (i1 a2 playlen)) 5.50 0)))
		(at 55	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.6 (i1 a3 playlen)) 0.89 0)))
		(at 89	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.8 (i1 a5 playlen)) 0.14 0)))
		(at 144	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.1 (i1 d0 playlen)) 0.23 0)))
		(at 233	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.5 (i1 d1 playlen)) 0.37 0)))
		(at 177	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 1.0 (i1 d0 playlen)) 0.01 0)))
	)
)


;;
;;	Fire. Same notes as drone, different offsets.
;;
(defun fire (playlen)
	(sim
		(at 0	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c0 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.6 (i2 c1 playlen)) 0.10 1)))
		(at 1	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.8 (i2 c1 playlen)) 0.20 1)))
		(at 2	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c2 playlen)) 0.30 2)))
		(at 3	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c3 playlen)) 0.50 3)))
		(at 5	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.6 (i2 c5 playlen)) 0.80 5)))
		(at 8	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.7 (i2 a0 playlen)) 1.30 8)))
		(at 13	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.9 (i2 a1 playlen)) 2.10 13)))
		(at 21	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 1.3 (i2 a1 playlen)) 3.40 21)))
		(at 34	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.4 (i2 a2 playlen)) 5.50 3.4)))
		(at 55	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 a3 playlen)) 0.89 5.5)))
		(at 89	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.6 (i2 a5 playlen)) 0.14 8.9)))
		(at 144	(mult (pwl (* 0.96 playlen) 1 playlen)(oscpan (scale 1.5 (i2 d0 playlen)) 0.23 14.4)))
		(at 233	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 1.0 (i2 d1 playlen)) 0.37 0.3)))
		(at 177	(mult (pwl (* 0.98 playlen) 1 playlen)(oscpan (scale 1.6 (i2 d0 playlen)) 0.01 23.7)))
		(at 277	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 1.1 (i2 d0 playlen)) 4.0 0.7)))
	)
)



;;
;;	All of the following samples are taken from the IBM "Grid Computing"
;;	introductory video. (http://www-1.ibm.com/grid/index.shtml)
;;
(if (not (boundp '1-snd))
	(setf 1-snd
		(s-read "atanytime.wav" :srate 44100.0)
	)
)

(if (not (boundp '2-snd))
	(setf 2-snd
		(s-read "battlecreature.wav" :srate 44100.0)
	)
)

(if (not (boundp '3-snd))
	(setf 3-snd
		(s-read "chicago.wav" :srate 44100.0)
	)
)

(if (not (boundp '4-snd))
	(setf 4-snd
		(s-read "doinwhatalreadydoin.wav" :srate 44100.0)
	)
)

(if (not (boundp '5-snd))
	(setf 5-snd
		(s-read "evryoneconectedtoit.wav" :srate 44100.0)
	)
)

(if (not (boundp '6-snd))
	(setf 6-snd
		(s-read "faster.wav" :srate 44100.0)
	)
)

(if (not (boundp '7-snd))
	(setf 7-snd
		(s-read "hereinpennsylvnia.wav" :srate 44100.0)
	)
)

(if (not (boundp '8-snd))
	(setf 8-snd
		(s-read "ibmcanbuildgrid4u.wav" :srate 44100.0)
	)
)

(if (not (boundp '9-snd))
	(setf 9-snd
		(s-read "securityofrecords.wav" :srate 44100.0)
	)
)

(if (not (boundp '10-snd))
	(setf 10-snd
		(s-read "theyunderstandglobus.wav" :srate 44100.0)
	)
)

(setf 1-name "atanytime.wav" :srate 44100.0)

(setf 2-name "battlecreature.wav" :srate 44100.0)

(setf 3-name "chicago.wav" :srate 44100.0)

(setf 4-name "doinwhatalreadydoin.wav" :srate 44100.0)

(setf 5-name "evryoneconectedtoit.wav" :srate 44100.0)

(setf 6-name "faster.wav" :srate 44100.0)

(setf 7-name "hereinpennsylvnia.wav" :srate 44100.0)

(setf 8-name "ibmcanbuildgrid4u.wav" :srate 44100.0)

(setf 9-name "securityofrecords.wav" :srate 44100.0)

(setf 10-name /theyunderstandglobus.wav" :srate 44100.0)

(setf 11-name /flim-break1.wav" :srate 44100.0)

(setf 12-name /flim-break2.wav" :srate 44100.0)

(setf 13-name /flim-break3.wav" :srate 44100.0)


(defun all ()
	(sim
		;;	Granular Drum breaks
		(at 0 (mult (pwl 3 1 15 1 17) (reverb	(seq
				(stretch 5 (sf-granulate 11-name 0.3 0.1 0.1 0.001 1.2 0 0))
				(stretch 5 (sf-granulate 12-name 0.3 0.1 0.1 0.001 1.2 0 0))
				(stretch 5 (sf-granulate 13-name 0.3 0.1 0.1 0.001 1.2 0 0))
			) 5)
		))

		;;	AM synth
                (at 10.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))
                (at 10.5 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.81 (i3 d4 2)) 0.10 0)))
                (at 11.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))
                (at 11.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 b4 2)) 0.10 0)))
                (at 12.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 a4 2)) 0.10 0)))
                (at 13.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))
                (at 13.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 a4 2)) 0.10 0)))
                (at 14.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))
                (at 14.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 b4 2)) 0.10 0)))
                (at 14.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 a4 2)) 0.10 0)))
                (at 14.8 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.81 (i3 c4 2)) 0.10 0)))


		;;	Granular vocal samples
		(at 30 (seq
			(stretch 10 (sf-granulate 1-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 2-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 3-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 4-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 5-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 6-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 7-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 8-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 9-name 0.3 0.1 0.1 0.001 1.2 0 0))
			(stretch 10 (sf-granulate 10-name 0.3 0.1 0.1 0.001 1.2 0 0))
			)
		)

		;;	Perpetual drone and "fire balls" of different kinds
		(at 0	(drone 100))
		(at 50	(fire 70))


		;;	Clean vocal samples
		(at 5	(scale 0.5 (oscpan (cue 4-snd) 0.1 0)))
		(at 10	(scale 0.6 (oscpan (seq (cue 4-snd)(cue 1-snd)(cue 6-snd)) 0.1 0)))
		(at 110	(scale 0.6 (oscpan (seq (cue 4-snd)(cue 1-snd)(cue 7-snd)) 0.2 0)))
		(at 160	(scale 1.0 (oscpan (seq (cue 8-snd)(cue 1-snd)(cue 6-snd)) 3.0 0)))
		(at 200	(scale 1.3 (reverb (oscpan (seq (cue 6-snd)
			(cue 6-snd)(cue 6-snd)(cue 6-snd)(cue 6-snd)) 3.0 0) 10)))
		(at 300	(mult (pwl 0.5 1 20 1 26) (scale 1.0 
			(oscpan (seq (cue 8-snd)(cue 7-snd)(cue 10-snd)
			(cue 10-snd)(cue 10-snd)(cue 10-snd)(cue 10-snd)
			(cue 10-snd)(cue 10-snd)(cue 10-snd)(cue 10-snd)
			(cue 10-snd)(cue 10-snd)(cue 10-snd)(cue 10-snd)
			(cue 10-snd)(cue 10-snd)) 0.2 0))))


		;;	FM synthesis
                (at 50.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))
                (at 50.5 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.51 (i3 d4 2)) 0.10 0)))
                (at 51.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))
                (at 51.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 b4 2)) 0.10 0)))
                (at 52.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 a4 2)) 0.10 0)))
                (at 53.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))
                (at 53.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 a4 2)) 0.10 0)))
                (at 54.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))
                (at 54.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 b4 2)) 0.10 0)))
                (at 54.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 a4 2)) 0.10 0)))
                (at 54.8 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.51 (i3 c4 2)) 0.10 0)))


		;;	AM synthesis
                (at 60.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))
                (at 60.5 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.71 (i4 d4 2)) 0.10 0)))
                (at 61.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))
                (at 61.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 b4 2)) 0.10 0)))
                (at 62.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 a4 2)) 0.10 0)))
                (at 63.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))
                (at 63.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 a4 2)) 0.10 0)))
                (at 64.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))
                (at 64.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 b4 2)) 0.10 0)))
                (at 64.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 a4 2)) 0.10 0)))
                (at 64.8 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i4 c4 2)) 0.10 0)))


		;;	Another batch of granular drum breaks @ t=100s
		(at 100 (mult (pwl 3 1 20 1 25) (reverb	(seq
				(stretch 15 (sf-granulate 12-name 0.3 0.2 0.1 0.001 1.2 0 0))
				(stretch 15 (sf-granulate 13-name 0.3 0.2 0.1 0.001 0.2 0 0))
				(stretch 15 (sf-granulate 11-name 0.3 0.2 0.1 0.001 1.2 0 0))
			) 1)
		))


		;;	More granular drums @ t=250s
		(at 250 (mult (pwl 3 1 20 1 25) (reverb	(seq
				(stretch 10 (sf-granulate 12-name 0.3 0.1 0.1 0.001 1.2 0 0))
				(stretch 5 (sf-granulate 11-name 0.3 0.1 0.1 0.001 1.2 0 0))
				(stretch 10 (sf-granulate 13-name 0.3 0.1 0.1 0.001 1.2 0 0))
			) 10)
		))


		;;	Batch of odd ringmod melody
                (at 300.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 300.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 d4 2)) 0.10 0)))
                (at 301.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 301.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 b4 2)) 0.10 0)))
                (at 302.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 a4 2)) 0.10 0)))
                (at 303.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 303.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 a4 2)) 0.10 0)))
                (at 304.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 304.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 b4 2)) 0.10 0)))
                (at 304.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 a4 2)) 0.10 0)))
                (at 304.8 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
	)
)

(play (all))

Title: Stengelen ver 0

Notes: I received the following message from L Dvorin:


“pip:

i had a dream you had a crush on me and you were
following me around with this device you invented
that recorded my brain waves and from that
information, drew three dimensional pictures on
graph paper. when i found out i was like : ‘how long have
you been doing this?’, and all you said was: ‘my
log will hold up to seven days of information’.”

;;
;;	Title: "Stengelen ver 0"
;;


;;
;;	To prevent it from playing out loud when rendering
;;
(sound-off)


;;
;;	We use the lib/reverb.lsp library
;;
(if (not (boundp 'reverb))
	(load "reverb.lsp")
)


;;
;;	We use gran.lsp
;;
(if (not (boundp 'sf-granulate))
	(load "gran.lsp")
)


(defun x-wave ()
	(setf *x-table*
		(sim
			(scale 0.1 (build-harmonic 0 25))
			(scale 0.1 (build-harmonic 1 50))
			(scale 0.2 (build-harmonic 1 75))
			(scale 0.3 (build-harmonic 2 100))
			(scale 0.5 (build-harmonic 3 125))
			(scale 0.03 (build-harmonic 34 16))
			(scale 0.05 (build-harmonic 55 4096))
			(scale 0.08 (build-harmonic 89 12))			
			(scale 0.13 (build-harmonic 144 13))))
(setf *x-table* (list *x-table* (hz-to-step 1) T)))

(if (not (boundp '*x-table*)) (x-wave))



;;
;;	This is the oscillating pan i wrote for hw3, revamped.
;;	Oscillating pan, will pan a sound from left to right,
;;	starting at whatever phase,  of the pan, (actually,
;;	shift-time doesn't really do what we want (phase))
;;
(defun oscpan (somesound wobblerate phase)
	(let '(sndlen (snd-stop-time somesound))
		(pan somesound (shift-time (lfo wobblerate sndlen) phase))
	)
)



;;
;;	fm-lfo from class
;;
(defun fm-lfo (amp freq)
	(sound-srate-abs *default-control-srate*
		(mult amp (hzosc freq))
	)
)

;;
;;	Instrument 1 from previous composition, same concept, but modified
;;
(defun i1 (pitch duration)
		(scale 0.9 (mult 
			(osc (hz-to-step (+ 0 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 3 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 8 (step-to-hz pitch))) duration)
		))
)

;;
;;	modified "fire" instrument developed for previous compositions
;;
(defun i2 (pitch duration)
		(scale 0.6 (mult 
			(osc (hz-to-step (+ 0 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 1 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 2 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 3 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 5 (step-to-hz pitch))) duration)
			(osc (hz-to-step (+ 8 (step-to-hz pitch))) duration)
			(osc (hz-to-step (random 1024)) duration)
		))
)

;;
;;	Instrument 3, FM Synthesis, sine table
;;
(defun i3 (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.8 duration) 1 duration)
	(stretch duration
		(fmosc pitch (fm-lfo c2 (mult (pwl 0.001 64 0.2 32 1 1024 1.0001)(osc c4))))
	)
	)
)


;;
;;	Instrument 4, AM Synthesis, custom table
;;
(defun i4 (pitch duration)
	(mult (pwl (* 0.01 duration) 1 (* 0.8 duration) 1 duration)
	(stretch duration
		(amosc pitch (fm-lfo a0 (mult (pwl 0.2 0.5 1 2048 1.0001)(osc d0))) *x-table*)
	)
	)
)


;;	Play the percussive instrument
(defun ride ()
	(mult (pwl 0.01 1 0.08 0 0.09) (hp (noise 0.09) 15000.0))
)
(defun iX (pitch)
	(mult (pwl 0.01 1 0.90 1 1) (sim (i2 pitch 1.0)
                                (scale 0.7 (oscpan (seq 
				(ride)(ride)
				(ride)(ride)
				(ride)(ride)
				(ride)(ride)
				(ride)(ride)
				(ride)(ride)                                
				) 2.0 0))))
)

(defun iXs (playlen)
	(seqrep (i playlen) (iX (hz-to-step (* i (random 64)))))
)

;;
;;	Drone
;;
(defun drone (playlen)
	(sim
		(at 0	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.1 (i1 c0 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.2 (i1 c1 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.4 (i1 c1 playlen)) 0.20 0)))
		(at 2	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.8 (i1 c2 playlen)) 0.30 0)))
		(at 3	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.1 (i1 c3 playlen)) 0.50 0)))
		(at 5	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.2 (i1 c5 playlen)) 0.80 0)))
		(at 8	(mult (pwl (* 0.80 playlen) 1 playlen)(oscpan (scale 0.3 (i1 a0 playlen)) 1.30 0)))
	)
)


;;
;;	Fire. Same notes as drone, different offsets.
;;
(defun fire (playlen)
	(reverb (sim
		(at 0	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c0 playlen)) 0.10 0)))
		(at 1	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.6 (i2 c1 playlen)) 0.10 1)))
		(at 1	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.8 (i2 c1 playlen)) 0.20 1)))
		(at 2	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c2 playlen)) 0.30 2)))
		(at 3	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.5 (i2 c3 playlen)) 0.50 3)))
		(at 5	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.6 (i2 c5 playlen)) 0.80 5)))
		(at 8	(mult (pwl (* 0.95 playlen) 1 playlen)(oscpan (scale 0.9 (i2 a0 playlen)) 1.30 8)))
	) 2)
)


(setf brain-wave-device "laura-message-fred.aiff" :srate 44100.0)
(if (not (boundp 'brain-wave-snd))
	(setf brain-wave-snd
		(s-read "laura-message-fred.aiff" :srate 44100.0)
	)
)


(defun all ()
	(sim
                ;;	Granular voices
		(at 128 (mult (pwl 2 0.5 40 0.5 42) (reverb	(seq
				(stretch 128 (sf-granulate brain-wave-device 0.2 0.1 0.3 0.001 1.0 0 0))
			) 5)
		))

		;;	Perpetual drone and "fire balls" of different kinds
		(at 32	(drone 257))
		(at 0	(mult (pwl 1 1 200 1 300) (fire 300)))
		(at 0	(mult (pwl 1 1 250 1 300) (reson (fire 300) (step-to-hz c3) 2048 1)))
		(at 64	(iXs 257))


		;;	Soft FM sounds
                (at 0.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 c3 2)) 0.10 0)))
                (at 0.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 d3 2)) 0.10 0)))
                (at 0.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 a4 2)) 0.10 0)))
                (at 1.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 b4 2)) 0.10 0)))
                (at 2.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 a4 2)) 0.10 0)))
                (at 3.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 c4 2)) 0.10 0)))
                (at 3.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 a4 2)) 0.10 0)))
                (at 4.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 c4 2)) 0.10 0)))
                (at 4.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i3 b4 2)) 0.10 0)))
                (at 4.7 (mult (pwl 2 1 10)(reverb (seq (scale 0.71 (i1 a4 2))(s-rest 8)) 5)))
                (at 4.8 (mult (pwl 3 1 20)(reverb (seq (scale 0.71 (i3 c4 2))(s-rest 18)) 20)))


		;;	AM synthesis (harsher, surprising)
                (at 30.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.1 (i4 c4 2)) 0.10 0)))
                (at 30.5 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.1 (i4 d4 2)) 0.10 0)))
                (at 31.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.1 (i4 c4 2)) 0.10 0)))
                (at 31.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 b4 2)) 0.10 0)))
                (at 32.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 a4 2)) 0.10 0)))
                (at 33.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 c4 2)) 0.10 0)))
                (at 33.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 a4 2)) 0.10 0)))
                (at 34.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 c4 2)) 0.10 0)))
                (at 34.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 b4 2)) 0.10 0)))
                (at 34.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 a4 2)) 0.10 0)))
                (at 34.8 (mult (pwl 3 1 20)(reverb (seq (scale 0.1 (i4 c4 2))(s-rest 18)) 10)))


		;;	More AM synthesis
                (at 60.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.1 (i4 c3 2)) 0.10 0)))
                (at 60.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.1 (i4 d3 2)) 0.10 0)))
                (at 61.0 (mult (pwl (* 0.995 2) 1 1)(oscpan (scale 0.1 (i4 c3 2)) 0.10 0)))
                (at 61.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 b3 2)) 0.10 0)))
                (at 62.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 a3 2)) 0.10 0)))
                (at 63.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 c4 2)) 0.10 0)))
                (at 63.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 a3 2)) 0.10 0)))
                (at 64.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 c3 2)) 0.10 0)))
                (at 64.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 b3 2)) 0.10 0)))
                (at 64.7 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.1 (i4 a3 2)) 0.10 0)))
                (at 64.8 (mult (pwl 3 1 20)(reverb (seq (scale 0.1 (i4 c4 2))(s-rest 18)) 10)))


		;;	Batch of odd ringmod melody
                (at 250.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 250.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 d4 2)) 0.10 0)))
                (at 251.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 251.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 b4 2)) 0.10 0)))
                (at 252.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 a4 2)) 0.10 0)))
                (at 253.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 253.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 a4 2)) 0.10 0)))
                (at 254.0 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 c4 2)) 0.10 0)))
                (at 254.5 (mult (pwl (* 0.995 2) 1 2)(oscpan (scale 0.71 (i1 b4 2)) 0.10 0)))
                (at 254.7 (mult (pwl 2 1 10)(reverb (seq (scale 0.71 (i1 a4 2))(s-rest 8)) 5)))
                (at 254.8 (mult (pwl 3 1 20)(reverb (seq (scale 0.71 (i1 c4 2))(s-rest 18)) 20)))

		(at 256	(mult (pwl 0.1 1 24 1 30) (cue brain-wave-snd)))
	)
)

(play (all))

 steal compass, drive north, disappear...