;;; -*- Syntax: Common-Lisp; Package: COMMON-MUSIC; Base: 10; Mode: Lisp -*- ;;; The clarinet algorithm below is similar to wave1.lisp, but with ;;; increasingly brighter spectra caused by greater modulation index. ;;; The FMpallette algorithm below explores carrier:modulator ratios ;;; and modulation index levels "combinatorially." (in-package :stella) (in-syntax :mk t) (defparameter *header* (header "envelope ampFn = [(0,0)(.2,1)(.5,.8)|(1,0.0)];" "envelope indFn = [(0,0)(.1,1)(.2,.7)|(.3,.7)];" )) (open-cmd (concatenate 'string "test.score header " (quotify *header*))) (algorithm clarinet Fm1vi (length 25 amp .1 ; Amplitude of .1 ampEnv "ampFn" ; Envelope is "ampFn" specified above ampAtt .3 ; Amplitude envelope attack time ampRel .2 ; Amplitude envelope release time m1IndAtt .1 ; Modulator index attack time m1IndRel .1 ; Modulator index release time m1Ratio 2.001 ; Modulator portion of c:m ratio cRatio 1 ; Carrier portion of c:m ratio m1Ind1 1 ; Modulation index when envelope is 1 m1Ind0 0 ; Modulation index when envelope is 0 m1IndEnv "indFn" ; Modulation index envelope sVibAmp .002 ; Percentage of sinusoidal vibrato rVibAmp .002 ; Percentage of random vibrato ) (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)) m1Ind1 (/ count 2.0))) (algorithm FMpallette Fm1vi (length 150 rhythm .2 freq (pitch 'a2) amp .1 ampEnv "ampFn" ampAtt .3 ampRel .2 m1IndAtt .1 m1IndRel .1 m1Ind0 0 m1IndEnv "indFn" sVibAmp .009 sVibFreq 4 rVibAmp .005 ) (setf m1Ratio (item (items 1 2 3 4 5 6 7)) ; modulator tuning cRatio (item (items 1 2 3 4 5 6)) ; carrier tuning m1Ind1 (item (items .5 1.0 1.5 2.0 2.5)) ; index level )) (stella:stella)