[CM] introducing SAL
Rick Taube
taube at uiuc.edu
Thu Jul 6 09:49:18 PDT 2006
Introducing SAL, an alternate syntax for working with CM and Lisp. Sal
provides commands, statements and infix sexprs. SAL has its own
lexer/parser and combines features of lisp, dylan, pla and stella. Sal
comes with its own Emacs mode (sal.el) that provides syntax
highlighting and eval services via SLIME.
http://pinhead.music.uiuc.edu/~hkt/sal.tgz
this is what sal code looks like (much prettier with syntax
highlighting!)
; i am a comment. the print command:
print list(1, 2 + 3, 4)
print "the value is: ", interpl( between(0.0,1.0), {0 0 50 1 100 0})
; the define command:
define variable hi = pi * random(2),
ho = list(hi,2,3)
define function foo(n)
loop with l = list()
repeat n
set l &= random(127)
finally return l
end
define process bar(n, r, lb, ub)
run repeat n
for k = between(lb,ub)
output make(<midi>, time: now(), keynum: k)
wait random(r)
end
; open and sprout commands
open "test.mid", versioning: #t
sprout bar(20,.1, 60, 90)
sprout list(bar(30, .1, 60,70), bar(20,.2,30,50)) at {0 1}
load "rts.sys", "midishare.sys"
open "midi-port.ms"
rts 1
sprout bar(20, .1, 60, 80)
;---
SAL is brand new so it may change a bit -- I would be greatful for
feedback and suggestions.
to try it out:
install the tarball where you put other cm systems
add (load "/path/to/sal/sal.el") to your .emacs file
start cm under slime and do (use-system :sal)
edit examples.sal, follow directions at top
More information about the Cmdist
mailing list