[CM] Looking for code critique.

Steven Jones plewto at gmail.com
Mon Aug 6 01:18:23 PDT 2007


I'm just learning CLM and seek advice. First some background, I have
years of experience with Nyquist and thus XLISP, not so much with
Common Lisp.  With Nyquist I have striven to write reusable code
whenever possible.  As an exercise I have attempted to write a
reusable delayed onset LFO in CLM.  The resulting code is in the
attachment.  I have also attached code for common envelope contours.
A few "utility" functions are defined outside of these files but have
fairly obvious use.

A few questions:
1) XLISP does not have a package system and I'm still a little unsure
how packages work. In envutil.lisp I have defined the envutil package.
For such simple code would it be better to simply use the CLM package?
 In dlfo I have to explicitly call envutil:dasr.  Is there any way to
"expose" dasr such that I no longer need the package prefix?

2) In Nyquist I would have defined dlfo as a function. After some
experiments I defined two functions for CLM, one to create the lfo and
associated envelope objects, the other (actually a macro) to combine
these two objects within an instrument body. Is this a typical
approach with CLM?

3) So far the test instruments I have defined have a duration argument
but no start time argument. The start time defaults to 0 within the
instrument definition. Once I get into scoring compositions would this
lack of explicit start time come back to haunt me?

Thanks much in advance
Steven Jones
-------------- next part --------------
A non-text attachment was scrubbed...
Name: envutil.lisp
Type: application/octet-stream
Size: 10984 bytes
Desc: not available
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20070806/68148bf1/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dlfo.lisp
Type: application/octet-stream
Size: 956 bytes
Desc: not available
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20070806/68148bf1/attachment-0001.obj>


More information about the Cmdist mailing list