[CM] newbie: rhythm confusion

Orm Finnendahl finnendahl@folkwang-hochschule.de
Fri, 28 Jun 2002 20:11:26 +0200


Hi all,

sorry, I forgot to cc the list...

Hi Carl,

It's not necessary to create a new midi event each repetition of the
loop. It is sufficient to define one instance outside of the loop and
then use sv to fill the slots.

Here's an example (also defining all the patterns outside the loop):

(defprocess my-first ()
  (let (
        (curr-midi-note (new midi))
        (r (new rotation of '(q e. h s)))
        (k (new random of '((60 weight .2143)
                            (62 weight .0714)
                            (64 weight .1429)
                            (65 weight .0714)
                            (67 weight .2143)
                            (69 weight .1429)
                            (70 weight .1429))))
        )
  (process repeat 96
           do
           (sv curr-midi-note
               time (now)
               keynum (next k)
               amplitude .5
               duration (setf ba (rhythm (next r)))
               )
           (output curr-midi-note) 
           (wait ba))))

(events (my-first) "test.midi")

--
Orm




Am Freitag, den 28. Juni 2002 um 00:47:30 Uhr (-0400) schrieb Carl Edwards:
> Thanks a million Linda.
> 
> I'm glad I wrote. That would have taken me a week to figure out. I owe you a
> slice (at least)! =)
> 
> Carl Edwards
> 
> > Here's my take on your code:
> >
> > (defprocess my-first ()
> >   (let (
> >       (r (new rotation of '(q e. h s)))
> >       )
> >   (process repeat 96
> >            for k =(new random of '((60 weight .2143)
> >                          (62 weight .0714)
> >                          (64 weight .1429)
> >                          (65 weight .0714)
> >                          (67 weight .2143)
> >                          (69 weight .1429)
> >                          (70 weight .1429)))
> >
> >            for x = (now)
> >            for ba = (rhythm (next r)) do
> >            (output (new midi time x
> >                         keynum (next k)
> >                         duration ba
> >                         amplitude .5))
> >            (wait ba))))
w> >
> >
> > 1--The reason all your rhythms were the same is that the pattern
> > containing them was being started from the beginning every time you looped
> > back to the top of the process. Declaring the rhythm item stream in a (let
> > fixes this.
> >
> > 2--you'll need a DO before the output
> >
> > 3--add a paren around 'output' that closes after the amplitude is set.
> >
> > 4--the 'wait' comes at the very end of the process and also deserves a set
> > of parens.
> >
> > cheers,
> > la
> 
> 
> _______________________________________________
> Cmdist mailing list
> Cmdist@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist