;;; ;;; playit.lisp : to hear the re-synthesized sound ;;; ;;; by Takuya Fujishima, fujishim@ccrma, on Feb 25,26, 1998 ;;; ;;; Modified by Harvey Thornburg, harv23@ccrma on Feb. 28 1998 ;;; ;;; (playit ) synthesizes audible sound from ATS data in ;;; . ;;; (defun playit (sound) (if (not (ats-sound-optimized sound)) (progn (format t "optimizing...") (optimize-sound sound) (setf (ats-sound-pha sound) nil) (simplify-sound sound (get-valid-partials sound)) (format t "done.~%")) (format t "(it's optimized)~%")) (with-sound (:play nil :output "/zap/test.snd" :statistics t :verbose t :scaled-to 0.5) (osc-synth 0.0 sound :amp 1.0 :duration (ats-sound-dur sound) :amp-env '(0 1 1 1) :par nil)) ;; par is for list of partials !!! (let (ans) (loop do (format t "What to do?~%") (format t "1 : listen to the sound ~%") (format t "2 : save the sound ~%") (format t "3 : quit~%") (setq ans (read)) (cond ((eq ans 1) (dac)) ((eq ans 2) (save-sound (read-from-string (ats-sound-name sound)) "playit")) ((eq ans 3) (loop-finish))))))