 
 prevTime = null
 stepsLeft = 0
-stepsPerMs = 10 / 1000
+stepsPerMs = 5 / 1000
 
 animate = ->
   requestAnimationFrame animate

        i2 = i*2
        line.flow state[i2], state[i2+1]
    return
      
curves = undefined    
          
init = ->

  time = Date.now()
  if prevTime isnt null
    dt = time-prevTime
    #steps = stepsLeft + stepsPerMs * dt
    #iSteps = Math.round steps
    #stepsLeft = steps - iSteps
    #curves.step Math.min 100, iSteps #for old line-based code
    curves.step stepsPerMs * dt
    
    #to make movement smoother, shift lines by the remaining noninteger fraction.
    #curves.offsetZ stepsLeft
  prevTime = time
  return
  
