[CM] Source File for SIMP

Esben Stien b0ef@esben-stien.name
Sun, 21 May 2006 21:54:33 +0200


Trying to get started with CLM.

I start emacs, then M-x slime; this brings me to the CL-USER prompt. I
then proceed to load all.lisp from the CLM package. This responds
with:

;   using existing configuration file config.h
T

I then try to evaluate the simple sine code: 

(definstrument simp (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)))))

..as explained in the manual, but this throws an error:

oops -- I can't find SIMP's lisp source file!
   [Condition of type SIMPLE-ERROR]

Restarts:
  0: [ABORT-REQUEST] Abort handling SLIME request.
  1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {B571819}>)

Backtrace:
  0: ((LAMBDA (#:WHOLE106 #:ENVIRONMENT107)) (DEFINSTRUMENT SIMP (START-TIME DURATION FREQUENCY AMPLITUDE) (LET* (# # #) (RUN #))) #<NULL-LEXENV>)
  1: (MACROEXPAND-1 (DEFINSTRUMENT SIMP (START-TIME DURATION FREQUENCY AMPLITUDE) (LET* (# # #) (RUN #))) #<NULL-LEXENV>)
  2: (MACROEXPAND (DEFINSTRUMENT SIMP (START-TIME DURATION FREQUENCY AMPLITUDE) (LET* (# # #) (RUN #))) #<NULL-LEXENV>)

Maybe it's something I haven't loaded. Trying to compile-file the
v.ins file gets me a whole page of errors: 

CL-USER> (compile-file "/home/b0ef/.inbound/clm-3/v.ins")
; Writing "/home/b0ef/.inbound/clm-3/clm_FM_VIOLIN.c"
; 
; caught STYLE-WARNING:
;   using deprecated EVAL-WHEN situation names EVAL LOAD

; 
; caught STYLE-WARNING:
;   using deprecated EVAL-WHEN situation names EVAL LOAD COMPILE
; Compiling "/home/b0ef/.inbound/clm-3/clm_FM_VIOLIN.c"
; Creating shared object file "/home/b0ef/.inbound/clm-3/clm_FM_VIOLIN.so"

; 
; caught STYLE-WARNING:
;   using deprecated EVAL-WHEN situation names LOAD EVAL


; file: /home/b0ef/.inbound/clm-3/v.ins
; in: DEFINSTRUMENT FM-VIOLIN
;     (RUN
;    (LOOP FOR
;          I
;          FROM
;          BEG
;          TO
;          END
;          DO
;          (DECLARE
;           (TYPE :FLOAT
;                 NOISE-AMOUNT
;                 FUZZ
;                 IND-FUZZ
;                 AMP-FUZZ
;                 MODULATION
;                 FM1-RAT
;                 FM2-RAT
;                 FM3-RAT
;                 VIB)
;           (TYPE :MUS-ANY IND-NOI AMP-NOI)
;           (TYPE :DOUBLE* COEFFS)
;           (TYPE :BOOLEAN FROBBER EASY-CASE MODULATE))
;          (IF (/= 0.0 NOISE-AMOUNT)
;              (IF (NULL FROBBER) (SETF FUZZ #) (SETF FUZZ #)))
;          (SETF VIB (+ (ENV FRQF) (TRIANGLE-WAVE PERVIB) (RAND-INTERP RANVIB)))
;          (IF IND-NOI (SETF IND-FUZZ (+ 1.0 #)))
;          ...))
; --> MACROEXPAND-1 CLM::RUN-1 PROGN CLM::<END-2> LET MULTIPLE-VALUE-BIND 
; --> MULTIPLE-VALUE-CALL 
; ==>
;   #'(LAMBDA
;         (&OPTIONAL (CLM::*CLM-DATAI-LEN*) (CLM::*CLM-DATAR-LEN*) &REST #:G226)
;       (DECLARE (IGNORE #:G226))
;       (LET ((CLM::*CLM-BEG* (FLOOR #))
;             (CLM::*CLM-END* (AND # #))
;             (CLM::*CLM-DATAI*
;              (MAKE-INTEGER-ARRAY CLM::*CLM-DATAI-LEN* :INITIAL-ELEMENT 0))
;             (CLM::*CLM-DATAR* (MAKE-DOUBLE-ARRAY CLM::*CLM-DATAR-LEN*)))
;         (CLM::LOAD-VARS 49
;                         26
;                         '((MODULATE 47 0 :BOOLEAN) (EASY-CASE 45 0 :BOOLEAN)
;                           (FROBBER 43 0 :BOOLEAN) (COEFFS 41 0 :DOUBLE-ARRAY)
;                           (VIB 0 25 :REAL) (FM3-RAT 0 24 :REAL)
;                           (FM2-RAT 0 23 :REAL) (FM1-RAT 0 22 :REAL)
;                           (MODULATION 0 21 :REAL) (AMP-FUZZ 0 20 :REAL)
;                           (IND-FUZZ 0 19 :REAL) (FUZZ 0 18 :REAL) ...)
;                         CLM::VARDATA
;                         CLM::*CLM-DATAI*
;                         CLM::*CLM-DATAR*)
;         (CLM::TO-BIGNUM CLM::*CLM-BEG* CLM::*CLM-DATAI* CLM::+CLM-BEG+)
;         (CLM::TO-BIGNUM (OR CLM::*CLM-END* 0) CLM::*CLM-DATAI* CLM::+CLM-END+)
;         (IF (AND END (< CLM::*CLM-END* CLM::*CLM-BEG*))
;             (WARN "end time < begin time: ~A from ~A to ~A?"
;                   'FM-VIOLIN
;                   CLM::*CLM-BEG*
;                   CLM::*CLM-END*))
;         (IF *CLM-DEBUG*
;             (PRINT
;              (FORMAT NIL
;                      "(~A ~A~%  ~A~%  ~A ~A ~A)"
;                      '|clm_fm_violin11|
;                      CLM::*CLM-BEG*
;                      CLM::*CLM-END*
;                      CLM::*CLM-DATAR*
;                      CLM::*CLM-DATAI*
;                      CLM::*CLM-DATAR-LEN*)))
;         (SETF (GET *CLM-INS* :DATAI) CLM::*CLM-DATAI*)
;         (SETF (GET *CLM-INS* :DATAR) CLM::*CLM-DATAR*)
;         (SETF CLM-LAST-BEGIN-TIME (MAX CLM-LAST-BEGIN-TIME CLM::*CLM-BEG*))
;         (PROGN (TAGBODY (RESTART-CASE # #) CLM::NOTE-ALL-DONE))
;         (IF (NOT (ZEROP #))
;             (FORMAT T
;                     "interrupted: ~A"
;                     (AREF CLM::*CLM-DATAI* CLM::+CLM-INTERRUPTED+)))))
; 
; caught STYLE-WARNING:
;   using the lexical binding of the symbol CLM::*CLM-DATAI-LEN*, not the
;   dynamic binding, even though the symbol name follows the usual naming
;   convention (names like *FOO*) for special variables
; 
; caught STYLE-WARNING:
;   using the lexical binding of the symbol CLM::*CLM-DATAR-LEN*, not the
;   dynamic binding, even though the symbol name follows the usual naming
;   convention (names like *FOO*) for special variables

; --> MACROEXPAND-1 CLM::RUN-1 PROGN CLM::<END-2> LET MULTIPLE-VALUE-BIND 
; --> MULTIPLE-VALUE-CALL FUNCTION 
; ==>
;   (LET ((CLM::*CLM-BEG* (FLOOR (+ BEG CLM::*OFFSET*)))
;         (CLM::*CLM-END* (AND (NUMBERP END) (FLOOR #)))
;         (CLM::*CLM-DATAI*
;          (MAKE-INTEGER-ARRAY CLM::*CLM-DATAI-LEN* :INITIAL-ELEMENT 0))
;         (CLM::*CLM-DATAR* (MAKE-DOUBLE-ARRAY CLM::*CLM-DATAR-LEN*)))
;     (CLM::LOAD-VARS 49
;                     26
;                     '((MODULATE 47 0 :BOOLEAN) (EASY-CASE 45 0 :BOOLEAN)
;                       (FROBBER 43 0 :BOOLEAN) (COEFFS 41 0 :DOUBLE-ARRAY)
;                       (VIB 0 25 :REAL) (FM3-RAT 0 24 :REAL)
;                       (FM2-RAT 0 23 :REAL) (FM1-RAT 0 22 :REAL)
;                       (MODULATION 0 21 :REAL) (AMP-FUZZ 0 20 :REAL)
;                       (IND-FUZZ 0 19 :REAL) (FUZZ 0 18 :REAL) ...)
;                     CLM::VARDATA
;                     CLM::*CLM-DATAI*
;                     CLM::*CLM-DATAR*)
;     (CLM::TO-BIGNUM CLM::*CLM-BEG* CLM::*CLM-DATAI* CLM::+CLM-BEG+)
;     (CLM::TO-BIGNUM (OR CLM::*CLM-END* 0) CLM::*CLM-DATAI* CLM::+CLM-END+)
;     (IF (AND END (< CLM::*CLM-END* CLM::*CLM-BEG*))
;         (WARN "end time < begin time: ~A from ~A to ~A?"
;               'FM-VIOLIN
;               CLM::*CLM-BEG*
;               CLM::*CLM-END*))
;     (IF *CLM-DEBUG*
;         (PRINT
;          (FORMAT NIL
;                  "(~A ~A~%  ~A~%  ~A ~A ~A)"
;                  '|clm_fm_violin11|
;                  CLM::*CLM-BEG*
;                  CLM::*CLM-END*
;                  CLM::*CLM-DATAR*
;                  CLM::*CLM-DATAI*
;                  CLM::*CLM-DATAR-LEN*)))
;     (SETF (GET *CLM-INS* :DATAI) CLM::*CLM-DATAI*)
;     (SETF (GET *CLM-INS* :DATAR) CLM::*CLM-DATAR*)
;     (SETF CLM-LAST-BEGIN-TIME (MAX CLM-LAST-BEGIN-TIME CLM::*CLM-BEG*))
;     (PROGN
;      (TAGBODY
;        (RESTART-CASE
;         (|clm_fm_violin11| CLM::*CLM-DATAR*
;                            CLM::*CLM-DATAR-LEN*
;                            CLM::*CLM-DATAI*
;                            CLM::*CLM-DATAI-LEN*)
;         (NIL NIL :REPORT "try to exit current note cleanly and go on." #))
;       CLM::NOTE-ALL-DONE))
;     (IF (NOT (ZEROP (AREF CLM::*CLM-DATAI* CLM::+CLM-INTERRUPTED+)))
;         (FORMAT T
;                 "interrupted: ~A"
;                 (AREF CLM::*CLM-DATAI* CLM::+CLM-INTERRUPTED+))))
; 
; caught STYLE-WARNING:
;   using the lexical binding of the symbol CLM::*CLM-BEG*, not the
;   dynamic binding, even though the symbol name follows the usual naming
;   convention (names like *FOO*) for special variables
; 
; caught STYLE-WARNING:
;   using the lexical binding of the symbol CLM::*CLM-END*, not the
;   dynamic binding, even though the symbol name follows the usual naming
;   convention (names like *FOO*) for special variables
; 
; caught STYLE-WARNING:
;   using the lexical binding of the symbol CLM::*CLM-DATAI*, not the
;   dynamic binding, even though the symbol name follows the usual naming
;   convention (names like *FOO*) for special variables
; 
; caught STYLE-WARNING:
;   using the lexical binding of the symbol CLM::*CLM-DATAR*, not the
;   dynamic binding, even though the symbol name follows the usual naming
;   convention (names like *FOO*) for special variables

; 
; caught STYLE-WARNING:
;   using deprecated EVAL-WHEN situation names LOAD EVAL
; 
; compilation unit finished
;   caught 10 STYLE-WARNING conditions
#P"/home/b0ef/.inbound/clm-3/v.fasl"
T
NIL

Any pointers to get me started is greatly appreciated. 

-- 
Esben Stien is b0ef@e     s      a             
         http://www. s     t    n m
          irc://irc.  b  -  i  .   e/%23contact
           sip:b0ef@   e     e 
           jid:b0ef@    n     n