;;; -*- Syntax: Common-Lisp; Base: 10; Mode: Lisp -*- ;;; Wavetable example with 6 user-defined harmonics, creates a monophonic algorithm (in-package :stella) (in-syntax :mk t) ;;; envelope is formatted as [time, value] pairs ;;; waveTable is formatted as [harmonic number, harmonic amplitude] pairs (defparameter *header* (header "envelope clarinetAmplitudeEnv = [(0,0)(.2,1)(.5,.8)|(1,0.0)];" "waveTable clarinetSpectralEnv = [{1,1}{3,.75}{5,.5}{7,.25}{9,.15}{11,.1}{13,.05}];" )) ;;; when *header* is redefined, the output stream must be reopened (open-cmd (concatenate 'string "test.score header \"" *header* "\"")) ;;; create an algorithm called "wave1" which plays the Wave1vi SynthPatch (algorithm wave1 Wave1vi ;; set constant-valued parameters (length 25 amp .2 ampEnv "clarinetAmplitudeEnv" waveform "clarinetSpectralEnv" sVibAmp .002 rVibAmp .002 ) ;; set time-varying parameters (setf freq1 (item (pitches f3 g a bf c4 in palindrome)) rhythm (item (rhythms s s s s e)) svibFreq (+ 4.5 (random 1.0))) ; note-by-note variation of vibrato frequency ) (stella)