Debian Codegraph @

lib-src/libnyquist/nyquist/sys/unix/rs6k/system.lsp

raw
1 ; machine.lsp -- machine/system-dependent definitions
2 ; rs6000
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* "/tmp/"))
12
13 (if (not (boundp '*default-sf-mode*))
14 (setf *default-sf-mode* snd-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 ; turn off switch to play sound as it is computed
23 (setf *soundenable* nil)
24
25 ; local definition for play
26
27 (defmacro play (expr)
28 `(let ()
29 (s-save-autonorm ,expr NY:ALL *default-sound-file* :play *soundenable*)
30 (r)))
31
32
33 (defun r ()
34 (play-file *default-sound-file*))
35
36
37 ; PLAY-FILE -- play a file
38 (defun play-file (name)
39 (system (format nil "acpaplay ~A" (soundfilename name))))
40
41
42 ; FULL-NAME-P -- test if file name is a full path or relative path
43 ;
44 ; (otherwise the *default-sf-dir* will be prepended
45 ;
46 (defun full-name-p (filename)
47 (or (eq (char filename 0) #\/)
48 (eq (char filename 0) #\.)))
49
50 (setf *file-separator* #\/)
51
52
53 ; save the standard function to write points to a file
54 ;
55 (setfn s-plot-points s-plot)
56
57
58
59 ; S-PLOT - plot a small number of points
60 ;
61 (defun s-plot (&rest args)
62 (let ((n (soundfilename *default-plot-file*)))
63 (apply #'s-plot-points args)
64 (cond ((boundp '*plotscript-file*))
65 (t
66 (format t "*plotscript-file* is unbound, setting it to: \n")
67 (format t " sys/unix/rs6k/plotscript\n")
68 (format t "You may need to set it to a full path\n")
69 (setf *plotscript-file* "sys/unix/rs6k/plotscript")))
70 (system (format nil "xterm -t -e ~A ~A" *plotscript-file* n))))
71
72
73 ; S-EDIT - run the audio editor on a sound
74 ;
75 (defmacro s-edit (&optional expr)
76 `(prog ()
77 (if ,expr (s-save ,expr 1000000000 *default-sound-file*))
78 (system (format nil "audio_editor ~A &"
79 (soundfilename *default-sound-file*)))))
80