[CM] CM/CMN question

Dave Phillips dlphilp@bright.net
Wed, 23 Apr 2003 13:01:42 -0400


This is a multi-part message in MIME format.
--------------FFD811051F7EB8AA6E7C5D5D
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Greetings:

  Given the attached CM code, what would I need to do to have the CMN
output display automagically with xcmnw ? I can utilize a shell command
to call GhostView but I'm trying to do things totally within the
CM/CMN/CLM/Snd orbit (from emacs now, no less!). I'm not sure where to
place the (output-type :x) call and/or if anything else needs done first
elsewhere.

Best regards,

== Dave Phillips

	The Book Of Linux Music & Sound at http://www.nostarch.com/lms.htm
	The Linux Soundapps Site at http://linux-sound.org
--------------FFD811051F7EB8AA6E7C5D5D
Content-Type: text/plain; charset=us-ascii;
 name="cmn-test.cm"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="cmn-test.cm"



(in-package :cm)

(define (testit stf len nts)
  (let ((nts (new heap :notes nts))
        (rhy (new random
               :of (list 1 1 (new cycle :of '(1/2 1/2)) (new cycle :of '(1/4 1/4)) (new cycle :of '(1/8 1/8)) ))))
    (process while (< (now) len)
             for n = (next nts)
             for r = (next rhy)
             output (new midi :time (now)
                         :duration r
                         :keynum n
                         :channel stf)
             wait r)))

(define (isomel stf len nts)
  (let ((nts (new cycle :notes nts))
        (rhy (new cycle
               :of (list 1 1/2 1/4 1/4 1/4 1/2 1) )))
    (process while (< (now) len)
             for n = (next nts)
             for r = (next rhy)
             output (new midi :time (now)
                         :duration r
                         :keynum n
                         :channel stf)
             wait r)))

(define (chordy stf)
  (let ((pat (new cycle :of (list
			     (new chord 
			       :of (new heap 
				     :of '(d3 e g f bf d4 e)
				     :for 3))
			     (new random 
			       :of '(bf3 (e2 weight .5 max 2) a2)
			       :for 1)))))
    (process repeat 64
             do (doeach (k (next pat))
                  (output (new midi :keynum k :time (now) :channel stf)))
             wait .5)))


(define staffs
  '((0 :name "Instr 3" :clef :bass :meter (4 4))
    (1 :name "Instr 2" :clef :alto :meter (4 4))
    (2 :name "Instr 1" :clef :treble :meter (4 4))))

(events (list (chordy 0)
              (isomel 1 32 '(bf3 d4 c e g a))
              (testit 2 32 '(bf4 c5 d f g a)))
	(new seq :name 'two-ways))
(events #!two-ways "cmn-test.cmn" :staffing staffs :size 20 :title "Trio" :exact-rhythms t)
(events #!two-ways "cmn-test.mid")

(shell "timidity -Ow -c /home/dlphilp/timidity-sf2.cfg cmn-test.mid")
;;; (shell "timidity -Ow cmn-test.mid -o cmn-test.wav")
;;; (shell "gv -watch hi.eps hi-1.eps")
;;; (shell "snd cmn-test.wav")
;;; (start-snd)

--------------FFD811051F7EB8AA6E7C5D5D--