 
 state =
   activeLine: 0
+  moveNext: 0
 
 updateViz = ->
   viz.draw(canvas)

  switch
    when keyCode is 8
      state.toSet = 255
    when keyCode is 38
      state.activeLine -= 1
    when keyCode is 40
      state.activeLine += 1
    when 48 <= keyCode <= 57
      state.toSet = keyCode - 48 + 4 * 12
, false

document.addEventListener "mousedown", (e) ->

  
  switch type
    when 144 # Note on
      state.toSet = note
      state.moveNext = 2
    when 128 # Note off
      ;

