;;; -*- syntax: common-lisp; base: 10; mode: lisp -*- (definstrument click (start dur amp) (let* ((len (inexact->exact (round (* *srate* dur)))) (beg (inexact->exact (round (* *srate* start)))) (end (+ beg len))) (run (loop for i from beg to end do (outa i amp) )))) (defun make-clicks () (let* ( (n 15) (durs (make-array n)) (amps (make-array n)) ) (loop for i from 0 below n do (setf (aref durs i ) (/ 0.001 (+ 1 (mod i 4)))) ) (loop for i from 0 below n do (setf (aref amps i ) (random 0.1)) ) (with-sound (:srate 48000 :output "/zap/test.wav" :channels 2) (loop for i from 0 below n do (click (* i 0.15) (aref durs i) (aref amps i)) )))) #| comments... ; ...indent this file xemacs -batch -l ~/.emacs-indent-file -eval '(indent-file "~/220a/nov-11/click.lisp")' ... but first you will need a copy of my .emacs file with the following cp ~cc/.emacs-indent-file ~/ ...launch lisp image in a terminal /usr/bin/clisp-cm-clm-cmn ...compile (compile-file "click" :verbose nil) ...load (load "click") ...run this file's code (make-clicks) |#