[CM] Example error in common music dictionary
Alexandre Ficagna
alrefi at ibest.com.br
Fri Apr 10 12:58:41 PDT 2009
Sorry, I forgot the example:
(define (play-pats pats trope reps rate)
(process <file:///usr/local/lisp/cm/doc/dict/process-mac.html> with
dur = (* rate 2.5)
repeat reps
for len = (pick
<file:///usr/local/lisp/cm/doc/dict/pick-fn.html> 8 12 16)
for pat = (make-instance (next
<file:///usr/local/lisp/cm/doc/dict/next-fn.html> pats)
:keynums trope
:for len)
each k in (next
<file:///usr/local/lisp/cm/doc/dict/next-fn.html> pat #t) as x from 0
by rate
output (new
<file:///usr/local/lisp/cm/doc/dict/new-mac.html> midi
<file:///usr/local/lisp/cm/doc/dict/midi-cls.html> :time (+ (now
<file:///usr/local/lisp/cm/doc/dict/now-fn.html>) x)
:keynum k
:duration dur)
wait (* rate len)))
;;; a pattern of pattern class names
(define pcns
(new <file:///usr/local/lisp/cm/doc/dict/new-mac.html> weighting
<file:///usr/local/lisp/cm/doc/dict/weighting-cls.html> :of '((heap
:weight 2) line cycle
palindrome rotation))
(events <file:///usr/local/lisp/cm/doc/dict/events-fn.html> (play-pats
pcns '(a4 b c5 d) 12 .1) "test.mid")
=> "test.mid"
The error messages listed before occurs when evaluating "play-pats".
2009/4/8 Alexandre Ficagna <alrefi at ibest.com.br>
> Here they are:
>
> /\\\
> ---\\\---------
> ----\\\--------
> ----/\\\------- Common Music 2.11.3
> ---/--\\\------
> --/----\\\-----
> / \\\/
>
>
> OK
> OK; in: LAMBDA NIL
> ; (CM:PROCESS CM::WITH CM::DUR = (* CM::RATE 2.5) CM::REPEAT CM::REPS
> CM::FOR
> ; CM::LEN = (CM:PICK 8 12 16) CM::FOR ...)
>
> ;
> ; caught ERROR:
> ; (in macroexpansion of (PROCESS WITH DUR ...))
> ; (hint: For more precise location, try *BREAK-ON-SIGNALS*.)
> ; illegal loop syntax
>
> ; (SB-INT:NAMED-LAMBDA CM::PLAY-PATS (CM::PATS CM::TROPE CM::REPS
> CM::RATE)
> ; (BLOCK CM::PLAY-PATS
> ; (CM:PROCESS CM::WITH CM::DUR = (* CM::RATE 2.5)
> ; CM::REPEAT CM::REPS CM::FOR CM::LEN
> =
> ; (CM:PICK 8 12 16) CM::FOR ...)))
>
> ; ==>
> ; #'(SB-INT:NAMED-LAMBDA CM::PLAY-PATS (CM::PATS CM::TROPE CM::REPS
> CM::RATE)
> ; (BLOCK CM::PLAY-PATS
> ; (CM:PROCESS CM::WITH CM::DUR = (* CM::RATE
> 2.5)
> ; CM::REPEAT CM::REPS CM::FOR
> CM::LEN =
> ; (CM:PICK 8 12 16) CM::FOR ...)))
> ;
> ; caught STYLE-WARNING:
> ; The variable PATS is defined but never used.
>
> ;
> ; caught STYLE-WARNING:
> ; The variable TROPE is defined but never used.
>
> ;
> ; caught STYLE-WARNING:
> ; The variable REPS is defined but never used.
>
> ;
> ; caught STYLE-WARNING:
> ; The variable RATE is defined but never used.
> ;
> ; compilation unit finished
> ; caught 1 ERROR condition
> ; caught 4 STYLE-WARNING conditions
>
> LOOP ERROR: 'each' does not support initializations.
> clause context: 'EACH K IN (NEXT PAT T)'
>
> STYLE-WARNING: redefining PLAY-PATS in DEFUN
>
> OK
>
> 2009/4/8 Heinrich Taube <taube at uiuc.edu>
>
> can you please send me the full code example? also tell me what version of
>> cm you are using.
>>
>>
>> On Apr 7, 2009, at 5:48 PM, Alexandre Ficagna wrote:
>>
>> Hy,
>>>
>>> I was studying Patterns topic in CM2 and got errors trying to do Example
>>> 3 (Creating patterns programatically).
>>> Part of the error message says:
>>>
>>> LOOP ERROR: 'each' does not support initializations.
>>> clause context: 'EACH K IN (NEXT PAT T)'
>>>
>>> I tried many things (actually I'm a beginner, so it complicates a lot),
>>> and it did work when I substituted line:
>>> each k in (next pat #t) as x from 0 by rate
>>>
>>> by these two lines:
>>> for x from 0 by rate
>>> each k in (next pat #t)
>>> the console gave me no error messages, by I think the sound result was
>>> not the expected (it should vary each evaluation, but keeps the same).
>>>
>>> How can I correct this?
>>>
>>> Thanks.
>>> Alexandre Ficagna
>>> --
>>> www.myspace.com/alexandreficagna
>>> _______________________________________________
>>> Cmdist mailing list
>>> Cmdist at ccrma.stanford.edu
>>> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
>>>
>>
>>
>
>
> --
> www.myspace.com/alexandreficagna
>
--
www.myspace.com/alexandreficagna
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20090410/dec58b9b/attachment.html>
More information about the Cmdist
mailing list