Cool Stephane - I'm going to use this as a starting point to learning CM 2.0 - something I've been putting off for a LONG time :)

Steven:  Maybe a file with each example in a separate external object would be best?  I know I've shown at least two other CM 1.x users my way of doing this (besides you two ;)


On 10/3/05, stephane boussuge <> wrote:
hi Steven and Ben
thanks to Ben for his help.
i use cm 2.x.x and i have made a very simple example
of score generation with cm 2 based on the file intro
in cm 2 and the code from Ben.
i join it if it can be useful for somebody...
(sorry, i'm a very newbie in cm and my code are very
bad :(


Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
TÚlÚchargez cette version sur

<blueData version='0.99.8'>
    <commandLine>csound -odac1</commandLine>
    <diskCommandLine>csound </diskCommandLine>
    <notes> -W -o D:\Nuendo\Urban\mel1.wav

consound -W -oD:\Nuendo\Urban\bass_1_ctof.wav</notes>
f 1 0 16384 10 1

f 2 0 256 7 0 128 1 0 -1 128 0
f 3 0 256 7 1 128 1 0 -1 128 -1
    <globalOrc>ga1 init 0
ga2 init 0
    <commandLine>csound -Wdo devaudio -L stdin</commandLine>
  <soundObject type='blue.soundObject.PolyObject'>
    <soundLayer name='' muted='false' solo='false'>
      <soundObject type='blue.soundObject.External'>
        <text>(load &quot;/home/stf/bin/cm-2.6.0 /src/cm.lisp&quot;)
(in-package :cm)

(defparameter *buflen* 4096); used to store file in print-stream function

(defobject simp ()
           ((ins :initform &apos;simp :accessor object-name)
            (beg :accessor object-time)
            (dur :initform 1)
            (amp :initform .5)
            (freq :initform 440))
  (:parameters beg dur amp freq))

;; Now define a simple process that output simps...

(define (simp-1 num)
  (process repeat num
           output (new simp
                    :beg (now) :dur 1 :amp .5
                    :freq (between 220 440))
           wait (pick 0 1 2)))

;; Next we define a variant process that outputs simps
;; with names picked randomly from a list.

(define (simp-2 num names)
  (process repeat num
           output (new simp :beg (now)
                       :ins (and names (pickl names))
                       :dur 1 :amp .5
                       :freq (between 220 440))
           wait (pick 0 1 2)))

(events (simp-2 20 &apos;(&quot;i1&quot; &quot;i2&quot; &quot;i3&quot;))  ; write to i1 i2 or i3

(defun print-stream (filename)
        (let ((buffer (make-array *buflen*)))
        (with-open-file (f filename :direction :input
                      :if-does-not-exist :error
        (do ((j 0))((= j (file-length f)))
        (setf myline (read-line f t &quot;eofeof&quot;))
        (if (string-equal myline &quot;eofeof&quot;)(return))
        (princ myline)
        (write-char #\Newline)
        (setf j (+ j ))

(print-stream  &quot;test.sco&quot;)</text>
        <commandLine>clisp </commandLine>