[CM] "notes from metalevel" (Cap. 12) - Mixing objects - ERROR

padovani josepadovani@yahoo.com.br
Thu, 28 Jun 2007 22:34:21 -0300


So, now I'm trying to evaluate the Mixing objects code:

(define (strums key1 key2 rate dur amp)
 (let ((step (if (< key2 key1) -1 1))
       (diff (abs (- key1 key2))))
   (loop repeat (+ diff 1)
         for key from key1 by step
         for beg from 0 by rate
         collect (new midi :time beg
                      :duration dur
                      :amplitude amp
                      :keynum key))))

but, in SBCL, the "-1" in the second line gives an error in SBCL:

;;;; (pwd)  ...
;;;; (define (strums key1 key2 rate dur amp)   (let ((step (if (< ...
; in: LAMBDA NIL
;     (IF (< CM::KEY2 CM::KEY1) -1 1)
; ==>
;   -1
;
; caught WARNING:
;   This is not a (OR (SINGLE-FLOAT (0.0)) (DOUBLE-FLOAT (0.0d0)) 
(RATIONAL (0))):
;     -1
;   See also:
;     The SBCL Manual, Node "Handling of Types"
;
; compilation unit finished
;   caught 1 WARNING condition



andersvi@extern.uio.no escreveu:
> '/bin/csh' is the default shell invoked by the #'shell-command.  I
> think you can safely change it to '/bin/bash' - either in your
> ~/.cminit.lisp file or down in src/sbcl.lisp:
>
>  (defun shell (cmd &key (wait t) (output t))
>    (sb-ext:run-program "/bin/bash" (list "-c" cmd)
>                        :output output :wait wait))
>
>
> Rick, Fernando, Kjetil - isn't /bin/bash a safer shell to put in there
> nowadays?
>
> -anders                     
>  
>>>>>> "p" == padovani  <josepadovani@yahoo.com.br> writes:
>>>>>>             
>
>     p> Hi, I'm learning CM... I've installed CM on an Ubuntu-Studio
>     p> (Feisty) system. I'm running it with Xemacs, SLIME and
>     p> SBCL... I had successfully evaluated that line:
>
>     p> in the section "Interaction 2: Generating a MIDI event to a
>     p> MIDI file." (pg.105-107 of the book) I had successfully
>     p> evaluated this line:
>
>     p>    (define one (new midi :time 0 :keynum 60 :duration 2))
>
>     p> But when I try to send the events to a mid file with
>
>     p>    (events one "myscore.mid")
>
>     p> I get this error:
>
>     p>    no such program: "/bin/csh" [Condition of type SIMPLE-ERROR]
>
>     p> Well... it seems it is configures to use csh. Could I configure
>     p> it to use bash? Where and how?
>
>
>