summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2012-11-01 16:22:34 +0100
committerFlorian Bruhin <git@the-compiler.org>2012-11-01 16:22:34 +0100
commit90e777cea8f0e38477c6d3bb1c3b74cb0af16923 (patch)
treed97e3335f8425430e7e6e489bc6b1ab1322e00ba
parentb61dc2ef5249e3113204692cd9e6d15da17e4709 (diff)
downloadfarbrauch-90e777cea8f0e38477c6d3bb1c3b74cb0af16923.tar.gz
farbrauch-90e777cea8f0e38477c6d3bb1c3b74cb0af16923.zip
Some partycoding
-rw-r--r--farbrauch.py39
1 files changed, 27 insertions, 12 deletions
diff --git a/farbrauch.py b/farbrauch.py
index cdc56af..7a3acf6 100644
--- a/farbrauch.py
+++ b/farbrauch.py
@@ -35,8 +35,8 @@ data = {
734: (0,0,255,0,0,255),
799: (255,0,0,255,0,0),
960: (242,29,24,242,29,24),
- 2508: (195,196,196,163,89,34),
- 2675: (249,38,51,251,254,248),
+ 2508: (195,196,196,163,89,34), # hall 1
+ 2675: (249,38,51,251,254,248), # hall 2
2800: (0,0,0,0,0,0),
2840: (253,208,175,251,254,248),
3062: (250,119,252,54,240,253), # Farben
@@ -53,10 +53,9 @@ data = {
3910: (0,0,0,0,0,0)
}
-fades = [ (2675,2800), (2800,2840), (100,140), (3406,3910)]
+fades = [ (2508, 2675), (2675,2800), (2800,2840), (100,140), (3406,3910)]
def rcolor(s=0, e=254):
- print("randint: {} {}".format(s,e))
return random.randint(s,e)
def clamp(val, min=0, max=254):
@@ -91,12 +90,12 @@ def addfire(start, end):
def whiteflicker():
for i in range(184,734, 5):
- val = rcolor()
- val2 = rcolor()
- offset = rcolor(-10,10)
- offset2 = rcolor(-10,10)
- v = clamp(val+offset)
- v2 = clamp(val2+offset2)
+ v = rcolor()
+ v2 = rcolor()
+# offset = rcolor(-10,10)
+# offset2 = rcolor(-10,10)
+# v = clamp(val+offset)
+# v2 = clamp(val2+offset2)
data[i] = (v, v, v, v2, v2, v2)
if i < 733:
fades.append((i, i+5))
@@ -162,11 +161,25 @@ def out_serial(data):
pass
mplayer = subprocess.Popen(['/usr/bin/mplayer', '-msglevel', 'decvideo=7',
- videofile], stdout=subprocess.PIPE,
+ '-vo', 'gl', videofile], stdout=subprocess.PIPE,
stderr=null)
+def jitter():
+ prevals = [ None, None, None, None, None, None ]
+ for f in range(0, 3910):
+ if f in data:
+ prevals = data[f]
+ else:
+ if any(e is not None for e in prevals):
+ newdata = []
+ offset = rcolor(-5,5)
+ for elem in prevals:
+ newdata.append(clamp(elem + offset))
+ data[f] = newdata
+
def precalc():
filldata()
+# jitter()
addfire(0,101)
whiteflicker()
psychoblink()
@@ -187,7 +200,9 @@ while True:
frame = None
print(frame)
if frame and frame in data:
- driver(data[frame])
+ driver([0,0,0] + list(data[frame][3:]))
+ if frame == 3910:
+ sys.exit(0)
close(null)