; make a sound (defun ex1 () (osc c4)) ; try out the PWL function: ; (s-plot (pwl .1 1 2)) ; use it to create an amplitude envelope (defun ex2 () (mult (pwl .1 1 2) (stretch 2 (osc c4)))) ; use it for frequency modulation (defun ex2 () (mult (pwl .1 1 2) (fmosc c4 (pwl 2 50 2)))) ; make an envelope with variable rise time (defun rbd-env (n) (pwl (* n 0.02) .05 1)) ; make a tone with additive synthesis, ; high harmonics turn on slower (defun rbd-additive (pitch) (let ((fundamental (step-to-hz pitch))) (simrep (i 20) (mult (rbd-env i) (osc (hz-to-step (* (+ i 1) fundamental))))))) ; define a function to realize partials (defun part (amp freq) (mult (scale 0.0003 amp) (fmosc (hz-to-step 1) (sum -1 freq)))) ; examle amplitude envelope (defun amp1 () (pwl 1 0 38 253 81 1163 122 1350 224 317 344 0)) ; example freq envelope (defun freq1 () (pwl 1 95 6 299 43 314 86 312 274 313 344 344)) ; make first partial of Moorer's cello tone (defun ex3 () (stretch 0.001 (part (amp1) (freq1)))) ; Assignment: realize a complete tone from Moorer's article