Changeset - 5e8c505bcc2c
[Not reviewed]
default
0 1 0
dmcc - 23 years ago 2002-07-08 15:53:29

bad cues replaced with bogus ones that can't harm things
1 file changed with 4 insertions and 14 deletions:
0 comments (0 inline, 0 general)
light8/Config.py
Show inline comments
 
from random import randrange
 
from time import time
 
from __future__ import generators,division
 
from Subs import *
 
from Cue import *
 

	
 
f1 = Fade('col blue', 0, 2, 100)
 
f2 = Fade('god', 1, 3, 50)
 
f3 = Fade('house', 0, 4, 0)
 
f4 = Fade('col gree', 0, 8, 75) 
 
f1 = Fade('bogus sub, i hope', 0, 2, 0.1)
 

	
 
g1 = Fade('edges', 1, 2, 20)
 
g2 = Fade('sidepost', 0, 4, 50)
 
g3 = Fade('cyc', 1, 5, 20)
 
g4 = Fade('*curtain', 0, 8, 15) 
 

	
 
c1 = Cue("This", 0, 10, f1, f2, f3, f4)
 
c2 = Cue("That", 0, 5, g1, g2, g3, g4)
 
c3 = Cue("The other", 1, 7, f1, g2, g3, f4)
 

	
 
cues = [c1, c2, c3]
 
cues = [
 
    Cue("Seat filler", 0, 10, f1),
 
]
 

	
 
patch = {
 
    
 
    ('side l','sidepost1') : 45, # posts
 
    ('side r','sidepost2') : 46,
 
    
 
    'sidefill1' : 13,
 
    'sidefill2' : 14,
 

	
 
    ('patio1','main 1',) : 1,
 
    ('main 2',) : 2,
 
    ('main 3',) : 3,
 
    ('main 4',) : 4,
 
    ('main 5',) : 5,
 
    ('god','main 6') : 6,
 
    ('main 7',) : 7,
 
    ('main 8',) : 8,
 
    ('main 9',) : 9,
 
    ('main 10',) : 10,
 
    ('main 11',):11,
 
    ('patio2','main 12',):12,
 
    'hotback':19,
 

	
 
    'cycleft' : 43,
 
    'cycright' : 42,
 
    
 
    'house':68,
 
    ('desk1' ,'b11'):54, # left bank over house
 
    ('marry1' ,'b12'):53,
 
    ('b13',):52,
 
    ('hotbox1' ,'b14'):51,
 
    ('edge' ,'b15'):50,
 
    ('phone','b16'):49,
 
    ('cuba1'   ,'b21'):55, # mid bank
 
    ('b22',):56,
 
    ('b23',):57,
 
    ('b24'):58,
 
    ('b25'):59,
 
    ('desk2'   ,'b26'):60,
 
    ('rock','b31'):61, # right bank
 
    ('b32',):62,
 
    ('hotbox2' ,'b33'):63,
 
    ('b34',):64,
 
    ('marry2' ,'b35'):65,
 
    ('cuba2' ,'b36'):66,
 
    'oran1':21,    'oran2':25,    'oran3':29,    'oran4':33,
 
    'gree1':22,    'gree2':26,    'gree3':30,    'gree4':34,
 
    'blue1':23,    'blue2':27,    'blue3':31,    'blue4':35,
 
    'red1' :24,    'red2' :28,    'red3' :32,    'red4' :36,
 
    'upfill1' : 40,
 
    'upfill2' : 38,
 
    'upfill3' : 37,
 
    'upfill4' : 39,
 
}
 

	
 
from util import maxes,scaledict
 
FL=100
 
def fulls(chans):
 
    # pass a list or multiple args
 
    return dict([(c,FL) for c in chans])
 
def levs(chans,levs):
 
    return dict([(c,v) for c,v in zip(chans,levs)])
 

	
 
def strobe(params, slideradjuster):
 
    patterns = {
 
        'blue' : fulls((23,27,31,35,'b0 4 b','b2 3 b')),
 
        'cyc' : {42:FL,43:FL},
 
        'scp all' : fulls((13,16,18,19,39)),
 
        '1-5' : fulls(range(1, 6)),
 
    }
 
    params.add_param('offtime',SliderParam(range=(0.1,0.3), res=0.001,
 
                                           initial=0.11, length=100))
 
    params.add_param('ontime',SliderParam(range=(0.0,0.8), res=0.001, 
 
                                          length=100))
 
    params.add_param('pattern',ListParam(patterns.keys()))
 
    params.add_param('current',LabelParam('none'))
 
    params.add_param('count',SliderParam(range=(0, 10), res=1, initial=0))
 
    lastchanged = time()
 
    state = 0
 
    blinkcounter = 0
 
    my_pattern = None
 

	
 
    while 1:
 
        if params['count'] and blinkcounter > params['count']:
 
            blinkcounter = 0
 
            slideradjuster.set(0)
 

	
 
        if params['pattern'] != None:
 
            params['current'] = params['pattern']
 
            my_pattern = params['pattern']
 

	
 
        if state == 0:
 
            delay = params['offtime']
 
        else:
 
            delay = params['ontime']
 
            
0 comments (0 inline, 0 general)