[CM] tutorial question (newbie)

Anders Vinjar anders.vinjar@notam02.no
04 Jun 2002 09:22:17 +0200

    CE> In the Loop tutorial Mr. Kunze uses a function called "thread". As in:

    CE>  (thread feigenbaum ()
    CE>   (loop repeat 100
    CE>         for x = .618 then (* x 3.9213 (- 1.0 x))
    CE>         do (object midi-note
    CE>                    note (note (+ (* x 1000) 100))
    CE>                    rhythm .1 duration .1 amplitude .5)))

    CE> I haven't been able to find that object, function, macro or (?) in the CM
    CE> docs and I was wondering if it reflects an earlier organization. Is "thread"
    CE> a type of container? And (if it is from an earlier version) what's an
    CE> appropriate replacement for this type of case?

You're right, CM had a major reorganisation some time ago.  Heres
something similar translated to the new CM:

  (defprocess feigenbaum ()
    (process repeat 100
             for x = .618 then (* x 3.9213 (- 1.0 x))
             (output (new  midi time (now)
                       keynum (+ (* x 1000) 100)
                       duration .1 amplitude .5))
             (wait .1)))

And to cache the output in a midi-file:

  (events #!feigenbaum "/tmp/feig.midi")