[CM] Looking for code critique.
Bill Schottstaedt
bil@ccrma.Stanford.EDU
Mon, 6 Aug 2007 05:55:36 -0700
Your code looks fine to me. I don't use "require" much because
I believe it is non-portable, and was removed from the newer
versions of CL(?). Also the export and defpackage statements might want to use
lower-case -- many lisps are (or at least can be) case-sensitive --
I actually don't know whether it matters in these contexts.
My practice is to use the default package ("user" or whatever),
but I can't think of any reason not to use your own packages.
To make the "envutil:" unnecessary, import the functions you
want -- there are examples in clm-package.lisp, or (I think)
just use the import function:
(import '(envutil:dasr))
I didn't actually test this.
The macro form is the normal way in CLM to make a new generator.
(The problem with using a function + struct is that the "run" macro
is not smart enough to translate the code to C).
To add a begin time later, just add another argument to the
instrument, and plug it in where you now have "0" in
times->samples.
Some of the functions in envutil.lisp
are also in env.lisp, but use "loop". CLM used to have
a function named "divenv" that is similar to your
"adsr" -- the replacement for it was "stretch-envelope"
in env.lisp.
Your code is elegant! Can I include it in the CLM tarball?