--- Springs
-- a spring physics based voltage follower
-- input 1+2: voltages that outs 1/2 and 2/4 will follow.
-- output 1/2 will follow input 1
-- output 3/4 will follow input 2 (the first pair is more volatile)
-- For best results don't attentuate the input but the outputs. Bigger or faster changes put more energy into the system and create more pronounced effects. Try using a quantizer to drive two related melodies.
-- settings
scale = false -- outputs are continous (not quantized). Try {0,2,3,5,7,9,10} instead.
rate = 0.05 -- sets the refresh rate for the springs' state calculation. This has a drastic effect and is callibrate to the default set of variables for the springs.
function init()
-- initialize the 4 springs with dedicated settings for gravity, spring constant, mass, and dampening
springA = Spring:new(0,0.5,2,0.92)
springB = Spring:new(0,0.01,5,0.97)
springC = Spring:new(0,0.7,1,0.90)
springD = Spring:new(0,0.03,5,0.92)
This file has been truncated. show original