;; A test input: (setf input "01 234 567 89") ;; the recursive function (defun number-to-tone (num-stream &aux low-high dur) (setf current (pop num-stream)) (unless current (return-from number-to-tone s)) (setf dur (if (equal current #\>) 0.1 0.068)) (setf low-high (case current (#\> '(1100 1700)); KP (#\< '(1500 1700)); ST (#\1 '(700 900)) (#\2 '(700 1100)) (#\3 '(900 1100)) (#\4 '(700 1300)) (#\5 '(900 1300)) (#\6 '(1100 1300)) (#\7 '(700 1500)) (#\8 '(900 1500)) (#\9 '(1100 1500)) (#\0 '(1300 1500)) (t nil))) (seq (number-to-tone num-stream) (if low-high (sim (osc (hz-to-step (first low-high)) dur) (osc (hz-to-step (second low-high)) dur) (s-rest 0.136)) (s-rest 0)))) ;;; Start of the main program (setf *sr* *sound-srate*) ; initialize s to 0 length (setf s (s-rest 0)) ; String to chars (setf numbers (cons #\< ; append st (reverse (cons #\> ; append kp (get-output-stream-list (make-string-input-stream input)))))) ; Return sound (abs-env (mult 0.4 (number-to-tone numbers)))