| 1 |
; local definition for play |
| 2 |
; this one is for NeXT: |
| 3 |
|
| 4 |
(if (not (boundp '*default-sf-format*)) |
| 5 |
(setf *default-sf-format* snd-head-NeXT)) |
| 6 |
|
| 7 |
(if (not (boundp '*default-sound-file*)) |
| 8 |
(compute-default-sound-file)) |
| 9 |
|
| 10 |
(if (not (boundp '*default-sf-dir*)) |
| 11 |
(setf *default-sf-dir* "./")) |
| 12 |
|
| 13 |
(if (not (boundp '*default-sf-mode*)) |
| 14 |
(setf *default-sf-mode* snd-head-mode-pcm)) |
| 15 |
|
| 16 |
(if (not (boundp '*default-sf-bits*)) |
| 17 |
(setf *default-sf-bits* 16)) |
| 18 |
|
| 19 |
(if (not (boundp '*default-plot-file*)) |
| 20 |
(setf *default-plot-file* "points.dat")) |
| 21 |
|
| 22 |
;; PLAY-FILE - play a sound file |
| 23 |
;; |
| 24 |
(defun play-file (name) |
| 25 |
(system (strcat "sndplay " (soundfilename name)))) |
| 26 |
|
| 27 |
;; R - replay last file written with PLAY |
| 28 |
(defun r () (play-file *default-sound-file*)) |
| 29 |
|
| 30 |
;; PLAY - write value of an expression to file and play it |
| 31 |
;; |
| 32 |
(defmacro play (expr) |
| 33 |
`(prog (specs) |
| 34 |
(setf specs (s-save (force-srate *sound-srate* ,expr) |
| 35 |
1000000000 *default-sound-file*)) |
| 36 |
(r))) |
| 37 |
|