Curling Animation II
I made another animation with Context Free Art and a small ruby script. The scroll down to see the sourcecode I have used for this file. This animation uses the same technique i used for my first one
Curling Recursion 2 from Nikolaus Gradwohl on Vimeo.
test.cfdg contains the following code
startshape FOO
rule FOO {
FOO1 {}
FOO2 {}
}
rule FOO1 {
CIRCLE { size 0.5 }
FOO1 { x 1 y 1 size 0.95 rotate @@rotate@@ }
FOO1 { x 1 y 1 size 0.5 }
}
rule FOO2 {
CIRCLE { size 0.5 }
FOO2 { x 1 y 1 size 0.95 rotate -@@rotate@@ }
FOO2 { x 1 y 1 size 0.5 }
}
looper.rb looks like this
f = open('test.cfdg')
template = f.read()
( 1..500 ).each{ |i|
cfdg = "#{template}"
cfdg[ '@@rotate@@' ]= "#{10 * i / 500.0}"
tmp = open("tmp.cfdg", 'w' )
tmp.write(cfdg)
tmp.close()
fn = 'out/test%03d.png' % i
puts fn
system("../ContextFree/cfdg tmp.cfdg #{fn} -v AAAAAA")
}
the single frames can be combined to a video using this mencoder command
mencoder "mf://*.png" -mf fps=12 -o output.avi -ovc lavc
See also:
Curling Recursion
Ronin experiment 5 - osc
Sonic Pi beatslicing livecoding session
creating midifiles using ruby
Calculating Euclidean Rhythmns using the Bresenham Algorithm
Ronin experiment 5 - osc
Sonic Pi beatslicing livecoding session
creating midifiles using ruby
Calculating Euclidean Rhythmns using the Bresenham Algorithm