(IN-PACKAGE :CCL) ;; this patch was saved with PWGL version 1.0 beta RC 19 (0.9.19-334) (ASSERT-PATCH-SAVED-VERSION-NOT-NEWER-THAN (QUOTE ((0 9 19) 334))) (LET ((WIN (MAKE-INSTANCE (QUOTE PWGL-PW-WINDOW) :R 1.0 :G 1.0 :B 1.0 :PWGL-SUBVIEWS (LIST (MAKE-INSTANCE (QUOTE PWGL-TEXT-BOX) :PWGL-SUBVIEWS (LIST (MAKE-INSTANCE (QUOTE PWGL-TEXT-SUBVIEW) :BOX-STRING "text" :APPLICATION-WINDOW (MAKE-INSTANCE (QUOTE PWGL-FRED-WINDOW) :TITLE "Text-Editor" :X 761 :Y 110 :WIDTH 631 :HEIGHT 859) :VALUE-STRING "(in-package :cm) (in-package :cm) ;; Patterns are working (setf pat1 (new cycle :keynums '(a4 b c5 d))) (next pat1) ;; call multiple times... (setf nested-pattern (new weighting :of (list (new cycle :keynums '(a4 b c5 d)) (new heap :keynums '(gs4 as cs5 ds))))) (next nested-pattern 20)")) :X 0.38399999999999946D0 :Y 0.9239999999999995D0 :W 0.3 :H 0.1 :BOX-STRING "text-box" :PWGL-OUTPUTS (LIST (MAKE-INSTANCE (QUOTE PWGL-OUTPUT))) :BOX-LAYOUT (MAKE-INSTANCE (QUOTE PWGL-BOX-LAYOUT) :GROUPING-LIST (LIST 1) :ORIG-GROUPING-LIST (LIST 1) :BORDER 0.012) :PW-FUNCTION (QUOTE TEXT-BOX) :FORMAT-ARGS (LIST :PRINT-ESCAPE T :COLUMNS 1)) (MAKE-INSTANCE (QUOTE PWGL-TEXT-BOX) :PWGL-SUBVIEWS (LIST (MAKE-INSTANCE (QUOTE PWGL-TEXT-SUBVIEW) :BOX-STRING "text" :APPLICATION-WINDOW (MAKE-INSTANCE (QUOTE PWGL-FRED-WINDOW) :TITLE "Text-Editor" :X 783 :Y 22 :WIDTH 631 :HEIGHT 859) :VALUE-STRING "(in-package :cm) (defun piano-phase (trope pulse amp stay move) (let* ((len (length trope)) (dur (- (* pulse 2) .01)) (stop (* len len (+ stay move)))) ;; stop is the number of notes to play. set to the ;; number notes in the trope times the number of times ;; the shifting happens to get back the first note ;; (also the length of the trope) times the number of ;; cycles of the trope perfomer 2 stays steady plus ;; the number of cycles the performer takes to move the ;; pattern ahead one sixteenth. ;; return two processes. the first keeps a regular beat ;; while the second plays the trope steadily for STAY ;; repetitions then moves one 16th ahead over MOVE ;; repetitions of the trope. (list (process with play = (new cycle :keynums trope) repeat stop output (new midi :time (now) :duration dur :keynum (next play) :amplitude amp) wait pulse) ;; phasing tempo is represented as a ratio P/N where P is ;; the time the phasing takes (counted in pulses) and N is ;; the number of notes to play in that time. so 16/16 means ;; play 16 notes in the time of 16 pulses and 15/16 means ;; to play 16 notes in the time of 15 pulses. for piano ;; phase N is the length of the trope and P is one less. (process with play = (new cycle keynums trope) and tempo = (new cycle of (list (new cycle :of 1 :for (* len stay)) (new cycle :of (/ (1- (* len move)) (* len move)) :for (* len move)))) repeat stop output (new midi :time (now) :duration dur :keynum (next play) :amplitude amp) wait (* pulse (next tempo)))))) (setf pnotes '(e4 fs b cs5 d fs4 e cs5 b4 fs d5 cs)) ;; TODO: set your own absolute path (events (piano-phase pnotes .15 .5 5 3) \"/Users/torsten/Desktop/tmp/sound/test.midi\") ")) :X 0.42399999999999994D0 :Y 0.4079999999999999D0 :W 0.3 :H 0.1 :BOX-STRING "text-box" :PWGL-OUTPUTS (LIST (MAKE-INSTANCE (QUOTE PWGL-OUTPUT))) :BOX-LAYOUT (MAKE-INSTANCE (QUOTE PWGL-BOX-LAYOUT) :GROUPING-LIST (LIST 1) :ORIG-GROUPING-LIST (LIST 1) :BORDER 0.012) :PW-FUNCTION (QUOTE TEXT-BOX) :FORMAT-ARGS (LIST :PRINT-ESCAPE T :COLUMNS 1)) (MAKE-INSTANCE (QUOTE PWGL-COMMENT-BOX) :PWGL-SUBVIEWS (LIST (MAKE-INSTANCE (QUOTE PWGL-COMMENT-BOX-SUBVIEW) :R 1.0 :G 1.0 :B 1.0 :BOX-STRING "auto-evaluate" :APPLICATION-WINDOW (MAKE-INSTANCE (QUOTE PWGL-FRED-WINDOW) :TITLE "Text-Editor" :X 223 :Y 192 :WIDTH 500 :HEIGHT 600) :VALUE-STRING "Great, Common Music 2 is largely working inside of PWGL. Seemingly macro define and possibly other Scheme stuff does not work, but patters are there. Replacing define with defun or setf works fine. Also, MIDI output does not work with short relative paths (in that case PWGL and CM MIDI paths are somehow confused). Just using absolute paths solved the problem. ")) :X 0.17600000000000016D0 :Y 1.972D0 :Z -0.1 :W 1.7480000014901163D0 :H 0.6120000014901161D0 :BOX-STRING "1" :PWGL-OUTPUTS (LIST (MAKE-INSTANCE (QUOTE PWGL-OUTPUT))) :BOX-LAYOUT (MAKE-INSTANCE (QUOTE PWGL-BOX-LAYOUT) :GROUPING-LIST (LIST 1) :ORIG-GROUPING-LIST (LIST 1) :X-PROPORTIONS (LIST (LIST 1)) :BORDER 0.0084) :PW-FUNCTION (QUOTE PWGL-COMMENT-BOX) :OPEN-STATE-W 1.7480000014901163D0 :OPEN-STATE-H 0.6120000014901161D0 :FORMAT-ARGS (LIST :PRINT-ESCAPE T :COLUMNS 1)) (MAKE-INSTANCE (QUOTE PWGL-COMMENT-BOX) :PWGL-SUBVIEWS (LIST (MAKE-INSTANCE (QUOTE PWGL-COMMENT-BOX-SUBVIEW) :R 1.0 :G 1.0 :B 1.0 :BOX-STRING "auto-evaluate" :APPLICATION-WINDOW (MAKE-INSTANCE (QUOTE PWGL-FRED-WINDOW) :TITLE "Text-Editor" :X 100 :Y 100 :WIDTH 500 :HEIGHT 600) :VALUE-STRING "CM patterns are working")) :X 0.3879999999999999D0 :Y 1.1600000000000002D0 :Z -0.1 :W 1.020000001490116D0 :H 0.12800000149011615D0 :BOX-STRING "1" :PWGL-OUTPUTS (LIST (MAKE-INSTANCE (QUOTE PWGL-OUTPUT))) :BOX-LAYOUT (MAKE-INSTANCE (QUOTE PWGL-BOX-LAYOUT) :GROUPING-LIST (LIST 1) :ORIG-GROUPING-LIST (LIST 1) :BORDER 0.0084) :PW-FUNCTION (QUOTE PWGL-COMMENT-BOX) :OPEN-STATE-W 1.020000001490116D0 :OPEN-STATE-H 0.12800000149011615D0 :FORMAT-ARGS (LIST :PRINT-ESCAPE T :COLUMNS 1)) (MAKE-INSTANCE (QUOTE PWGL-COMMENT-BOX) :PWGL-SUBVIEWS (LIST (MAKE-INSTANCE (QUOTE PWGL-COMMENT-BOX-SUBVIEW) :R 1.0 :G 1.0 :B 1.0 :BOX-STRING "auto-evaluate" :APPLICATION-WINDOW (MAKE-INSTANCE (QUOTE PWGL-FRED-WINDOW) :TITLE "Text-Editor" :X 310 :Y 190 :WIDTH 500 :HEIGHT 600) :VALUE-STRING "Piano phase example working, including MIDI output.")) :X 0.43599999999999995D0 :Y 0.6240000000000001D0 :W 1.3440000014901164D0 :H 0.11200000149011613D0 :BOX-STRING "1" :PWGL-OUTPUTS (LIST (MAKE-INSTANCE (QUOTE PWGL-OUTPUT))) :BOX-LAYOUT (MAKE-INSTANCE (QUOTE PWGL-BOX-LAYOUT) :GROUPING-LIST (LIST 1) :ORIG-GROUPING-LIST (LIST 1) :BORDER 0.0084) :PW-FUNCTION (QUOTE PWGL-COMMENT-BOX) :OPEN-STATE-W 1.3440000014901164D0 :OPEN-STATE-H 0.11200000149011613D0 :FORMAT-ARGS (LIST :PRINT-ESCAPE T :COLUMNS 1))) :X 5 :Y 5 :SCALEFX 0.5 :SCALEFY 0.5 :HITS 2 :X 5 :Y 22 :WIDTH 730 :HEIGHT 530))) (WINDOW-SELECT WIN) WIN)