;;; -*- Syntax: Common-Lisp; Package: COMMON-MUSIC; Base: 10; Mode: Lisp -*- ;;; Streaming showing the tendency of the ear to group lines of music by register. ;;; This example plays a monophonic line with notes in alternating register, ;;; first slow then fast. The streaming effect occurs at higher tempos only. (in-package :stella) (in-syntax :music-kit 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*))) (flet ((clarinet-part (start myevents mytempo octavelist) (algorithm (name (gensym "clarinet")) Fm1vi (length myevents start start amp .7 ampEnv "ampFn" ampAtt .3 ampRel .2 m1IndAtt .1 m1IndRel .1 m1Ratio 2.001 cRatio 1 m1Ind1 1 m1Ind0 0 m1IndEnv "indFn" sVibAmp .002 rVibAmp .002 ) (setf freq (* (item (pitches c3 d e)) (item octavelist)) rhythm (item (rhythms q tempo mytempo)) m1Ratio (item (items 2.001 2.002 1.999 in random)) cRatio (item (items 1.0001 1.0 0.99999 in heap)) m1Ind1 (item (items 2.1 2.5 1.8 in heap)))) )) (merge streaming () ;; time events tempo octave alternation (clarinet-part 0 15 (* 60 2.0) (items 2 4)) (clarinet-part (/ 15 2.0) 60 (* 60 7) (items 2 4)) )) (stella:stella)