Scripting assistance?

Here is a better script:

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   MIN : MidiInBlock
   LANE1 : Widget
   LANE2 : Widget
   LANE3 : Widget
   LANE4 : Widget
   PLAY : Widget
   lane_playing : integer
   
   LANE : Widget Array
//$</AutoDeclare>


initialization
 lane_playing = 0
 LANE = [ LANE1, LANE2, LANE3, LANE4 ]
end 

on NoteOnEvent (m : NoteMessage) matching C1 from MIN
 SetWidgetValue(LANE[lane_playing],1.0)
 lane_playing = lane_playing + 1
 
 SetWidgetValue(PLAY, 1.0)
 
 if lane_playing == 4 then
  lane_playing = 0;
 end
 
end

on Activate
 lane_playing = 0
 SetWidgetValue(PLAY, 0.0)
end
1 Like