[CM] some CM questions (long)

Dave Phillips dlphilp@bright.net
Sun, 06 Oct 2002 11:52:20 -0500


Rick Taube wrote:
 
> ... I assume you are using the latest CM version 2.3.4

Yes, under Linux kernel 2.4.18 and CMUCL 18d.
 

[re: how to specify output going to CLM]

> just write to a .clm or .aiff file.  Of course the objects you output need to be appriopriate for the
> output stream. so assumeing (foo) produced CLM objects you would do:
> 
>         (events (foo) "/tmp/foo.clm")
> or
>         (events (foo) "/tmp/foo.aiff" 0 :srate 22050 :channels 2)
> 
> or whatever. you may want to initailize the files first, ie
> 
>         (io "test.aiff" channels 2 srate 44100)
>         (events (whatever) "test.aiff")

Forgive my stupidity, Rick, but I'm unable to make most of these
examples work. I'm unclear about a lot of things:

  After starting 'lisp -core 'cm.core' I run (in-package :cm) and
everything appears okay. But if I try (load
"/home/dlphilp/cm/src/clm.lisp") I receive this error :

* (load "/home/dlphilp/cm/src/clm.lisp")

; Loading #p"/home/dlphilp/cm-2.3.4/src/clm.lisp".

Reader error at 1471 on #<Stream for file
"/home/dlphilp/cm-2.3.4/src/clm.lisp">:
Package "CLM" not found.

Restarts:
  0: [CONTINUE] Return NIL from load of "/home/dlphilp/cm/src/clm.lisp".
  1: [ABORT   ] Return to Top-Level.

Debug  (type H for help)

(COMMON-LISP::READ-TOKEN
 #<Stream for file "/home/dlphilp/cm-2.3.4/src/clm.lisp">
 #\c)
Source: Error finding source: 
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer
exists:
  target:code/reader.lisp.
0] 


   Umm, the file is indeed right there, but what am I not doing first ?
If I try loading CLM's own all.lisp I get this error :

* (load "/home/dlphilp/clm/all.lisp")

; Loading #p"/home/dlphilp/clm-2/all.lisp".
;; Loading #p"/home/dlphilp/clm-2/special-form-for-cmu.cl".
;; Loading #p"/home/dlphilp/clm-2/clm-package.x86f".
;; Loading #p"/home/dlphilp/clm-2/initmus.x86f".
;;; Running /usr/bin/ld...
;;; Done.
;; Loading #p"/home/dlphilp/clm-2/sndlib2clm.x86f".
;; Loading #p"/home/dlphilp/clm-2/defaults.x86f".
;; Loading #p"/home/dlphilp/clm-2/ffi.x86f".
;; Loading #p"/home/dlphilp/clm-2/io.x86f".
;; Loading #p"/home/dlphilp/clm-2/mus.x86f".
;; Loading #p"/home/dlphilp/clm-2/run.x86f".
;; Loading #p"/home/dlphilp/clm-2/cmus.x86f".
;; Loading #p"/home/dlphilp/clm-2/sound.x86f".
;; Loading #p"/home/dlphilp/clm-2/clm-help.x86f".
;; Loading #p"/home/dlphilp/clm-2/defins.x86f".
;; Loading #p"/home/dlphilp/clm-2/env.x86f".
;; Loading #p"/home/dlphilp/clm-2/clm-snd.x86f".
;; Loading #p"/home/dlphilp/clm-2/rt.x86f".
;; Loading #p"/home/dlphilp/clm-2/export.x86f".
;; Loading #p"/home/dlphilp/clm-2/clm1.x86f".

Error in function USE-PACKAGE:
   Use'ing package CLM results in name conflicts for these symbols:
(DAC ENV GRAPH)

Restarts:
  0: [CONTINUE] Unintern the conflicting symbols in the CM package.
  1:            Return NIL from load of "/home/dlphilp/clm/all.lisp".
  2: [ABORT   ] Return to Top-Level.

Debug  (type H for help)

(USE-PACKAGE :CLM #<The CM package, 2649/3150 internal, 0/2 external>)
Source: Error finding source: 
Error in function DEBUG::GET-FILE-TOP-LEVEL-FORM:  Source file no longer
exists:
  target:code/package.lisp.
0] 0
T
* 


  I'm not sure what to do then so I opt for 0. Now I do (in-package
