<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi,<br>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.<br><br>M-x slime-compile-and-load-file<br><br>(definstrument examp1 (start-time duration frequency amplitude)<br> (let* ((beg (floor (* start-time *srate*)))<br> (end (+ beg (floor (* duration *srate*))))<br> (j 0))<br> (run<br> (loop for i from beg below end do<br> (outa i (* amplitude (sin (* j 2.0 pi (/ frequency *srate*)))))<br> (incf j)))))<br><br>(with-sound () (examp1 0 3.25 440.0 0.75))<br><br>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. <br><br>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?<br><br>Regards,<br>Jim<br><br><br><div>> 1. emacs, slime, sbcl, clm (James Hearon)<br>> 2. Re: emacs, slime, sbcl, clm (Bill Schottstaedt)<br>> <br>> <br>> ----------------------------------------------------------------------<br>> <br>> Message: 1<br>> Date: Fri, 6 Sep 2013 18:08:25 +0000<br>> From: James Hearon <j_hearon@hotmail.com><br>> Subject: [CM] emacs, slime, sbcl, clm<br>> To: "cmdist@ccrma.Stanford.EDU" <cmdist@ccrma.Stanford.EDU><br>> Message-ID: <BLU168-W6088784E43A4B984C0C0F1E53C0@phx.gbl><br>> Content-Type: text/plain; charset="iso-8859-1"<br>> <br>> Hi,<br>> I'm getting myself confused about how to evaluate a clm .lisp file in emacs.<br>> <br>> I tried evaluating the inst below but get a lisp error: (void-function with-sound).<br>> <br>> (definstrument examp1 (start-time duration frequency amplitude)<br>> (let* ((beg (floor (* start-time *srate*)))<br>> (end (+ beg (floor (* duration *srate*))))<br>> (j 0))<br>> (run<br>> (loop for i from beg below end do<br>> (outa i (* amplitude (sin (* j 2.0 pi (/ frequency *srate*)))))<br>> (incf j)))))<br>> <br>> (with-sound () (examp1 0 3.25 440.0 0.75))<br>> <br>> 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?<br>> <br>> Regards,<br>> Jim<br>>                                            <br>> -------------- next part --------------<br>> An HTML attachment was scrubbed...<br>> URL: http://ccrma-mail.stanford.edu/mailman/private/cmdist/attachments/20130906/2a94fa56/attachment-0001.html <br>> <br>> ------------------------------<br>> <br>> Message: 2<br>> Date: Fri, 6 Sep 2013 11:48:33 -0700<br>> From: "Bill Schottstaedt" <bil@ccrma.Stanford.EDU><br>> Subject: Re: [CM] emacs, slime, sbcl, clm<br>> To: James Hearon <j_hearon@hotmail.com>,        "cmdist@ccrma.Stanford.EDU"<br>>         <cmdist@ccrma.Stanford.EDU><br>> Message-ID: <20130906184636.M74072@ccrma.Stanford.EDU><br>> Content-Type: text/plain;        charset=iso-8859-1<br>> <br>> You do need to compile the instrument code in the CL clm -- the compiler<br>> forces the run macro to expand fully, or something like that. <br>> <br>> <br>> <br>> ------------------------------<br>> <br>> _______________________________________________<br>> Cmdist mailing list<br>> Cmdist@ccrma.stanford.edu<br>> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist<br>> <br>> <br>> End of Cmdist Digest, Vol 65, Issue 1<br>> *************************************<br></div>                                            </div></body>
</html>