Compare commits
4 Commits
e4efc148ea
...
main
Author | SHA1 | Date | |
---|---|---|---|
6952d182c0 | |||
67fdd3e3b3 | |||
ea70fb6000 | |||
8039da3718 |
@ -4,6 +4,8 @@ from flight.client import *
|
|||||||
from flight.server import FlightServer
|
from flight.server import FlightServer
|
||||||
|
|
||||||
|
|
||||||
|
Width = 1920
|
||||||
|
Height = 1200
|
||||||
MaskOuterRadius = 460
|
MaskOuterRadius = 460
|
||||||
MaskInnerRadius = 400
|
MaskInnerRadius = 400
|
||||||
BeadSeparation = 15
|
BeadSeparation = 15
|
||||||
@ -45,5 +47,5 @@ OddBeadColor = Color.red(1)
|
|||||||
EvenBeadColor = Color.white(0)
|
EvenBeadColor = Color.white(0)
|
||||||
|
|
||||||
|
|
||||||
server = FlightServer.ensure_threaded_instance()
|
#server = FlightServer.ensure_threaded_instance()
|
||||||
client = FlightClient('http://flight.local:8888')
|
client = FlightClient() #'http://duquesne.local:8888')
|
||||||
|
49
cues.py
49
cues.py
@ -8,7 +8,7 @@ from constants import *
|
|||||||
|
|
||||||
#%%
|
#%%
|
||||||
|
|
||||||
BPM = 126
|
BPM = 118
|
||||||
|
|
||||||
|
|
||||||
client.activate()
|
client.activate()
|
||||||
@ -19,14 +19,14 @@ with Cue('Q01', name='Mask', fadeIn=5, fadeOut=5):
|
|||||||
with Cue('Q02', name='Rotating mask', fadeIn=1, fadeOut=2):
|
with Cue('Q02', name='Rotating mask', fadeIn=1, fadeOut=2):
|
||||||
period = 11
|
period = 11
|
||||||
count = t / period
|
count = t / period
|
||||||
Match('#master_mask').rotate = count % 1 * f
|
Match('#main_mask').rotate = count % 1 * f
|
||||||
|
|
||||||
with Cue('Q03', name='Multiple masks'):
|
with Cue('Q03', name='Multiple masks'):
|
||||||
period = 3
|
period = 3
|
||||||
scale = 1 / (1 + (t / period) // 1)
|
scale = 1 / (1 + (t / period) // 1)
|
||||||
Match('#mask').scale = scale
|
Match('#mask').scale = scale
|
||||||
Match('#mask Rect').width = container.width / scale
|
Match('#mask Rect').width = Width / scale
|
||||||
Match('#mask Rect').height = container.height / scale
|
Match('#mask Rect').height = Height / scale
|
||||||
|
|
||||||
with Cue('Q04', name='Blinking eyes') as Q2:
|
with Cue('Q04', name='Blinking eyes') as Q2:
|
||||||
period = 3
|
period = 3
|
||||||
@ -58,17 +58,18 @@ with Cue('Q06', name='Emoji'):
|
|||||||
|
|
||||||
with Cue('Q07', name='Helmet', fadeIn=1, fadeOut=1):
|
with Cue('Q07', name='Helmet', fadeIn=1, fadeOut=1):
|
||||||
Match('#helmet').fader = 1
|
Match('#helmet').fader = 1
|
||||||
|
Match('#symbol Text').text = '⭐️'
|
||||||
|
|
||||||
with Cue('Q08', name='Shrinking mask', fadeIn=1, fadeOut=1):
|
with Cue('Q08', name='Shrinking mask', fadeIn=1, fadeOut=1):
|
||||||
period = 20
|
period = 20
|
||||||
count = t / period
|
count = t / period
|
||||||
Match('#master_mask').scale = 0.01 + sine(count)
|
Match('#main_mask').scale = 0.01 + sine(count)
|
||||||
|
|
||||||
with Cue('Q09', name='Beating mask', fadeIn=1, fadeOut=1):
|
with Cue('Q09', name='Beating mask', fadeIn=1, fadeOut=1):
|
||||||
period = 60 / BPM
|
period = 60 / BPM
|
||||||
count = t / period
|
count = t / period
|
||||||
beat = sawtooth(count, duty=0.25)
|
beat = sawtooth(count, duty=0.25)
|
||||||
Match('#master_mask').scale = 0.9 + 0.2 * impulse(beat)
|
Match('#main_mask').scale = 0.9 + 0.2 * impulse(beat)
|
||||||
|
|
||||||
with Cue('Q11', name='Rainbow triangles', fadeIn=1, fadeOut=1):
|
with Cue('Q11', name='Rainbow triangles', fadeIn=1, fadeOut=1):
|
||||||
period = 5
|
period = 5
|
||||||
@ -102,8 +103,8 @@ with Cue('Q21', name='Twinkling stars', fadeIn=1, fadeOut=1):
|
|||||||
count = gt / period + phase
|
count = gt / period + phase
|
||||||
Match('#stars').fader = 1
|
Match('#stars').fader = 1
|
||||||
with Match('.star') as m:
|
with Match('.star') as m:
|
||||||
m.x = (uniform('Q21.x', i)[count] - 0.5) * screen.width
|
m.x = (uniform('Q21.x', i)[count] - 0.5) * Width
|
||||||
m.y = (uniform('Q21.y', i)[count] - 0.5) * screen.height
|
m.y = (uniform('Q21.y', i)[count] - 0.5) * Height
|
||||||
Match('.star').scale = uniform('Q21.scale', i)[count]
|
Match('.star').scale = uniform('Q21.scale', i)[count]
|
||||||
Match('.star .fill').color = white(sine(count))
|
Match('.star .fill').color = white(sine(count))
|
||||||
|
|
||||||
@ -113,8 +114,8 @@ with Cue('Q22', name='Bouncing stars', fadeIn=1, fadeOut=1):
|
|||||||
count = gt / period + phase
|
count = gt / period + phase
|
||||||
Match('#stars').fader = 1
|
Match('#stars').fader = 1
|
||||||
with Match('.star') as m:
|
with Match('.star') as m:
|
||||||
m.x = (uniform('Q21.x', i)[count] - 0.5) * screen.width
|
m.x = (uniform('Q21.x', i)[count] - 0.5) * Width
|
||||||
m.y = (uniform('Q21.y', i)[count] - 0.5) * screen.height
|
m.y = (uniform('Q21.y', i)[count] - 0.5) * Height
|
||||||
m.rotate = count / 5
|
m.rotate = count / 5
|
||||||
m.scale = bounce(count) * 25
|
m.scale = bounce(count) * 25
|
||||||
Match('.star .outline').color = hsv(uniform('Q22.hue', i)[count], 1, bounce(count))
|
Match('.star .outline').color = hsv(uniform('Q22.hue', i)[count], 1, bounce(count))
|
||||||
@ -126,12 +127,12 @@ with Cue('Q23', name='Thin stars', fadeIn=1, fadeOut=1):
|
|||||||
hue = quad(count, uniform('Q23.hue', i)[count], uniform('Q23.hue', i)[count + 1])
|
hue = quad(count, uniform('Q23.hue', i)[count], uniform('Q23.hue', i)[count + 1])
|
||||||
Match('#stars').fader = 1
|
Match('#stars').fader = 1
|
||||||
with Match('.star') as m:
|
with Match('.star') as m:
|
||||||
m.lineWidth = sine(count) / 10
|
m.lineWidth = sine(count) / 5
|
||||||
m.scale = 50
|
m.scale = 50
|
||||||
m.x = (uniform('Q23.x')[i] - 0.5) * screen.width
|
m.x = (uniform('Q23.x')[i] - 0.5) * Width
|
||||||
m.y = (uniform('Q23.y')[i] - 0.5) * screen.height
|
m.y = (uniform('Q23.y')[i] - 0.5) * Height
|
||||||
m.rotate = count / 10
|
m.rotate = count / 10
|
||||||
Match('.star .outline').color = hsv(hue, 0.8, 1)
|
Match('.star .outline').color = hsv(hue, 0.75, 1)
|
||||||
|
|
||||||
with Cue('Q24', name='Rushing stars', fadeIn=1, fadeOut=1):
|
with Cue('Q24', name='Rushing stars', fadeIn=1, fadeOut=1):
|
||||||
period = 3
|
period = 3
|
||||||
@ -139,8 +140,8 @@ with Cue('Q24', name='Rushing stars', fadeIn=1, fadeOut=1):
|
|||||||
count = gt / period + phase
|
count = gt / period + phase
|
||||||
Match('#stars').fader = 1
|
Match('#stars').fader = 1
|
||||||
with Match('.star') as m:
|
with Match('.star') as m:
|
||||||
m.x = (uniform('Q24.x', i)[count] - 0.5) * screen.width * 2 * (count % 1)
|
m.x = (uniform('Q24.x', i)[count] - 0.5) * Width * 2 * (count % 1)
|
||||||
m.y = (uniform('Q24.y', i)[count] - 0.5) * screen.height * 2 * (count % 1)
|
m.y = (uniform('Q24.y', i)[count] - 0.5) * Height * 2 * (count % 1)
|
||||||
m.color = white(sine(count))
|
m.color = white(sine(count))
|
||||||
m.scale = count % 1
|
m.scale = count % 1
|
||||||
|
|
||||||
@ -163,5 +164,17 @@ with Cue('Q41', name='Tunnel', fadeIn=1, fadeOut=1):
|
|||||||
period = 2
|
period = 2
|
||||||
count = t / period
|
count = t / period
|
||||||
Match('#tunnel').fader = 1
|
Match('#tunnel').fader = 1
|
||||||
Match('#tunnel .loop').color = hsv(count - i/n, 1, 0.25 + 0.75 * i/n)
|
Match('#tunnel .loop', mix=False).color = hsv(count - i/n, 1, 0.25 + 0.75 * i/n)
|
||||||
Match('#tunnel').scale = 1 + (TunnelLoopMultiplier - 1) * sawtooth(count)
|
Match('#tunnel', mix=False).scale = 1 + (TunnelLoopMultiplier - 1) * sawtooth(count)
|
||||||
|
|
||||||
|
with Cue('Q51', name='Blowing bubbles', fadeIn=1, fadeOut=1):
|
||||||
|
period = 6
|
||||||
|
phase = uniform('Q51.phase')[i]
|
||||||
|
count = gt / period + phase
|
||||||
|
Match('#bubbles').fader = 1
|
||||||
|
with Match('.bubble') as m:
|
||||||
|
m.x = (uniform('Q51.x', i)[count] - 0.5) * Width * 2 * (count % 1)
|
||||||
|
m.y = (uniform('Q51.y', i)[count] - 0.5) * Height * 2 * (count % 1)
|
||||||
|
m.scale = uniform('Q51.scale', i)[count] * 10
|
||||||
|
Match('.bubble .inside').color = white(0.3 * sine(count))
|
||||||
|
Match('.bubble .outside').color = hsv(uniform('Q51.hue', i)[count], 0.8, sine(count))
|
||||||
|
21
notes.md
Normal file
21
notes.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Notes
|
||||||
|
|
||||||
|
- Need to reintroduce the audio processing for reacting to music
|
||||||
|
- Figure out a mechanism for introducing repetition into the object graph that can be controlled from the cue animations – i.e., be able to control the number of repeated objects
|
||||||
|
|
||||||
|
```python
|
||||||
|
|
||||||
|
with Repeat(id='stars', count=1):
|
||||||
|
with Path(tags='star'):
|
||||||
|
pass
|
||||||
|
|
||||||
|
with Cue('Qxx'):
|
||||||
|
Match('#stars').count = sine(t / 10) * 50
|
||||||
|
with Match('.star') as m:
|
||||||
|
m.x = uniform('Qxx.x')[i] * width
|
||||||
|
m.y = uniform('Qxx.x')[i] * height
|
||||||
|
m.color = hsv(i / n, 1, 1)
|
||||||
|
```
|
||||||
|
|
||||||
|
- Would need to be able to identify objects via something other than their _id_ – perhaps indexed instead?
|
||||||
|
- `KitObject.select()` method would need to know how to return these repeated objects
|
13
setup.py
13
setup.py
@ -60,7 +60,7 @@ def Spiral(count, startRadius=10, loops=2, **kwargs):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
with Screen('main', width=1920, height=1080) as screen:
|
with Screen('main', width=Width, height=Height) as screen:
|
||||||
with Pattern('beads', width=BeadSeparation * 2, height=BeadSeparation * 2) as beads:
|
with Pattern('beads', width=BeadSeparation * 2, height=BeadSeparation * 2) as beads:
|
||||||
for x in range(3):
|
for x in range(3):
|
||||||
for y in range(3):
|
for y in range(3):
|
||||||
@ -70,7 +70,7 @@ with Screen('main', width=1920, height=1080) as screen:
|
|||||||
Ellipse(0, 0, BeadRadius, BeadRadius)
|
Ellipse(0, 0, BeadRadius, BeadRadius)
|
||||||
FillPath()
|
FillPath()
|
||||||
with Pattern('mask_pattern', width=screen.width, height=screen.height) as container:
|
with Pattern('mask_pattern', width=screen.width, height=screen.height) as container:
|
||||||
with Group('master_mask', color=MaskColor, x=container.width/2, y=container.height/2):
|
with Group('main_mask', color=MaskColor, x=container.width/2, y=container.height/2):
|
||||||
with Path(tags='background'):
|
with Path(tags='background'):
|
||||||
Ellipse(x=0, y=0, radiusX=MaskOuterRadius, radiusY=MaskOuterRadius)
|
Ellipse(x=0, y=0, radiusX=MaskOuterRadius, radiusY=MaskOuterRadius)
|
||||||
FillPath()
|
FillPath()
|
||||||
@ -148,6 +148,15 @@ with Screen('main', width=1920, height=1080) as screen:
|
|||||||
with Path(tags='outline'):
|
with Path(tags='outline'):
|
||||||
Star(10)
|
Star(10)
|
||||||
StrokePath()
|
StrokePath()
|
||||||
|
with Group('bubbles', composite='lighter', x=screen.width / 2, y=screen.height / 2, fader=0):
|
||||||
|
for j in range(100):
|
||||||
|
with Group(tags='bubble'):
|
||||||
|
with Path(tags='inside'):
|
||||||
|
Ellipse(0, 0, 10, 10)
|
||||||
|
FillPath()
|
||||||
|
with Path(tags='outside'):
|
||||||
|
Ellipse(0, 0, 10, 10)
|
||||||
|
StrokePath()
|
||||||
with Group('spirals', x=screen.width/2, y=screen.height/2, color='white', lineWidth=2, fader=0, composite='lighter'):
|
with Group('spirals', x=screen.width/2, y=screen.height/2, color='white', lineWidth=2, fader=0, composite='lighter'):
|
||||||
for j in range(Spirals):
|
for j in range(Spirals):
|
||||||
Spiral(rotate=j/Spirals, count=j, tags='spiral')
|
Spiral(rotate=j/Spirals, count=j, tags='spiral')
|
||||||
|
Reference in New Issue
Block a user