to explain what G.CLR does exactly i need to explain how grid rendering works first.
there are 2 layers - one for controls (buttons, faders etc) and one for explicitly set LEDs. the control layer gets rendered first, and then anything set with G.LED, G.REC or G.RCT will be rendered on top of that. if you didn’t set any individual LEDs (or set them to level of -3) they are essentially “transparent”.
since you only have limited power over how grid controls are displayed (say, pressed buttons are always displayed with maximum brightness level of 15), this gives you the ability to fine tune the UI by drawing on top of other controls. say, you could hide a button by drawing a rectangle over it.
this wouldn’t be very useful by itself but it becomes more so if you use the 2 special brightness levels: -1 dims anything underneath, and -2 brightens it. the simple sequencer puts it to good use by using it to highlight the current step. so in this line:
G.CLR; G.REC A 0 1 8 -3 -2
G.CLR will clear all the previously set LEDs (please note this does not clear controls, just LEDs that were set with G.LED/G.REC/G.RCT). since we don’t set any other LEDs, just the current step, when we advance we can simply clear all and redraw (otherwise we’d have to clear the previous step with G.REC, which would be cumbersome and take more script space). and then we draw a rectangle over the current step with width of 1 and height of 8, fill is not used here (so just set to -3) and the border is set to brighten (-2).