The controller is a Chromatron wifi pixel controller. It will be released on Kickstarter in the coming weeks, more info here: chromatron.io
Chromatron uses a scripting language based on Python (called FX Script) to create the graphics pattern.
The FX virtual machine supports running a startup, main, and shutdown effects programs. The linked YouTube video above shows all three.
Here's the startup program:
# define pixel arrays
staff1 = PixelArray(0, 27, reverse=True)
staff1_2 = PixelArray(27, 28)
staff2 = PixelArray(67, 27, reverse=True)
staff2_2 = PixelArray(94, 28)
end1 = PixelArray(55, 12)
end2 = PixelArray(122, 12)
status = PixelArray(134, 1)
def init():
# initialize all pixels to default
pixels.sat = 1.0
pixels.hue = 0.0
pixels.val = 0.0
# setup up the status LED.
# not doing anything fancy with this just yet.
status.val = 0.5
status.hue = 0.0
def loop():
cursor = Number()
staff1[cursor].val = 0.6
staff1_2[cursor].val = 0.6
staff2[cursor].val = 0.6
staff2_2[cursor].val = 0.6
cursor += 1
if cursor == 28:
end1.val = 1.0
end2.val = 1.0
if cursor > 50:
# signal to VM that this effect is finished
halt()
And the main effect:
# define pixel arrays
staff1 = PixelArray(0, 55, reverse=True)
end1 = PixelArray(55, 12)
staff2 = PixelArray(67, 55)
end2 = PixelArray(122, 12)
status = PixelArray(134, 1)
def init():
pixels.val = 0.0
end1.val = 1.0
end2.val = 1.0
status.val = 0.5
status.hue = 0.667
def loop():
frame = Number()
cursor = Number()
current_hue = Number()
current_hue += 0.005
# update graphics along staff body
staff1.val -= 0.03
staff2.val -= 0.03
staff1[cursor].val = 1.0
staff1[cursor].hue = current_hue
staff2[cursor].val = 1.0
staff2[cursor].hue = current_hue
# update end pieces
end1.hue += 0.0005
end2.hue += 0.0005
if frame % 6 == 0:
end1[rand()].sat = 0.0
end2[rand()].sat = 0.0
end1.sat += 0.1
end2.sat += 0.1
cursor += 1
if cursor >= staff1.count:
cursor = 0
frame += 1
And the shutdown effect:
# define pixel arrays
staff1 = PixelArray(0, 27, reverse=True)
staff1_2 = PixelArray(27, 28)
staff2 = PixelArray(67, 27, reverse=True)
staff2_2 = PixelArray(94, 28)
end1 = PixelArray(55, 12)
end2 = PixelArray(122, 12)
status = PixelArray(134, 1)
def init():
pixels.val = 0.3
pixels.sat = 0.0
status.val = 0.3
def loop():
cursor = Number()
# fade out along staff body, starting from center and working towards
# the ends.
# the pixel arrays make this trivial.
staff1[cursor].val = 0.0
staff1_2[cursor].val = 0.0
staff2[cursor].val = 0.0
staff2_2[cursor].val = 0.0
cursor += 1
if cursor == 28:
# reached end of staff, turn off end pieces.
end1.val = 0.0
end2.val = 0.0
if cursor > 40:
# signal to VM that effect is complete
halt()