Commit f369f1bd authored by Alessio Treglia's avatar Alessio Treglia

Imported Upstream version 11.2

parent 8b022ab6
Snd change log
5-Jan: Snd 11.2.
2010 ----------------------------------------------------------------
26-Dec: tools/sam.c.
21-Dec: moved focus-follows-mouse to C as with-pointer-focus.
removed def-optkey-fun and def-optkey-instrument (use define* and definstrument).
16-Dec: make-current-window-display (draw.scm) moved to C as with-inset-graph.
removed Guile support.
14-Dec: peak-env support moved to C, added peak-env-dir, removed peak-env.*,
peak-env-info, read-peak-env-info-file, and write-peak-env-info-file.
11-Dec: removed midi.c and Alsa < 1.0 support.
7-Dec: removed SGI support.
4-Dec: portaudio support.
1-Dec: removed --with-modules configuration switch.
30-Nov: Snd 11.1.
23-Nov: colormaps are objects now. integer->colormap, colormap->integer.
transforms are also objects. integer->transform, transform->integer.
......
Snd 11.1:
Snd 11.2
many more ruby/forth improvements thanks to Mike.
added portaudio (version 19) support.
*trace-hook* in s7. Also defmacro* and define-macro*. make-list.
s7: hash-table-for-each.
force and delay are now included in s7 only if WITH_FORCE is defined.
The slib implementation is used. The promise? function has been removed.
I used "make-promise" for "delay" in earlier versions of s7 to avoid
collisions with CLM.
added tools/sam.c: a Samson box emulator!
removed the sbcl ppc undefined_alien_function stuff from cmus.c.
some of the more useful extensions were moved to C:
removed all support for gtkglext and fftw2 (use fftw3).
make-current-window-display (draw.*) as with-inset-graph.
play is generic, and uses optkey args (this is a non-compatible change).
"old-play" is the old version of play. play-channel, play-mix, play-region,
play-selection, and play-and-wait are deprecated.
focus-follows-mouse as with-pointer-focus.
selection function/object; added selection choice to the generic funcs.
selection->mix.
The graphed selection bounds can be changed by dragging the mouse.
peak-env support, so peak-env.* removed, peak-env-info,
read-peak-env-info-file and write-peak-env-info-file removed,
added peak-env-dir which if not null (the default) turns on the
peak env machinery. smart-line-cursor also moved to C.
The mix dialog follows the (mix-)sync field, and has 2 new buttons!
copy and fill! for selection and sound, and copy for mix and mark.
lots of long-delayed cleanups:
moved with-mix from ws.scm to snd11.scm.
moved save-mix from mix.scm into C.
added check-mix-tags to mix.scm.
removed Guile support.
this includes remove-local-hook! in hooks.scm, use-modules and all
the guile-specific reader/debugger settings ("debug-set!" etc),
--with-guile, --with-modules, and --with-hobbit configuration switches,
snd-out in examp.scm, pd-* and rt-* are currently broken. def-optkey-fun
is now just define*, and def-optkey-instrument is definstrument.
load-from-path is load. shell is system. removed fix-optargs.scm.
added snd-forth-docs.fs (incorporated in sndclm.html), thanks to Mike.
removed mus-audio-systems, mus-audio-mixer-read, mus-audio-mixer-write,
and all the associated field and device names (in CLM as well as Snd).
removed mus-audio-report and changed mus-audio-describe to return the
description as a string.
colormaps are objects now, not ints; added the predefined colormaps
as built-in objects (hot-colormap, etc), and integer->colormap,
colormap->integer. Each colormap function now takes a colormap object
as the first argument, not an integer.
removed sndrecord.c and new-buttons.scm.
transforms are objects also; fourier-transform etc; integer->transform and
transform->integer. add-transform returns such an object, delete-transform
and transform-type take one.
removed SGI support.
removed tools/snd-index.cl.
removed midi.c and the --with-midi configure switch.
checked: sbcl 1.0.32, gtk 2.19.0, acl 8.2, mpc 0.8, guile 1.9.5, fth 1.2.8
in CLM, removed sc.c and clm-snd.lisp (CLM to Snd interjob communication).
removed XmPrint/libXp support (--with-xp configure switch).
versions of Alsa before 1.0 are no longer supported.
mpc versions before 0.8.0 are no longer supported.
checked: autoconf 2.65, sbcl 1.0.33|4, mpfr 2.4.2, gtk 2.19.1|2, mpc 0.8.1
Thanks!: Hermann Beyer, Mike Scholz, Tommy Rushton, Mike Winter, Rick Taube.
Thanks!: Geoff Lee, Mike Scholz, Rick Taube, Alan Grover, Kjetil Matheussen.
......@@ -23,9 +23,6 @@ The configure script has a bunch of arguments:
--with-ruby use Ruby as the extension language
--with-ruby-prefix set location of Ruby
--with-guile use Guile; the path to guile-config
can be set via GUILE_CONFIG_path (see examples below).
--with-forth use Forth (Mike Scholz's FTH) as the extension language.
......@@ -101,7 +98,6 @@ The configure script has a bunch of arguments:
--with-snd-as-widget make Snd a loadable widget, not a standalone program
--with-snd-as-pd-external make Snd a loadable pd external, not a standalone program
--with-hobbit include hobbit-style function arity checking
--with-temp-dir directory to use for temp files (default: ".")
--with-save-dir directory to use for saved-state files (default: ".")
......@@ -110,7 +106,6 @@ The configure script has a bunch of arguments:
--with-shared-sndlib try to use libsndlib.so (default: no). The path to
sndlib-config can be specified via SNDLIB_CONFIG_path.
Normally, sndlib is built into Snd at compile time.
--with-midi include sndlib midi module (default: no)
--disable-nls the gettext (internationalization) support is on
by default; this turns it off.
......@@ -124,8 +119,8 @@ If the configure/make process fails, please send me
(bil@ccrma.stanford.edu) the files mus-config.h, config.log, and makefile,
created (or updated) by configure.
Snd comes with s7, so if you don't have Guile, Ruby, or
Forth, you can use s7. If you insist on building Snd without any extension
Snd comes with s7, but
if you insist on building Snd without any extension
language, you'll find that it's severely limited in what it can do.
Snd can also be built without any graphics toolkit. Without either the GUI
or an extension language, however, there's nothing it can do.
......@@ -141,8 +136,7 @@ are different enough that gl.c can be a pain to build).
Version info:
if Gtk, then Gtk+ 2.0.0 or later
if Motif, then Motif 2.n but not Lesstif
in Linux, if ALSA, then ALSA 0.9beta8 or later (or any version of OSS)
if Guile, Guile 1.5.0 through 1.8.n (not 1.9.n or later)
in Linux, if ALSA, then ALSA 1.0 or later (or any version of OSS)
if Ruby, Ruby 1.8.0 or later.
if Forth, any version
if S7, any version
......@@ -153,7 +147,7 @@ Version info:
----------------------------------------------------------------
The customization/extension languages are either s7 (included), Guile, Ruby, or Forth.
The customization/extension languages are either s7, Ruby, or Forth.
Much of Snd's functionality is loaded as needed from the Scheme, Ruby, or Forth
files found in the tarball (*.scm, *.rb, and *.fs). You can run Snd without
......@@ -170,7 +164,6 @@ never have to think about it again. In the other languages:
Ruby: $LOAD_PATH.push("/home/bil/cl")
Forth: "/home/bil/cl" add-load-path
Guile: (set! %load-path (cons "/home/bil/cl" %load-path))
----------------------------------------------------------------
......@@ -201,8 +194,8 @@ After that, you go to your local cvs-snd directory and
cvs update
Included with Snd are four command-line programs that might
be of interest: sndplay, sndrecord, sndinfo, and audinfo:
Included with Snd are three command-line programs that might
be of interest: sndplay, sndinfo, and audinfo:
make sndplay
......@@ -230,7 +223,6 @@ Seppo Ingalsuo: the HPUX port.
Juan Reyes: the DEC Alpha port.
Guenter Geiger and Stefan Schwandter: the Linux Alpha port.
Paul Davis: the original ALSA support.
Gerd Rausch: the Sam 9407 support.
Steven Schultz and Mike Scholz: the *BSD ports.
Ludger Brummer and Charles Nichols: the Mac-OSX port.
Thomas Klausner: the NetBSD port.
......@@ -427,9 +419,7 @@ the audio card thinks it's the local network controller or something.
---- ALSA: ----
Only versions from 0.9 of ALSA are supported. If you get a compile-time
complaint about snd_pcm_hw_params (ALSA 0.9beta4) you need to get
a newer version of ALSA.
Only versions from 1.0 of ALSA are supported.
On recording, here's a note from Fernando from cmdist:
......@@ -568,38 +558,6 @@ C compiler/libraries don't support complex trig), then Snd needs
GSL 0.8 or later.
---- Guile: ----
Guile versions 1.9.0 and beyond are not really usable. I will eventually remove
Guile support.
If you're running Guile 1.4 and get:
Syntax error in fixed argument declaration.
you've hit a use of the newer (Guile 1.5) optargs syntax. To get around
this, load fix-optargs.scm before anything else.
Finally, if you installed Guile from an RPM file, you may also need
to install the guile-devel package. Otherwise the configure process
will say it can't find Guile (actually guile-config).
---- Sun ----
If the make process complains about lt_dlclose and friends, add -lltdl
to the XEN_LIBS list in makefile. The --with-gl and --with-just-gl
switches are not recommended on the Sun, though they work; the
colormap of the entire system is hijacked while Snd is running.
Perhaps simplest is to get the package through blastwave:
pkg-get -i snd
http://www.blastwave.org/packages/snd
http://www.blastwave.org
http://www.blastwave.org/howto.html
---- Mac OSX: ----
You can use either Motif or Gtk running under X11; to start Snd from an
......@@ -637,11 +595,9 @@ list in the makefile.
If C-f (and other such commands) doesn't work, either try toggling
the "w" button, or add the focus-widget related hooks from grfsnd.html
to your initialization file:
the "w" button, or enable pointer focus:
(if (not (provided? 'snd-extensions.scm)) (load-from-path "extensions.scm"))
(focus-follows-mouse)
(set! (with-pointer-focus) #t)
If the openmotif package forgot to include libXm.a (Motif), a version is
......
......@@ -2,8 +2,8 @@
#define SNDLIB_H
#define SNDLIB_VERSION 21
#define SNDLIB_REVISION 0
#define SNDLIB_DATE "27-July-09"
#define SNDLIB_REVISION 2
#define SNDLIB_DATE "11-Dec-09"
#include <mus-config.h>
......@@ -27,7 +27,7 @@
#endif
#if MUS_WINDOZE
#if HAVE_WINDOZE
/* I got these from gmp.h */
#if defined (__GNUC__)
#define MUS_EXPORT __declspec(__dllexport__)
......@@ -49,7 +49,7 @@
#endif
#endif
#if (SIZEOF_SSIZE_T == SIZEOF_INT) && (!MUS_MAC_OSX)
#if (SIZEOF_SSIZE_T == SIZEOF_INT) && (!HAVE_OSX)
#define SSIZE_TD "%d"
#else
#define SSIZE_TD "%ld"
......@@ -239,19 +239,7 @@ enum {MUS_UNKNOWN, MUS_BSHORT, MUS_MULAW, MUS_BYTE, MUS_BFLOAT, MUS_BINT, MUS_AL
#define MUS_AUDIO_DEVICE(n) ((n) & 0xffff)
enum {MUS_AUDIO_DEFAULT, MUS_AUDIO_DUPLEX_DEFAULT, MUS_AUDIO_ADAT_IN, MUS_AUDIO_AES_IN, MUS_AUDIO_LINE_OUT,
MUS_AUDIO_LINE_IN, MUS_AUDIO_MICROPHONE, MUS_AUDIO_SPEAKERS, MUS_AUDIO_DIGITAL_IN, MUS_AUDIO_DIGITAL_OUT,
MUS_AUDIO_DAC_OUT, MUS_AUDIO_ADAT_OUT, MUS_AUDIO_AES_OUT, MUS_AUDIO_DAC_FILTER, MUS_AUDIO_MIXER,
MUS_AUDIO_LINE1, MUS_AUDIO_LINE2, MUS_AUDIO_LINE3, MUS_AUDIO_AUX_INPUT, MUS_AUDIO_CD,
MUS_AUDIO_AUX_OUTPUT, MUS_AUDIO_SPDIF_IN, MUS_AUDIO_SPDIF_OUT, MUS_AUDIO_AMP, MUS_AUDIO_SRATE,
MUS_AUDIO_CHANNEL, MUS_AUDIO_FORMAT, MUS_AUDIO_IMIX, MUS_AUDIO_IGAIN, MUS_AUDIO_RECLEV,
MUS_AUDIO_PCM, MUS_AUDIO_PCM2, MUS_AUDIO_OGAIN, MUS_AUDIO_LINE, MUS_AUDIO_SYNTH,
MUS_AUDIO_BASS, MUS_AUDIO_TREBLE, MUS_AUDIO_PORT, MUS_AUDIO_SAMPLES_PER_CHANNEL,
MUS_AUDIO_DIRECTION
};
/* Snd's recorder uses MUS_AUDIO_DIRECTION to find the size of this list */
#define MUS_AUDIO_DEFAULT 0
#define MUS_ERROR -1
enum {MUS_NO_ERROR, MUS_NO_FREQUENCY, MUS_NO_PHASE, MUS_NO_GEN, MUS_NO_LENGTH,
......@@ -266,13 +254,11 @@ enum {MUS_NO_ERROR, MUS_NO_FREQUENCY, MUS_NO_PHASE, MUS_NO_GEN, MUS_NO_LENGTH,
MUS_AUDIO_CHANNELS_NOT_AVAILABLE, MUS_AUDIO_SRATE_NOT_AVAILABLE, MUS_AUDIO_FORMAT_NOT_AVAILABLE,
MUS_AUDIO_NO_INPUT_AVAILABLE, MUS_AUDIO_CONFIGURATION_NOT_AVAILABLE,
MUS_AUDIO_NO_LINES_AVAILABLE, MUS_AUDIO_WRITE_ERROR, MUS_AUDIO_SIZE_NOT_AVAILABLE, MUS_AUDIO_DEVICE_NOT_AVAILABLE,
MUS_AUDIO_CANT_CLOSE, MUS_AUDIO_CANT_OPEN, MUS_AUDIO_READ_ERROR, MUS_AUDIO_AMP_NOT_AVAILABLE,
MUS_AUDIO_WRITE_ERROR, MUS_AUDIO_SIZE_NOT_AVAILABLE, MUS_AUDIO_DEVICE_NOT_AVAILABLE,
MUS_AUDIO_CANT_CLOSE, MUS_AUDIO_CANT_OPEN, MUS_AUDIO_READ_ERROR,
MUS_AUDIO_CANT_WRITE, MUS_AUDIO_CANT_READ, MUS_AUDIO_NO_READ_PERMISSION,
MUS_CANT_CLOSE_FILE, MUS_ARG_OUT_OF_RANGE, MUS_WRONG_TYPE_ARG,
MUS_MIDI_OPEN_ERROR, MUS_MIDI_READ_ERROR, MUS_MIDI_WRITE_ERROR, MUS_MIDI_CLOSE_ERROR, MUS_MIDI_INIT_ERROR, MUS_MIDI_MISC_ERROR,
MUS_NO_CHANNELS, MUS_NO_HOP, MUS_NO_WIDTH, MUS_NO_FILE_NAME, MUS_NO_RAMP, MUS_NO_RUN,
MUS_NO_INCREMENT, MUS_NO_OFFSET,
MUS_NO_XCOEFF, MUS_NO_YCOEFF, MUS_NO_XCOEFFS, MUS_NO_YCOEFFS, MUS_NO_RESET, MUS_BAD_SIZE, MUS_CANT_CONVERT,
......@@ -282,7 +268,7 @@ enum {MUS_NO_ERROR, MUS_NO_FREQUENCY, MUS_NO_PHASE, MUS_NO_GEN, MUS_NO_LENGTH,
/* keep this list in sync with mus_error_names in sound.c and snd-test.scm|rb */
#if MUS_WINDOZE
#if HAVE_WINDOZE
#ifdef FOPEN
#undef FOPEN
#endif
......@@ -430,20 +416,14 @@ MUS_EXPORT int mus_float_array_to_file(const char *filename, mus_float_t *ddata,
#define MUS_OSS_API 1
#define MUS_JACK_API 2
MUS_EXPORT bool mus_audio_device_p(int n);
MUS_EXPORT void mus_audio_describe(void);
MUS_EXPORT char *mus_audio_report(void);
MUS_EXPORT char *mus_audio_describe(void);
MUS_EXPORT int mus_audio_open_output(int dev, int srate, int chans, int format, int size);
MUS_EXPORT int mus_audio_open_input(int dev, int srate, int chans, int format, int size);
MUS_EXPORT int mus_audio_write(int line, char *buf, int bytes);
MUS_EXPORT int mus_audio_close(int line);
MUS_EXPORT int mus_audio_read(int line, char *buf, int bytes);
MUS_EXPORT int mus_audio_write_buffers(int line, int frames, int chans, mus_sample_t **bufs, int output_format, bool clipped);
MUS_EXPORT int mus_audio_read_buffers(int line, int frames, int chans, mus_sample_t **bufs, int input_format);
MUS_EXPORT int mus_audio_mixer_read(int dev, int field, int chan, float *val);
MUS_EXPORT int mus_audio_mixer_write(int dev, int field, int chan, float *val);
MUS_EXPORT int mus_audio_initialize(void);
#if HAVE_OSS || HAVE_ALSA
......@@ -465,17 +445,11 @@ MUS_EXPORT int mus_audio_initialize(void);
#endif
MUS_EXPORT int mus_audio_systems(void);
MUS_EXPORT char *mus_audio_system_name(int sys);
MUS_EXPORT char *mus_audio_moniker(void);
MUS_EXPORT int mus_audio_compatible_format(int dev);
#if MUS_SUN
MUS_EXPORT void mus_sun_set_outputs(int speakers, int headphones, int line_out);
#endif
#if MUS_NETBSD
MUS_EXPORT void mus_netbsd_set_outputs(int speakers, int headphones, int line_out);
#endif
int mus_audio_device_channels(int dev);
int mus_audio_device_format(int dev);
#if (!HAVE_STRERROR)
MUS_EXPORT char *strerror(int errnum);
......@@ -633,19 +607,6 @@ typedef void mus_header_write_hook_t(const char *filename);
MUS_EXPORT mus_header_write_hook_t *mus_header_write_set_hook(mus_header_write_hook_t *new_hook);
/* -------- midi.c -------- */
MUS_EXPORT int mus_midi_open_read(const char *name);
MUS_EXPORT int mus_midi_open_write(const char *name);
MUS_EXPORT int mus_midi_close(int line);
MUS_EXPORT int mus_midi_read(int line, unsigned char *buffer, int bytes);
MUS_EXPORT int mus_midi_write(int line, unsigned char *buffer, int bytes);
MUS_EXPORT const char *mus_midi_device_name(int sysdev);
MUS_EXPORT char *mus_midi_describe(void);
#if HAVE_EXTENSION_LANGUAGE
MUS_EXPORT void mus_midi_init(void);
#endif
#if HAVE_PTHREADS
MUS_EXPORT void mus_thread_restore_error_handler(void);
MUS_EXPORT mus_error_handler_t *mus_thread_get_previous_error_handler(void);
......
......@@ -149,7 +149,7 @@ are (1.0-based) edge freqs: (make-butterworth-bandstop 4 .1 .2)"
;;; ---------------- Chebyshev ----------------
(define* (chebyshev-prototype n :optional (ripple 1.0)) ; ripple in dB (positive)
(define* (chebyshev-prototype n (ripple 1.0)) ; ripple in dB (positive)
(let* ((e (sqrt (- (expt 10.0 (* 0.1 ripple)) 1.0)))
(v0 (/ (asinh (/ 1.0 e)) (exact->inexact n)))
(len (/ (* n 3) 2))
......@@ -170,16 +170,16 @@ are (1.0-based) edge freqs: (make-butterworth-bandstop 4 .1 .2)"
(expt 3.2 (/ (log ripple) (log 10.0))))) ; whatever works...
(list num den)))
(define* (make-chebyshev-lowpass n fc :optional (ripple 1.0))
"(make-chebyshev-lowpass n fc :optional (ripple 1.0)) returns a lowpass Chebyshev filter; n = order, \
(define* (make-chebyshev-lowpass n fc (ripple 1.0))
"(make-chebyshev-lowpass n fc (ripple 1.0)) returns a lowpass Chebyshev filter; n = order, \
fc = cutoff freq (srate = 1.0): (make-chebyshev-lowpass 8 .1)"
(if (odd? n) (set! n (+ n 1)))
(let* ((proto (chebyshev-prototype n ripple))
(coeffs (analog->digital n (car proto) (cadr proto) fc)))
(make-filter :xcoeffs (car coeffs) :ycoeffs (cadr coeffs))))
(define* (make-chebyshev-highpass n fc :optional (ripple 1.0))
"(make-chebyshev-highpass n fc :optional (ripple 1.0)) returns a highpass Chebyshev filter; n = order, \
(define* (make-chebyshev-highpass n fc (ripple 1.0))
"(make-chebyshev-highpass n fc (ripple 1.0)) returns a highpass Chebyshev filter; n = order, \
fc = cutoff freq (srate = 1.0): (make-chebyshev-highpass 8 .1 .01)"
(if (odd? n) (set! n (+ n 1)))
(let* ((proto (chebyshev-prototype n ripple))
......@@ -187,8 +187,8 @@ fc = cutoff freq (srate = 1.0): (make-chebyshev-highpass 8 .1 .01)"
(coeffs (analog->digital n (car hproto) (cadr hproto) fc)))
(make-filter :xcoeffs (car coeffs) :ycoeffs (cadr coeffs))))
(define* (make-chebyshev-bandpass n fl fh :optional (ripple 1.0))
"(make-chebyshev-bandpass n fl fh :optional (ripple 1.0)) returns a bandpass Chebyshev filter; n = order, \
(define* (make-chebyshev-bandpass n fl fh (ripple 1.0))
"(make-chebyshev-bandpass n fl fh (ripple 1.0)) returns a bandpass Chebyshev filter; n = order, \
fl and fh = edge freqs (srate = 1.0): (make-chebyshev-bandpass 4 .1 .2)"
(if (odd? n) (set! n (+ n 1)))
(let* ((lp (make-chebyshev-lowpass n fh ripple))
......@@ -196,8 +196,8 @@ fl and fh = edge freqs (srate = 1.0): (make-chebyshev-bandpass 4 .1 .2)"
(lambda (y)
(filter lp (filter hp y)))))
(define* (make-chebyshev-bandstop n fl fh :optional (ripple 1.0))
"(make-chebyshev-bandstop n fl fh :optional (ripple 1.0)) returns a bandstop Chebyshev filter; n = order, \
(define* (make-chebyshev-bandstop n fl fh (ripple 1.0))
"(make-chebyshev-bandstop n fl fh (ripple 1.0)) returns a bandstop Chebyshev filter; n = order, \
fl and fh = edge freqs (srate = 1.0): (make-chebyshev-bandstop 8 .1 .4 .01)"
(if (odd? n) (set! n (+ n 1)))
(let* ((lp (make-chebyshev-lowpass n fl ripple))
......@@ -209,7 +209,7 @@ fl and fh = edge freqs (srate = 1.0): (make-chebyshev-bandstop 8 .1 .4 .01)"
;;; ---------------- inverse Chebyshev ----------------
(define* (inverse-chebyshev-prototype n :optional (loss-dB 60.0)) ; stopband loss
(define* (inverse-chebyshev-prototype n (loss-dB 60.0)) ; stopband loss
(let* ((e (sqrt (/ 1.0 (- (expt 10.0 (* 0.1 loss-dB)) 1.0))))
(v0 (/ (asinh (/ 1.0 e)) (exact->inexact n)))
(len (/ (* n 3) 2))
......@@ -231,16 +231,16 @@ fl and fh = edge freqs (srate = 1.0): (make-chebyshev-bandstop 8 .1 .4 .01)"
(list num den
(expt 1.122 (- loss-dB))))) ; argh
(define* (make-inverse-chebyshev-lowpass n fc :optional (loss-dB 60.0))
"(make-inverse-chebyshev-lowpass n fc :optional (loss-dB 60.0)) returns a lowpass inverse-Chebyshev filter; n = order, \
(define* (make-inverse-chebyshev-lowpass n fc (loss-dB 60.0))
"(make-inverse-chebyshev-lowpass n fc (loss-dB 60.0)) returns a lowpass inverse-Chebyshev filter; n = order, \
fc = cutoff freq (srate = 1.0): (make-inverse-chebyshev-lowpass 10 .4 120)"
(if (odd? n) (set! n (+ n 1)))
(let* ((proto (inverse-chebyshev-prototype n loss-dB))
(coeffs (analog->digital n (car proto) (cadr proto) fc)))
(make-filter :xcoeffs (vct-scale! (car coeffs) (caddr proto)) :ycoeffs (cadr coeffs))))
(define* (make-inverse-chebyshev-highpass n fc :optional (loss-dB 60.0))
"(make-inverse-chebyshev-highpass n fc :optional (loss-dB 60.0)) returns a highpass inverse-Chebyshev filter; n = order, \
(define* (make-inverse-chebyshev-highpass n fc (loss-dB 60.0))
"(make-inverse-chebyshev-highpass n fc (loss-dB 60.0)) returns a highpass inverse-Chebyshev filter; n = order, \
fc = cutoff freq (srate = 1.0): (make-inverse-chebyshev-highpass 10 .1 120)"
(if (odd? n) (set! n (+ n 1)))
(let* ((proto (inverse-chebyshev-prototype n loss-dB))
......@@ -248,16 +248,16 @@ fc = cutoff freq (srate = 1.0): (make-inverse-chebyshev-highpass 10 .1 120)"
(coeffs (analog->digital n (car hproto) (cadr hproto) fc)))
(make-filter :xcoeffs (vct-scale! (car coeffs) (caddr proto)) :ycoeffs (cadr coeffs))))
(define* (make-inverse-chebyshev-bandpass n fl fh :optional (loss-dB 60.0))
"(make-inverse-chebyshev-bandpass n fl fh :optional (loss-dB 60.0)) returns a bandpass inverse-Chebyshev filter; n = order, \
(define* (make-inverse-chebyshev-bandpass n fl fh (loss-dB 60.0))
"(make-inverse-chebyshev-bandpass n fl fh (loss-dB 60.0)) returns a bandpass inverse-Chebyshev filter; n = order, \
fl and fh are edge freqs (srate=1.0): (make-inverse-chebyshev-bandpass 8 .1 .4)"
(if (odd? n) (set! n (+ n 1)))
(let* ((lp (make-inverse-chebyshev-lowpass n fh loss-dB))
(hp (make-inverse-chebyshev-highpass n fl loss-dB)))
(lambda (y) (filter lp (filter hp y)))))
(define* (make-inverse-chebyshev-bandstop n fl fh :optional (loss-dB 60.0))
"(make-inverse-chebyshev-bandstop n fl fh :optional (loss-dB 60.0)) returns a bandstop inverse-Chebyshev filter; n = order, \
(define* (make-inverse-chebyshev-bandstop n fl fh (loss-dB 60.0))
"(make-inverse-chebyshev-bandstop n fl fh (loss-dB 60.0)) returns a bandstop inverse-Chebyshev filter; n = order, \
fl and fh are edge freqs (srate=1.0): (make-inverse-chebyshev-bandstop 8 .1 .4 90)"
(if (odd? n) (set! n (+ n 1)))
(let* ((lp (make-inverse-chebyshev-lowpass n fl loss-dB))
......@@ -352,9 +352,9 @@ fl and fh are edge freqs (srate=1.0): (make-inverse-chebyshev-bandstop 8 .1 .4 9
;;; ---------------- Elliptic ----------------
(define* (elliptic-prototype n :optional (ripple 1.0) (loss-dB 60.0))
(define* (elliptic-prototype n (ripple 1.0) (loss-dB 60.0))
(define* (minimize-function f xmin xmax :optional arg1 arg2)
(define* (minimize-function f xmin xmax arg1 arg2)
(let* ((n 20)
(x (make-vct n))
(fx (f xmin arg1 arg2)))
......@@ -439,16 +439,16 @@ fl and fh are edge freqs (srate=1.0): (make-inverse-chebyshev-bandstop 8 .1 .4 9
(set! g (abs (/ g (sqrt (+ 1.0 (* e e))))))
(list num den g)))
(define* (make-elliptic-lowpass n fc :optional (ripple 1.0) (loss-dB 60.0))
"(make-elliptic-lowpass n fc :optional (ripple 1.0) (loss-dB 60.0)) returns a lowpass elliptic filter; n = order, \
(define* (make-elliptic-lowpass n fc (ripple 1.0) (loss-dB 60.0))
"(make-elliptic-lowpass n fc (ripple 1.0) (loss-dB 60.0)) returns a lowpass elliptic filter; n = order, \
fc = cutoff freq (srate = 1.0): (make-elliptic-lowpass 8 .25 .01 90)"
(if (odd? n) (set! n (+ n 1)))
(let* ((proto (elliptic-prototype n ripple loss-dB))
(coeffs (analog->digital n (car proto) (cadr proto) fc)))
(make-filter :xcoeffs (vct-scale! (car coeffs) (caddr proto)) :ycoeffs (cadr coeffs))))
(define* (make-elliptic-highpass n fc :optional (ripple 1.0) (loss-dB 60.0))
"(make-elliptic-highpass n fc :optional (ripple 1.0) (loss-dB 60.0)) returns a highpass elliptic filter; n = order, \
(define* (make-elliptic-highpass n fc (ripple 1.0) (loss-dB 60.0))
"(make-elliptic-highpass n fc (ripple 1.0) (loss-dB 60.0)) returns a highpass elliptic filter; n = order, \
fc = cutoff freq (srate = 1.0): (make-elliptic-highpass 8 .25 .01 90)"
(if (odd? n) (set! n (+ n 1)))
(let* ((proto (elliptic-prototype n ripple loss-dB))
......@@ -456,8 +456,8 @@ fc = cutoff freq (srate = 1.0): (make-elliptic-highpass 8 .25 .01 90)"
(coeffs (analog->digital n (car hproto) (cadr hproto) fc)))
(make-filter :xcoeffs (vct-scale! (car coeffs) (caddr proto)) :ycoeffs (cadr coeffs))))
(define* (make-elliptic-bandpass n fl fh :optional (ripple 1.0) (loss-dB 60.0))
"(make-elliptic-bandpass n fl fh :optional (ripple 1.0) (loss-dB 60.0)) returns a bandpass elliptic filter; n = order, \
(define* (make-elliptic-bandpass n fl fh (ripple 1.0) (loss-dB 60.0))
"(make-elliptic-bandpass n fl fh (ripple 1.0) (loss-dB 60.0)) returns a bandpass elliptic filter; n = order, \
fl and fh are edge freqs (srate=1.0): (make-elliptic-bandpass 6 .1 .2 .1 90)"
(if (odd? n) (set! n (+ n 1)))
(let* ((lp (make-elliptic-lowpass n fh ripple loss-dB))
......@@ -465,8 +465,8 @@ fl and fh are edge freqs (srate=1.0): (make-elliptic-bandpass 6 .1 .2 .1 90)"
(lambda (y)
(filter lp (filter hp y)))))
(define* (make-elliptic-bandstop n fl fh :optional (ripple 1.0) (loss-dB 60.0))
"(make-elliptic-bandstop n fl fh :optional (ripple 1.0) (loss-dB 60.0)) returns a bandstop elliptic filter; n = order, \
(define* (make-elliptic-bandstop n fl fh (ripple 1.0) (loss-dB 60.0))
"(make-elliptic-bandstop n fl fh (ripple 1.0) (loss-dB 60.0)) returns a bandstop elliptic filter; n = order, \
fl and fh are edge freqs (srate=1.0): (make-elliptic-bandstop 6 .1 .2 .1 90)"
(if (odd? n) (set! n (+ n 1)))
(let* ((lp (make-elliptic-lowpass n fl ripple loss-dB))
......
......@@ -225,7 +225,6 @@
;;; Killdeer
(use-modules (ice-9 optargs) (ice-9 format))
(provide 'snd-animals.scm)
(if (not (provided? 'snd-generators.scm)) (load "generators.scm"))
......@@ -11038,7 +11037,7 @@
;;; ================ calling-all-animals ================
(define* (calling-all-frogs :optional (beg 0.0) (spacing 0.0))
(define* (calling-all-frogs (beg 0.0) (spacing 0.0))
(plains-spadefoot (+ beg 0) 0.25) (set! beg (+ beg spacing))
(barking-tree-frog (+ beg 1) 0.25) (set! beg (+ beg spacing))
(western-toad (+ beg 1.5) 2 0.25) (set! beg (+ beg spacing))
......@@ -11068,12 +11067,12 @@
(+ beg 45))
(define* (calling-all-mammals :optional (beg 0.0) (spacing 0.0))
(define* (calling-all-mammals (beg 0.0) (spacing 0.0))
(indri beg 0.25) (set! beg (+ beg spacing))
(+ beg 2))
(define* (calling-all-insects :optional (beg 0.0) (spacing 0.0))
(define* (calling-all-insects (beg 0.0) (spacing 0.0))
(mosquito (+ beg 0) 5 560 0.2) (set! beg (+ beg spacing))
(mosquito (+ beg 1) 3 880 0.05) (set! beg (+ beg spacing))
(broad-winged-tree-cricket (+ beg 5.5) 2.0 0.2) (set! beg (+ beg spacing))
......@@ -11101,7 +11100,7 @@
(+ beg 71))
(define* (calling-all-birds :optional (beg 0.0) (spacing .25))
(define* (calling-all-birds (beg 0.0) (spacing .25))
(ruffed-grouse (+ beg 0.0) 0.5) (set! beg (+ beg spacing))
(eastern-wood-pewee-1 (+ beg 11.0) 0.25) (set! beg (+ beg spacing))
(eastern-wood-pewee-2 (+ beg 12.5) 0.25) (set! beg (+ beg spacing))
......
This diff is collapsed.
;;; -------- auto-save
(use-modules (ice-9 format))
(provide 'snd-autosave.scm)
(if (not (provided? 'snd-extensions.scm)) (load-from-path "extensions.scm"))
(if (not (provided? 'snd-extensions.scm)) (load "extensions.scm"))
(define auto-save-interval 60.0) ;seconds between auto-save checks
(define auto-saving #f)
......
#!/usr/bin/env ruby -wd
#!/usr/local/bin/ruby -wd
# bess -- Translation of Bill Schottstaedt's bess.scm to Ruby.
# Copyright (C) 2002--2006 Michael Scholz
# Copyright (c) 2002--2009 Michael Scholz <mi-scholz@users.sourceforge.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
begin require 'rubygems' rescue LoadError end
# Author: Michael Scholz <mi-scholz@users.sourceforge.net>
# Created: Sun Sep 15 19:11:12 CEST 2002
# Changed: Fri Jul 06 01:53:45 CEST 2007
# Keywords: dac, sound, snd, clm
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
# Code:
rcsid = "$Id: bess.rb,v 1.9 2007/07/05 23:54:46 mike Exp $"
file = File.basename __FILE__
banner = "This is #{file.upcase} v#{rcsid.split(' ')[2]}, (C) 2002--2006 Michael Scholz"
banner = "This is #{file.upcase} v1.9, (C) 2002--2009 Michael Scholz"
def warn(*args)