:clm) and it seems okay, but when I try compiling
~/cm/etc/examples/fm.ins (written for AIFF output) here's what happens:

* (compile-file "/home/dlphilp/cm/etc/examples/fm.ins")

Python version 1.0, VM version Intel x86 on 06 OCT 02 11:37:05 am.
Compiling: /home/dlphilp/cm-2.3.4/etc/examples/fm.ins 06 OCT 02 11:36:37
am

; Writing "/home/dlphilp/cm-2.3.4/etc/examples/clm_lnxcmu_FM.c"
; Compiling "/home/dlphilp/cm-2.3.4/etc/examples/clm_lnxcmu_FM.c"
; Creating shared object file
"/home/dlphilp/cm-2.3.4/etc/examples/clm_lnxcmu_FM_1.so"
Converted |clm_lnxcmu_fm6|.
Compiling DEFINSTRUMENT FM: 
Converted |clm_lnxcmu_fm5|.
Compiling DEFINSTRUMENT FM: 
Converted FM.
Compiling DEFINSTRUMENT FM: 
Converted FM4.
Compiling DEFINSTRUMENT FM: 

File: /home/dlphilp/cm-2.3.4/etc/examples/fm.ins

In: DEFPROCESS RANDOM-FM
  (NEW FM TIME (NOW) AMPLITUDE ...)
Error: (during macroexpansion)

Error in function "DEFMACRO NEW":  FM is not a valid class name.

  (PROCESS REPEAT N OUTPUT (NEW FM TIME (NOW) AMPLITUDE ...) ...)
--> LET* FUNCTION BLOCK 
==>
  (OUTPUT (NEW FM TIME (NOW) AMPLITUDE ...))
Note: The first argument never returns a value.

Converted RANDOM-FM.
Compiling DEFPROCESS RANDOM-FM: 
Compiling Load Time Value of (PCL::GET-MAKE-INSTANCE-FUNCTION-SYMBOL
'(PROCESS # NIL)): 
Byte Compiling Top-Level Form: 

Compilation unit finished.
  1 error
  1 note

/home/dlphilp/cm/etc/examples/fm.x86f written.
Compilation finished in 0:00:01.
#p"/home/dlphilp/cm-2.3.4/etc/examples/fm.x86f"
T
T
* 


  Attempting to load the instrument now results in this error :

* (load "/home/dlphilp/cm/etc/examples/fm.cmucl")

; Loading #p"/home/dlphilp/cm-2.3.4/etc/examples/fm.cmucl".
;;; Running /usr/bin/ld...
;;; Done.
;; Loading #p"/home/dlphilp/cm-2.3.4/etc/examples/fm.x86f".

Error in function "DEFPROCESS RANDOM-FM":
   Execution of a form compiled with errors:
 (NEW FM
      TIME
      (NOW)
      AMPLITUDE
      0.15
      DURATION
      0.1
      FREQUENCY
      (BETWEEN 220 880)
      INDEX
      (INTERP (NOW) 0 0 10 10))

Restarts:
  0: [CONTINUE] Return NIL from load of
"/home/dlphilp/cm-2.3.4/etc/examples/fm".
  1:            Return NIL from load of
"/home/dlphilp/cm/etc/examples/fm.cmucl".
  2: [ABORT   ] Return to Top-Level.

Debug  (type H for help)

("DEFPROCESS RANDOM-FM")
Source: 
0] 

> i think there might be an example at the end of the fm.ins file (hope it still works.

See above... ;)

> i hope so. right now im finishing up integrating the new guile-influenced cm back into cltl. at that point 
> i should have a really nice new kernel and can start to  look at the guile-gtk interface to do a version 
> of plotter and more things as well. of course, a little help would help!

Much as I would love to chip in I'm completely overwhelmed with doing
the AGNULA docs (and learning a bunch of apps at the same time). Maybe
someday soon though...

Again my apologies if my questions are really obvious. I am going
through all the available documentation, but I'm not understanding
everything. TIA for any assistance you can render; meanwhile, I'm back
to the hack...

Best regards,

== Dave Phillips

	The Book Of Linux Music & Sound at http://www.nostarch.com/lms.htm
	The Linux Soundapps Site at http://linux-sound.org