[CM] dlocsig example

James Hearon j_hearon at hotmail.com
Tue Dec 15 09:45:26 PST 2015


Hi,
Thanks for the info on move-sound and move-it.  I'm trying to figure out how those work, and didn't know there was a dlocsig ex in clm.  

For the sinewave ex. listed earlier using dlocsig, I'm using f23, sbcl, emacs, clm and slime, and the error below is about can't handle DLOCSIG etc.  Admittedly I'm not totally proficient at understanding the slime-repl output, so this may not be what you need.

Thank You.
Jim

Execution of a form compiled with errors.
Form:
  (DEFINSTRUMENT SINEWAVE
    (START-TIME DURATION FREQ AMP &KEY (AMP-ENV '(0 1 1 1))
     (PATH (MAKE-PATH :PATH '(-10 10 0 5 10 10))))
  (MULTIPLE-VALUE-BIND (DLOC BEG END)
      (MAKE-DLOCSIG :START-TIME START-TIME :DURATION DURATION :PATH PATH)
    (LET* ((OSC (MAKE-OSCIL :FREQUENCY FREQ))
           (AENV (MAKE-ENV :ENVELOPE AMP-ENV :SCALER AMP)))
      (RUN
       (LOOP FOR I FROM BEG BELOW
             END
             DO (DLOCSIG DLOC I (* (ENV AENV) (OSCIL OSC))))))))
Compile-time error:
  (during macroexpansion of (DEFINSTRUMENT SINEWAVE
    ...))
the run macro can't handle DLOCSIG in (DLOCSIG DLOC I
                                       (* (ENV AENV) (OSCIL OSC)))
   [Condition of type SB-INT:COMPILED-PROGRAM-ERROR]

Restarts:
 0: [*ABORT] Return to SLIME's top level.
 1: [ABORT] abort thread (#<THREAD "worker" RUNNING {1005D354F3}>)

Backtrace:
  0: (SB-FASL::LOAD-FASL-GROUP #S(SB-FASL::FASL-INPUT :STREAM #<SB-SYS:FD-STREAM for "file /opt/clm_stuff/jsdlocsig.fasl" {10049E76E3}> :TABLE #(447 #<PACKAGE "SB-IMPL"> SB-IMPL::%DEFUN #<PACKAGE "COMMON-L..
  1: (SB-FASL::LOAD-AS-FASL #<SB-SYS:FD-STREAM for "file /opt/clm_stuff/jsdlocsig.fasl" {10049E76E3}> NIL NIL)
  2: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<SB-SYS:FD-STREAM for "file /opt/clm_stuff/jsdlocsig.fasl" {10049E76E3}> T)
  3: (LOAD #P"/opt/clm_stuff/jsdlocsig.fasl" :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
 --more--

(definstrument sinewave (start-time duration freq amp 
		         &key
			 (amp-env '(0 1 1 1))
			 (path (make-path :path '(-10 10 0 5 10 10))))
  (multiple-value-bind (dloc beg end)
      (make-dlocsig :start-time start-time
		    :duration duration
		    :path path)
    (let* ((osc (make-oscil :frequency freq))
	   (aenv (make-env :envelope amp-env :scaler amp)))
      (run
       (loop for i from beg below end do
	 (dlocsig dloc i (* (env aenv)(oscil osc))))))))

________________________________________
From: cmdist-bounces at ccrma.Stanford.EDU <cmdist-bounces at ccrma.Stanford.EDU> on behalf of cmdist-request at ccrma.Stanford.EDU <cmdist-request at ccrma.Stanford.EDU>
Sent: Monday, December 14, 2015 8:00 PM
To: cmdist at ccrma.Stanford.EDU
Subject: Cmdist Digest, Vol 92, Issue 2

Send Cmdist mailing list submissions to
        cmdist at ccrma.stanford.edu

To subscribe or unsubscribe via the World Wide Web, visit
        https://cm-mail.stanford.edu/mailman/listinfo/cmdist
or, via email, send a message with subject or body 'help' to
        cmdist-request at ccrma.stanford.edu

You can reach the person managing the list at
        cmdist-owner at ccrma.stanford.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Cmdist digest..."


Today's Topics:

   1. dlocsig example (James Hearon)
   2. Re: dlocsig example (bil at ccrma.Stanford.EDU)


----------------------------------------------------------------------

Message: 1
Date: Mon, 14 Dec 2015 18:03:02 +0000
From: James Hearon <j_hearon at hotmail.com>
To: "cmdist at ccrma.Stanford.EDU" <cmdist at ccrma.Stanford.EDU>
Subject: [CM] dlocsig example
Message-ID:
        <BLUPR10MB0836AD6CF2C42ACE43E86969E5ED0 at BLUPR10MB0836.namprd10.prod.outlook.com>

Content-Type: text/plain; charset="iso-8859-1"


Hi,
I'm getting myself all fouled up with trying to run a simple dlocsig example in clm.  I was using this one, from
https://ccrma.stanford.edu/~nando/clm/dlocsig/

(definstrument sinewave (start-time duration freq amp
                         &key
                         (amp-env '(0 1 1 1))
                         (path (make-path :path '(-10 10 0 5 10 10))))
  (multiple-value-bind (dloc beg end)
      (make-dlocsig :start-time start-time
                    :duration duration
                    :path path)
    (let* ((osc (make-oscil :frequency freq))
           (aenv (make-env :envelope amp-env :scaler amp)))
      (run
       (loop for i from beg below end do
         (dlocsig dloc i (* (env aenv)(oscil osc))))))))

---------------------------------
I can move the samples in time using plain locsig and the run loop below, binding the variables start and end,
but dlocsig seems  to need the multiple-bind structure which I can't seem to to get to run.  I'm wondering if there's a better simple example someplace?  Thank You.

(definstrument sinewave (start-time duration freq amp deg dis
                         &key
                         (amp-env '(0 1 1 1)) )
    (let* ((osc (make-oscil :frequency freq))
          (start (floor (* start-time *srate*)))
         (end (+ start (floor (* duration *srate*))))
           (aenv (make-env :envelope amp-env :duration duration :scaler amp))
                 (loc (make-locsig :degree deg :distance dis  :reverb .05)))
      (run
       (loop for i from start to end do
            (locsig loc i (* (env aenv)(oscil osc)))
            ))));)


------------------------------

Message: 2
Date: Mon, 14 Dec 2015 10:34:19 -0800
From: bil at ccrma.Stanford.EDU
To: James Hearon <j_hearon at hotmail.com>
Cc: "cmdist at ccrma.Stanford.EDU" <cmdist at ccrma.Stanford.EDU>
Subject: Re: [CM] dlocsig example
Message-ID: <c83ae2e9e810874c77ba232653e3be04 at ccrma.stanford.edu>
Content-Type: text/plain; charset=US-ASCII; format=flowed

Which lisp are you running, and what error did you get?
Here I am running the move-sound instrument in sbcl:

(load "all.lisp")
(compile-file "dlocsig.lisp")
(load "dlocsig.fasl")
(compile-file "move-sound.ins")
(load "move-sound.fasl")
(load "v")
(with-sound (:channels 4) (move-it (:path (make-path '((-10 10) (.1 .1)
(10 -10)))) (fm-violin 0 1 440 .1)))

and I got "test.snd".



------------------------------

_______________________________________________
Cmdist mailing list
Cmdist at ccrma.stanford.edu
https://cm-mail.stanford.edu/mailman/listinfo/cmdist


End of Cmdist Digest, Vol 92, Issue 2
*************************************




More information about the Cmdist mailing list