cfml-prototype-raster
2009-11-11 21:52:39
This is a visual translation of my demo grammar for cfml. Compare the above image with this recording:
adamsmith.as/typ0/cfml-prototype.mp3 The lack of an "after" combinator for cfdg means I had to do a lot more mental math to come up with the right spatial offsets for the visual version.
~~~~~ CFML
(perform song 120 (pc:scale 0 'dorian))
(define (bump)
(literal 1/2 '((0 3 0 1 1/2))))
(define (lump)
(after bump
(tra 2 bump)
(tra 4 bump)
(tra 5 bump)))
(define (string-step)
(literal 2 '((0 4 0 1 2)(1 4 2 1 1))))
(define (string-end)
(literal 2 '((0 4 4 1 1)(1 4 -1 1 1))))
(define (song)
(choose (vol 2/3 string-end)
(tra +2 (after (during string-step
(after lump (tra -4 lump)))
song))))
~~~~~ CFDG
startshape song
rule bump {
CIRCLE {}
}
rule lump {
bump{x 0 y 0}
bump{x 1 y 2}
bump{x 2 y 5}
bump{x 3 y 4}
}
rule stringStep {
SQUARE{s 4 1 x 2 y 0}
SQUARE{s 2 1 x 3 y 2}
}
rule stringEnd {
SQUARE{s 4 1 x 2 y 4}
SQUARE{s 2 1 x 3 y -1}
}
rule song {
stringStep{z -1 b 0.5}
lump{}
lump{x 4 y -4}
song{x 8 y 2}
}
rule song 0.25 {
stringEnd{z -1 b 0.5}
}