Hi,
It took me a while to finally grok this--to be able to write code in a .lisp
file and compile and load it, but it seems something called slime fancy
commands provides an answer.
M-x slime-compile-and-load-file
(definstrument examp1 (start-time duration frequency amplitude)
(let* ((beg (floor (* start-time *srate*)))
(end (+ beg (floor (* duration *srate*))))
(j 0))
(run
(loop for i from beg below end do
(outa i (* amplitude (sin (* j 2.0 pi (/ frequency *srate*)))))
(incf j)))))
(with-sound () (examp1 0 3.25 440.0 0.75))
So I can do this all in one step in emacs now (after M-x slime, then (load
"all.lisp")), and that helps with tweaking the instrument code in the buffer as
opposed to loading and compiling an .ins file. I guessing that's probably
going backwards in terms of how/why those files (.ins, .fasl, .clm) developed,
and once the instrument is tweaked out, then I can see it's probably best to go
ahead and create an .ins file out of the .lisp file, but the .lisp file seems
to make it easier for designing instruments in the emacs editor.
Am I on the right track here, or is there some compelling reason to employ .ins
files in CLM for designing an instrument in the emacs editor?
Regards,
Jim
> 1. emacs, slime, sbcl, clm (James Hearon)
> 2. Re: emacs, slime, sbcl, clm (Bill Schottstaedt)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 6 Sep 2013 18:08:25 +0000
> From: James Hearon <[email protected]>
> Subject: [CM] emacs, slime, sbcl, clm
> To: "[email protected]" <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi,
> I'm getting myself confused about how to evaluate a clm .lisp file in emacs.
>
> I tried evaluating the inst below but get a lisp error: (void-function
> with-sound).
>
> (definstrument examp1 (start-time duration frequency amplitude)
> (let* ((beg (floor (* start-time *srate*)))
> (end (+ beg (floor (* duration *srate*))))
> (j 0))
> (run
> (loop for i from beg below end do
> (outa i (* amplitude (sin (* j 2.0 pi (/ frequency *srate*)))))
> (incf j)))))
>
> (with-sound () (examp1 0 3.25 440.0 0.75))
>
> I did a load all.lisp before evaluating and all the .fasl files are generated
> etc. Also the compile-file, then load, and finally with-sound approach is
> working o.k. for .ins files, but I was trying to code an inst using a .lisp
> file and evaluating from emacs so I could play then edit(tweak) from the
> buffer. Does that approach not work?
>
> Regards,
> Jim
>
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://ccrma-mail.stanford.edu/mailman/private/cmdist/attachments/20130906/2a94fa56/attachment-0001.html
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 6 Sep 2013 11:48:33 -0700
> From: "Bill Schottstaedt" <[email protected]>
> Subject: Re: [CM] emacs, slime, sbcl, clm
> To: James Hearon <[email protected]>, "[email protected]"
> <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=iso-8859-1
>
> You do need to compile the instrument code in the CL clm -- the compiler
> forces the run macro to expand fully, or something like that.
>
>
>
> ------------------------------
>
> _______________________________________________
> Cmdist mailing list
> [email protected]
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
>
>
> End of Cmdist Digest, Vol 65, Issue 1
> *************************************
_______________________________________________
Cmdist mailing list
[email protected]
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist