[CM] CM - event scheduling feature request[?]

Bill Sack bsack23@gmail.com
Tue, 24 Apr 2007 16:07:46 -0400


------=_Part_206406_13649120.1177445266529
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hi,
ever since i learned that multiple processes can be run in parallel within a
defined cm function, i.e.
(define bla...
  (list
    (process bla ..
    (process bla ..
   )
i've been using such definitions happily and frequently.

i just discovered something, however, which may be a downside to doing
things this way (or maybe just a misunderstanding on my part): when i try to
schedule such a defined list of processes within a list i.e.:(events (list
(etc... , lisp throws an error (or at least sbcl does).

;;examples (freely adapted from cm docs):
(defun test (len knum rhy)
  (list
   (process repeat len
        output (new midi :time (now) :channel 0
            :keynum (between knum (+ knum 12))
            :duration dur)
        wait rhy)
   (process repeat len
        output (new midi :time (now) :channel 1
            :keynum (between (- knum 12) knum)
            :duration dur)
        wait rhy)))

(events (list (test 30 80 .1)
              (test 20 60 .1)
              (test 10 40 .1))
        "/tmp/test.mid"
        '(0 1 2))
;;error:
invalid number of arguments: 4
   [Condition of type SB-INT:SIMPLE-PROGRAM-ERROR]

Restarts:
 0: [ABORT] Return to SLIME's top level.
 1: [ABORT] Exit debugger, returning to top level.

Backtrace:
  0: ((LAMBDA (SB-PCL::.ARG0. SB-PCL::.ARG1. #1="#<...>" . #1#))
      #<CLOSURE (LAMBDA #) {CF22CFD}>
      0
      0)
  1: ((SB-PCL::FAST-METHOD SCHEDULE-OBJECT (CONS T T))
      #<unavailable argument>
      #<unavailable argument>
      (#<CLOSURE # {CF22CFD}> #<CLOSURE # {CF22D25}>)
      0
      :EVENTS)

am i infact doing something wrong here, and if not, is it possible in some
future cm version to make scheduling of these kind of processes possible?

thanks,
bill sack

------=_Part_206406_13649120.1177445266529
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

hi,<br>ever since i learned that multiple processes can be run in parallel within a defined cm function, i.e.<br>(define bla...<br>&nbsp; (list<br>&nbsp;&nbsp;&nbsp; (process bla ..<br>&nbsp;&nbsp;&nbsp; (process bla ..<br>&nbsp;&nbsp; )<br>i&#39;ve been using such definitions happily and frequently.
<br><br>i just discovered something, however, which may be a downside to doing things this way (or maybe just a misunderstanding on my part): when i try to schedule such a defined list of processes within a list i.e.:(events (list (etc... , lisp throws an error (or at least sbcl does).
<br><br>;;examples (freely adapted from cm docs):<br>(defun test (len knum rhy)<br>&nbsp; (list<br>&nbsp;&nbsp; (process repeat len<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; output (new midi :time (now) :channel 0 <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :keynum (between knum (+ knum 12))<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :duration dur)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; wait rhy)<br>&nbsp;&nbsp; (process repeat len<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; output (new midi :time (now) :channel 1<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :keynum (between (- knum 12) knum)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; :duration dur)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; wait rhy)))
<br><br>(events (list (test 30 80 .1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (test 20 60 .1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (test 10 40 .1))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;/tmp/test.mid&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#39;(0 1 2))<br>;;error:<br>invalid number of arguments: 4<br>&nbsp;&nbsp; [Condition of type SB-INT:SIMPLE-PROGRAM-ERROR]
<br><br>Restarts:<br>&nbsp;0: [ABORT] Return to SLIME&#39;s top level.<br>&nbsp;1: [ABORT] Exit debugger, returning to top level.<br><br>Backtrace:<br>&nbsp; 0: ((LAMBDA (SB-PCL::.ARG0. SB-PCL::.ARG1. #1=&quot;#&lt;...&gt;&quot; . #1#))
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&lt;CLOSURE (LAMBDA #) {CF22CFD}&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0)<br>&nbsp; 1: ((SB-PCL::FAST-METHOD SCHEDULE-OBJECT (CONS T T))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&lt;unavailable argument&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&lt;unavailable argument&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (#&lt;CLOSURE # {CF22CFD}&gt; #&lt;CLOSURE # {CF22D25}&gt;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :EVENTS)<br><br>am i infact doing something wrong here, and if not, is it possible in some future cm version to make scheduling of these kind of processes possible?<br><br>thanks,<br>bill sack<br><br>

------=_Part_206406_13649120.1177445266529--