;;; random value selection (algorithm one midi-note (length 20) (setf note (+ (* (between -2 1) 12) (between 60 71)) rhythm (/ 1 (+ (random 16) 1)) amplitude (pickl (pickl .1 .2 .3) (pickl .7 .8)) duration (* count rhythm))) (stella) open midi mix 1 0 ;;; ordered value selection (algorithm two midi-note (length 20) (vars octave) (setf octave (* (between 0 3) 12) note (+ (item (degrees c4 cs ds e fs g a as)) octave) rhythm (item (rhythms q e s)) amplitude (item (pickl (amplitudes ppp pp p) (amplitudes f ff fff))) duration (* count rhythm))) mix 2 0 mix 1,2 0,3 ;;; CM -> Items Streams -> Data Types ;;; CM -> Items Streams -> Introduction to Item Streams ;;; translation functions for types (note '60) (pitch '60) (degree '60) (note 'c4) (pitch 'c4) (degree 'c4) (note 261.6) (pitch 261.6) (degree 261.6) (rhythm 'q) (rhythm 4) (rhythm '4th) *standard-tempo* (in-tempo 72) (in-tempo 60 'q.) (rhythm 'q) (in-tempo 60) (amplitude 'f) (amplitude .1) ;;; other data types (algorithm three midi-note (length 10 rhythm .5 amplitude .7 duration 1) (vars (base (pickl 60 61 63 66 68 71))) (setf note (item (intervals 1 3 6 8 11 from base)))) ;;; intervals from base pitch (algorithm four midi-note (length 10 rhythm .5 amplitude .7 duration 1) (vars (base (pickl 60 61 63 66 68 71))) (setf note (item (steps 1 3 6 8 11 from base)))) ;;; intervals from previous pitch mix 3 0 mix 4 0 ;;; pattern types (setf stream (items 1 2 3 4 5 6)) (read-items stream) (setf stream-default (items 1 2 3 4 5 6 for 12)) (read-items stream-default) (setf stream-cycle (items 1 2 3 4 5 6 for 12 in cycle)) (read-items stream-cycle) ;;; same as default (setf stream-sequence (items 1 2 3 4 5 6 for 12 in sequence)) (read-items stream-sequence) ;;; repeat (setf stream-accumulation (items 1 2 3 4 5 6 for 12 in accumulation)) (read-items stream-accumulation) ;;; repeat (setf stream-rotation (items 1 2 3 4 5 6 for 12 in rotation)) (read-items stream-rotation) ;;; repeat (setf stream-random (items 1 2 3 4 5 6 for 12 in random)) (read-items stream-random) ;;; repeat (setf stream-heap (items 1 2 3 4 5 6 for 12 in heap)) (read-items stream-heap) ;;; repeat (setf stream-palindrome (items 1 2 3 4 5 6 for 12 in palindrome)) (read-items stream-palindrome) (setf stream-palindrome-elide (items 1 2 3 4 5 6 for 12 in palindrome eliding yes)) (read-items stream-palindrome-elide) (setf stream-palindrome-elide-end (items 1 2 3 4 5 6 for 12 in palindrome eliding end)) (read-items stream-palindrome-elide-end) (setf stream-palindrome-elide-start (items 1 2 3 4 5 6 for 13 in palindrome eliding start)) (read-items stream-palindrome-elide-start) (setf stream-graph (items (1 to (items 1 2 3)) (2 to (items 1 3)) (3 to 1) in graph)) (read-items stream-graph 15) (setf stream-graph-varied (items (1 to (items 1 2 3 in heap)) (2 to (items 1 3 in random)) (3 to 1) in graph)) (read-items stream-graph-varied 15) (algorithm five midi-note (length 20 rhythm 0.25 amplitude 0.7 duration 1) (setf note (item (notes 60 62 64 66 68 70 72 in random)))) mix 5 0 (algorithm five midi-note (length 20 amplitude 0.7 duration 1) (setf note (item (notes 60 62 64 66 68 70 72 in random)) rhythm (item (items 0.125 0.25 0.5 in heap)))) ;;; data type items mix 5 0 (algorithm five midi-note (length 20 amplitude 0.7) (setf note (item (notes 60 62 64 66 68 70 72 in random)) rhythm (item (items 0.125 0.25 0.5 in heap)) duration (item (numbers from 0.125 below 1.125 by 0.125 in cycle)))) ;;; data type numbers mix 5 0 (algorithm five midi-note (length 20) (setf note (item (notes 60 62 64 66 68 70 72 in random)) rhythm (item (items 0.125 0.25 0.5 in heap)) amplitude (item (amplitudes 0.3 0.7 0.4 0.8 in palindrome)) duration (item (numbers from 0.125 below 1.125 by 0.125 in cycle)))) mix 5 0 (algorithm six midi-note (length 20 rhythm 0.5 duration 1) (setf note (item (notes 73 75 77 79 81 83 85 in random)) amplitude (item (amplitudes 0.3 0.6 0.7 in heap)))) mix 6 0 mix 5,6 0,0.5 ;;; generator (generator seven midi-note (length 20) (setf note (item (notes 60 62 64 66 68 70 72 in random)) rhythm (item (items 0.125 0.25 0.5 in heap)) amplitude (item (amplitudes 0.3 0.7 0.4 0.8 in palindrome)) duration (item (numbers from 0.125 below 1.125 by 0.125 in cycle)))) run 7 0 ;;; computes but does not play mix 7 0 ;;; generator is frozen unfreeze 7 ;;; allows new values mix 7 0 (thread eight () (doitems (n (notes c2 d ef f fs gs a b in random for 10)) (object midi-note note n rhythm 0.5 duration 1 amplitude .7))) list mix 8 0 duplicate eight nine mix 9 0 transpose nine note 48 mix 9 0 duplicate nine ten invert ten note fs6 mix 10 0 mix 8,9 0,1.5 mix 8,10 0,1.5 (layout total (mix eight ten@1.25)) mix total 0 (layout total (mix five six@0.25 eight@1.5 ten@1)) mix total 0 ;;; repeat ;;; weighting random selection (algorithm phase1 midi-note (length 100 rhythm .1 duration .1) (setf note (item (pitches e4 g a cs e g)) amplitude (item (items (.4 weight 50) .6 .8 in random)))) (algorithm phase2 midi-note (length 100 rhythm .11 duration .11) (setf note (item (pitches e4 g a cs e g)) amplitude (item (items (.4 weight 50) .6 .8 in random)))) mix phase1,phase2 0,0 -Charles Nichols