Compare commits

..

2 Commits

Author SHA1 Message Date
e4efc148ea More development during the event 2019-09-22 15:11:36 +01:00
698f07c6ff Stuff 2019-09-22 12:58:01 +01:00
3 changed files with 78 additions and 15 deletions

View File

@ -1,5 +1,7 @@
from flight.color import Color
from flight.client import *
from flight.server import FlightServer
MaskOuterRadius = 460
@ -29,6 +31,10 @@ TriangleCount = 30
TriangleWidth = 60
TriangleHeight = 40
TriangleRadius = 430
Spirals = 7
TunnelLoops = 22
FirstTunnelRadius = 10
TunnelLoopMultiplier = 1.25
MaskColor = Color.hsv(0.09, 0.8, 0.25)
DarkMaskColor = MaskColor * 0.25
@ -40,4 +46,4 @@ EvenBeadColor = Color.white(0)
server = FlightServer.ensure_threaded_instance()
client = FlightClient('http://192.168.178.32:8888')
client = FlightClient('http://flight.local:8888')

45
cues.py
View File

@ -1,20 +1,16 @@
#%%
import math
import random
from flight.case import *
from flight.color import Color
from flight.client import *
from flight.expressions import *
from flight.expressions import Expression
from flight.server import FlightServer
from constants import *
#%%
BPM = 126
client.activate()
with Cue('Q01', name='Mask', fadeIn=5, fadeOut=5):
@ -63,6 +59,17 @@ with Cue('Q06', name='Emoji'):
with Cue('Q07', name='Helmet', fadeIn=1, fadeOut=1):
Match('#helmet').fader = 1
with Cue('Q08', name='Shrinking mask', fadeIn=1, fadeOut=1):
period = 20
count = t / period
Match('#master_mask').scale = 0.01 + sine(count)
with Cue('Q09', name='Beating mask', fadeIn=1, fadeOut=1):
period = 60 / BPM
count = t / period
beat = sawtooth(count, duty=0.25)
Match('#master_mask').scale = 0.9 + 0.2 * impulse(beat)
with Cue('Q11', name='Rainbow triangles', fadeIn=1, fadeOut=1):
period = 5
count = t / period
@ -101,7 +108,7 @@ with Cue('Q21', name='Twinkling stars', fadeIn=1, fadeOut=1):
Match('.star .fill').color = white(sine(count))
with Cue('Q22', name='Bouncing stars', fadeIn=1, fadeOut=1):
period = 1
period = 2
phase = uniform('Q21.phase')[i]
count = gt / period + phase
Match('#stars').fader = 1
@ -136,3 +143,25 @@ with Cue('Q24', name='Rushing stars', fadeIn=1, fadeOut=1):
m.y = (uniform('Q24.y', i)[count] - 0.5) * screen.height * 2 * (count % 1)
m.color = white(sine(count))
m.scale = count % 1
with Cue('Q25', name='Beating stars', fadeIn=1, fadeOut=1):
period = 60 / BPM
count = t / period
beat = sawtooth(count, duty=0.25)
Match('#stars').scale = 0.9 + 0.2 * impulse(beat)
with Cue('Q31', name='Spirals', fadeIn=1, fadeOut=1):
period = 10
count = t / period
value = 0.25 + 0.75 * sine(1.3 * (count + meta.count / Spirals))
Match('#spirals').fader = 1
Match('#spirals').rotate = -count
Match('.spiral .segment').lineWidth = 1.5 ** meta.index
Match('.spiral .segment').color = hsv(count + meta.count / Spirals, meta.index / 8, value)
with Cue('Q41', name='Tunnel', fadeIn=1, fadeOut=1):
period = 2
count = t / period
Match('#tunnel').fader = 1
Match('#tunnel .loop').color = hsv(count - i/n, 1, 0.25 + 0.75 * i/n)
Match('#tunnel').scale = 1 + (TunnelLoopMultiplier - 1) * sawtooth(count)

View File

@ -1,14 +1,8 @@
#%%
import math
import random
from flight.case import *
from flight.color import Color
from flight.client import *
from flight.expressions import *
from flight.expressions import Expression
from flight.server import FlightServer
from constants import *
@ -42,6 +36,30 @@ def Star(radius):
ClosePath()
def Spiral(count, startRadius=10, loops=2, **kwargs):
with Group(**kwargs):
r = startRadius
x = -r
y = 0
for j in range(loops * 4):
d = j % 4
start = d / 4
end = (d + 1) / 4
with Path(tags='segment', meta_index=j, meta_count=count):
Ellipse(x, y, r, r, startAngle=start, endAngle=end)
StrokePath()
if d == 0:
y -= r
elif d == 1:
x += r
elif d == 2:
y += r
elif d == 3:
x -= r
r *= 2
with Screen('main', width=1920, height=1080) as screen:
with Pattern('beads', width=BeadSeparation * 2, height=BeadSeparation * 2) as beads:
for x in range(3):
@ -130,6 +148,16 @@ with Screen('main', width=1920, height=1080) as screen:
with Path(tags='outline'):
Star(10)
StrokePath()
with Group('spirals', x=screen.width/2, y=screen.height/2, color='white', lineWidth=2, fader=0, composite='lighter'):
for j in range(Spirals):
Spiral(rotate=j/Spirals, count=j, tags='spiral')
with Group('tunnel', x=screen.width/2, y=screen.height/2, fader=0, composite='lighter'):
radius = FirstTunnelRadius
for j in range(TunnelLoops):
with Path(tags='loop', lineWidth=radius / 10):
Ellipse(0, 0, radius, radius)
StrokePath()
radius *= TunnelLoopMultiplier
with Path(id='mask', pattern='mask_pattern', fader=0):
Rect(0, 0, container.width, container.height)
FillPath()