desc
Common Music (CM) is an object-oriented music composition environment. It produces sound by transforming a high-level representation of musical structure into a variety of control protocols for sound synthesis and display. Common Music defines an extensive library of compositional tools and an API through which the composer can easily modify and extend the system.
http://commonmusic.sourceforge.net/doc/cm.html
also with clm - and sc
install
apt-get install cm or source under fm01lisp
run with:
cmucl (lisp) and then (load "path/cm.lisp")
or with emacs:
run as:
bin/cm.sh -l lisp.bin -e "emacs -nw" -F cmucl -V cmucl
(for some reason default sbcl doesn't work)
http://commonmusic.sourceforge.net/doc/emacs.html
source
Processes
A process is a function that runs, or executes, inside a scheduler to accomplish some musical task. Its always a good idea to define a process inside a function because then different variations of the process can be instantiated simply by calling the named function with different input values. Lets try it: |#
(defun sinus (len cycl low hi rhy dur amp) (process for i below len output (new midi :time (now) :keynum (rescale (sin (* 2 pi (/ i len) cycl)) -1 1 low hi) :amplitude amp :duration dur) wait rhy))
#|
Sinus is a function that creates a process. The process will play midi notes in a "sine wave" of cycl periods over len number of notes. sin's value (-1 to 1) is rescaled to lie between the specified low and hi keynums. Each time the process outputs a midi event it waits for a specified amount of time before running again. Any number of processes and seq can run inside the scheduler; its the scheduler job to make sure that all events happen at the correct time in the score. Lets see what happens when we call the sinus function to create processes:
make process then we need to schedule it with events:
(events (sinus 80 4 20 100 .1 .1 .6) "intro.mid" :versioning true)
[errors if not working with latest cvs]
from earlier research:
cm runs as scheduling - see also functions syscmd and cm-call
(defun cm-call (keyfn &rest args) (apply (find-symbol (string keyfn) :cm) args))
events:
scheduler.lisp
schedule-events
process:
objects.lisp:
(defmacro process (&body forms) (expand-process forms process-operators))
level1.lisp:
(defun expand-process (forms ops) (let ((parsed (parse-iteration 'process forms ops)) (code '()) (func nil) (tests '()) (done nil))
parse-iteration - parses whole?