コード例 #1
0
    def __init__(self):
        lux.register(
            Parameter(name="simple_rate",
                      description="0..1   controls the rate of spinning cubes",
                      default_value=1.0))
        #eventually i'll port these to lux parameters, but right now there doesn't seem to be any reason to since there are no GUI sliders
        self.max_segments = 600  #tweak according to openlase calibration parameters; too high can cause ol to crash
        self.max_cycles = 3  # set high (~50) for maximum glitch factor
        self.time = 1
        self.time_step = 1 / 30
        self.time_scale = 1
        self.theta_step = 0.01
        self.R = 0.25  # big steps
        self.R_frequency = 1 / 100
        self.r = 0.08  # little steps
        self.r_frequency = 1 / 370
        self.p = 0.5  # size of the ring
        self.p_frequency = 1 / 233
        self.color_time_frequency = 1 / 10
        self.color_length_frequency = 0  #3/240 #set to 0 to calibrate color
        self.color_angle_frequency = 0.5
        self.spatial_resonance = 6  #ok why is this 5 and not 4?
        self.spatial_resonance_amplitude = 0.1
        self.spatial_resonance_offset = 0.25

        self.r_prime = 3  #37
        self.g_prime = 2  #23
        self.b_prime = 1  #128

        self.scale = 2
        self.width = self.scale
        self.height = self.scale
        self.bass = 1  # plz hack this to do fft power binning kthx
        #note to self, could modulate radius with average of n_samples/n_segments
        self.audio_gain = 10
コード例 #2
0
ファイル: phospho_paint.py プロジェクト: broxtronix/Fiat-Lux
 def __init__(self):
     # This is how you register a parameter with the lux engine.
     # Parameters can be controlled using OSC or in the GUI.
     lux.register(
         Parameter(name="simple_rate",
                   description="0..1   controls the rate of spinning cubes",
                   default_value=.3))
コード例 #3
0
ファイル: daisy.py プロジェクト: GunioRobot/Fiat-Lux
 def __init__(self):
     self.NUM_CIRCLES = 4
     lux.register(Parameter( name = "simple_rate",
                             description = "0..1   controls the rate of spinning cubes",
                             default_value = 1.0 ))
     self.scale = 2.0
     self.max_segments = 20 #tweak according to openlase calibration parameters; too high can cause ol to crash
     self.max_cycles = 2 # set high (~50) for maximum glitch factor
     self.time_scale = 0.4
     self.R = 0.25 # big steps
     self.R_frequency =  1/100
     self.r = 0.08 # little steps
     self.r_frequency = 1/370
     self.p = 0.5 # size of the ring
     self.p_frequency = 1/2000
     self.color_time_frequency = 1/10
     self.color_length_frequency = 0 #3/240 #set to 0 to calibrate color
     self.color_angle_frequency = 0.1
     self.spatial_resonance = 3 #ok why is this 5 and not 4?
     self.spatial_resonance_amplitude = 0.1 
     self.spatial_resonance_offset = 0.25
     self.color_phases = random(self.NUM_CIRCLES)*6
     self.z_rotations = random(self.NUM_CIRCLES) * 0.22
     self.y_rotations = random(self.NUM_CIRCLES) * 0.24
     self.x_rotations = random(self.NUM_CIRCLES) * 0.33
     
     self.r_prime = 3 #37 
     self.g_prime = 2 #23 
     self.b_prime = 1 #128 
     
     self.scale = 2
     self.width = self.scale
     self.height = self.scale
     self.bass = 1 # plz hack this to do fft power binning kthx
コード例 #4
0
ファイル: guilloche.py プロジェクト: GunioRobot/Fiat-Lux
 def __init__(self):
     lux.register(Parameter( name = "simple_rate",
                             description = "0..1   controls the rate of spinning cubes",
                             default_value = 1.0 ))
     #eventually i'll port these to lux parameters, but right now there doesn't seem to be any reason to since there are no GUI sliders
     self.max_segments = 800 #tweak according to openlase calibration parameters; too high can cause ol to crash
     self.max_cycles = 5 # set high (~50) for maximum glitch factor
     self.time = 1
     self.time_step = 1/30
     self.time_scale = 0.4
     self.theta_step = 0.01
     self.R = 0.25 # big steps
     self.R_frequency =  1/100
     self.r = 0.08 # little steps
     self.r_frequency = 1/370
     self.p = 0.5 # size of the ring
     self.p_frequency = 1/2000
     self.color_time_frequency = 1/10
     self.color_length_frequency = 0 #3/240 #set to 0 to calibrate color
     self.color_angle_frequency = 0.5
     self.spatial_resonance = 3 #ok why is this 5 and not 4?
     self.spatial_resonance_amplitude = 0.1 
     self.spatial_resonance_offset = 0.25
     
     self.r_prime = 3 #37 
     self.g_prime = 2 #23 
     self.b_prime = 1 #128 
     
     self.scale = 2
     self.width = self.scale
     self.height = self.scale
     self.bass = 1 # plz hack this to do fft power binning kthx
コード例 #5
0
ファイル: simple.py プロジェクト: GunioRobot/Fiat-Lux
    def __init__(self):

        # This is how you register a parameter with the lux engine.
        # Parameters can be controlled using OSC or in the GUI.
        lux.register(Parameter( name = "simple_rate",
                                description = "0..1   controls the rate of spinning cubes",
                                default_value = 1.0 ))
コード例 #6
0
ファイル: two_cubes.py プロジェクト: GunioRobot/Fiat-Lux
 def __init__(self):
     # This is how you register a parameter with the lux engine.
     # Parameters can be controlled using OSC or in the GUI.
     lux.register(Parameter( name = "TwoCubes_simple_rate",
                             description = "0..1   controls the rate of spinning cubes",
                             namespace = "two_cubes",
                             min_value = 0.0, max_value = 1.0, default_value = 1.0,
                             stateful = True))
コード例 #7
0
ファイル: reach.py プロジェクト: GunioRobot/Fiat-Lux
 def __init__(self):
     lux.register(
         Parameter(name="simple_rate", description="0..1   controls the rate of spinning cubes", default_value=1.0)
     )
     self.arms = []
     for i in range(num_arms):
         r = random.uniform(0, 1)
         g = random.uniform(0, 1)
         b = random.uniform(0, 1)
         arm = Arm(random.uniform(-1, 1), random.uniform(-1, 1), color=(r, g, b))
         self.arms.append(arm)
コード例 #8
0
ファイル: tween_chain.py プロジェクト: GunioRobot/Fiat-Lux
    def __init__(self):

        # This is how you register a parameter with the lux engine.
        # Parameters can be controlled using OSC or in the GUI.
        lux.register(Parameter( name = "simple_rate",
                                description = "0..1   controls the rate of spinning cubes",
                                default_value = 1.0 ))
        self.tweener = pytweener.Tweener()
        self.chain = Chain(self.tweener)
        self.particle = Particle()
        self.last_time = 0
コード例 #9
0
 def __init__(self):
     lux.register(Parameter( name = "simple_rate",
                             description = "0..1   controls the rate of spinning cubes",
                             default_value = 1.0 ))
     self.arms = []
     for i in range(num_arms):
       r = random.uniform(0,1)
       g = random.uniform(0,1)
       b = random.uniform(0,1)
       arm = Arm(random.uniform(-1,1), random.uniform(-1,1), color=(r,g,b))
       self.arms.append(arm)
コード例 #10
0
 def __init__(self):
     # This is how you register a parameter with the lux engine.
     # Parameters can be controlled using OSC or in the GUI.
     lux.register(
         Parameter(name="TwoCubes_simple_rate",
                   description="0..1   controls the rate of spinning cubes",
                   namespace="two_cubes",
                   min_value=0.0,
                   max_value=1.0,
                   default_value=1.0,
                   stateful=True))
コード例 #11
0
    def __init__(self):

        # This is how you register a parameter with the lux engine.
        # Parameters can be controlled using OSC or in the GUI.
        lux.register(
            Parameter(name="simple_rate",
                      description="0..1   controls the rate of spinning cubes",
                      default_value=1.0))
        self.tweener = pytweener.Tweener()
        self.net = Net(self.tweener)
        self.last_time = 0
コード例 #12
0
ファイル: touch_cubes.py プロジェクト: GunioRobot/Fiat-Lux
 def __init__(self):
     # This is how you register a parameter with the lux engine.
     # Parameters can be controlled using OSC or in the GUI.
     lux.register(Parameter( name = "TouchCubes_simple_rate",
                             description = "0..1   controls the rate of spinning cubes",
                             namespace = "touch_cubes",
                             min_value = 0.0, max_value = 1.0, default_value = 1.0,
                             stateful = True))
     # create server, listening on port 1234
     try:
         self.server = liblo.Server(8000)
     except liblo.ServerError, err:
         print str(err)
         sys.exit()
コード例 #13
0
 def __init__(self):
     # This is how you register a parameter with the lux engine.
     # Parameters can be controlled using OSC or in the GUI.
     lux.register(
         Parameter(name="TouchCubes_simple_rate",
                   description="0..1   controls the rate of spinning cubes",
                   namespace="touch_cubes",
                   min_value=0.0,
                   max_value=1.0,
                   default_value=1.0,
                   stateful=True))
     # create server, listening on port 1234
     try:
         self.server = liblo.Server(8000)
     except liblo.ServerError, err:
         print str(err)
         sys.exit()
コード例 #14
0
ファイル: mesh.py プロジェクト: GunioRobot/Fiat-Lux
    def __init__(self):
        # This is how you register a parameter with the lux engine.
        # Parameters can be controlled using OSC or in the GUI.
        lux.register(Parameter( name = "simple_rate",
                                description = "0..1   controls the rate of spinning cubes",
                                default_value = 1.0 ))

        self.verts, self.faces = obj_loader("plugins/obj-files/shuttle.obj")
        print "Loaded %i vertices and %i faces" % (self.verts.shape[0], len(self.faces))
        self.loaded = False

        vmin = self.verts.min(axis=0)
        vmax = self.verts.max(axis=0)
        
        self.verts -= vmin
        self.verts /= vmax
        
        self.torender = arange(len(self.faces))
コード例 #15
0
    def __init__(self):
        # This is how you register a parameter with the lux engine.
        # Parameters can be controlled using OSC or in the GUI.
        lux.register(
            Parameter(name="simple_rate",
                      description="0..1   controls the rate of spinning cubes",
                      default_value=1.0))

        self.verts, self.faces = obj_loader("plugins/obj-files/shuttle.obj")
        print "Loaded %i vertices and %i faces" % (self.verts.shape[0],
                                                   len(self.faces))
        self.loaded = False

        vmin = self.verts.min(axis=0)
        vmax = self.verts.max(axis=0)

        self.verts -= vmin
        self.verts /= vmax

        self.torender = arange(len(self.faces))
コード例 #16
0
ファイル: platonic.py プロジェクト: broxtronix/Fiat-Lux
    def __init__(self):

        # This is how you register a parameter with the lux engine.
        # Parameters can be controlled using OSC or in the GUI.
        lux.register(Parameter( name = "simple_rate",
                                description = "0..1   controls the rate of spinning cubes",
                                default_value = .3 ))

        tetrahedron_points=((0., 0., 0.612372),
                         (-0.288675, -0.5, -0.204124),
                         (-0.288675,  0.5, -0.204124),
                         (0.57735, 0., -0.204124))
        tetrahedron_faces=((2, 3, 4), (3, 2, 1), (4, 1, 2), (1, 4, 3))

        tetrahedron_strips=((1, 2, 3, 1), (1,4,3), (4, 2))
        self.tetrahedron_face_edges=[]
        for f in tetrahedron_strips:
            tmp=[]
            for s in f:
                tmp.append(tetrahedron_points[s-1])
            self.tetrahedron_face_edges.append( tmp )

        octahedron_points=((-0.707107, 0., 0.), (0., 0.707107, 0.), (0., 0., -0.707107),
              (0., 0., 0.707107), (0., -0.707107, 0.), (0.707107, 0., 0.))
        octahedron_faces=((4, 5, 6), (4, 6, 2), (4, 2, 1), (4, 1, 5),
                          (5, 1, 3), (5, 3, 6), (3, 1, 2), (6, 3, 2))
        octahedron_strips=((1,2,3),(1,4,5),(6,2,4),(6,3,5))
        
        self.octahedron_face_edges=[]
        for f in octahedron_strips:
            tmp=[]
            for s in f:
                tmp.append(octahedron_points[s-1])
            self.octahedron_face_edges.append( tmp )
            
        icos_points=((0.0, -0.52573099999999995, 0.85065100000000005),
                     (0.85065100000000005, 0.0, 0.52573099999999995),
                     (0.85065100000000005, 0.0, -0.52573099999999995),
                     (-0.85065100000000005, 0.0, -0.52573099999999995),
                     (-0.85065100000000005, 0.0, 0.52573099999999995),
                     (-0.52573099999999995, 0.85065100000000005, 0.0),
                     (0.52573099999999995, 0.85065100000000005, 0.0),
                     (0.52573099999999995, -0.85065100000000005, 0.0),
                     (-0.52573099999999995, -0.85065100000000005, 0.0),
                     (0.0, -0.52573099999999995, -0.85065100000000005),
                     (0.0, 0.52573099999999995, -0.85065100000000005),
                     (0.0, 0.52573099999999995, 0.85065100000000005))
        icos_faces=((1, 2, 6), (1, 7, 2), (3, 4, 5), (4, 3, 8), (6, 5, 11),
                    (5, 6, 10), (9, 10, 2), (10, 9, 3), (7, 8, 9), (8, 7, 0),
                    (11, 0, 1), (0, 11, 4), (6, 2, 10), (1, 6, 11), (3, 5, 10),
                    (5, 4, 11), (2, 7, 9), (7, 1, 0), (3, 9, 8), (4, 8, 0))
        icos_strips=((2, 12, 8, 7, 11, 4, 12, 10, 6, 5, 9, 1),
                     (2, 8, 3, 10, 1), (2, 7, 9, 3, 1), (2, 11, 5, 1), (2, 4, 6, 1),
                     (10, 8), (3, 7), (9, 11), (5, 4), (6, 12))
        self.icos_face_edges=[]
        for f in icos_faces:
            self.icos_face_edges.append( [icos_points[f[0]], icos_points[f[1]], icos_points[f[2]] ] )
        #for f in icos_strips:
        #    tmp=[]
        #    for s in f:
        #        tmp.append(icos_points[s-1])
        #    self.icos_face_edges.append( tmp )

        dodeca_points=((-1.37638, 0., 0.262866),
                       (1.37638, 0., -0.262866),
                       (-0.425325, -1.30902, 0.262866),
                       (-0.425325, 1.30902, 0.262866),
                       (1.11352, -0.809017, 0.262866),
                       (1.11352,  0.809017, 0.262866),
                       (-0.262866, -0.809017, 1.11352),
                       (-0.262866, 0.809017, 1.11352),
                       (-0.688191, -0.5, -1.11352),
                       (-0.688191,  0.5, -1.11352),
                       (0.688191, -0.5, 1.11352),
                       (0.688191, 0.5,  1.11352),
                       (0.850651, 0., -1.11352),
                       (-1.11352, -0.809017, -0.262866),
                       (-1.11352,  0.809017, -0.262866),
                       (-0.850651, 0., 1.11352),
                       (0.262866, -0.809017, -1.11352),
                       (0.262866,  0.809017, -1.11352),
                       (0.425325, -1.30902, -0.262866),
                       (0.425325,  1.30902, -0.262866))
        dodeca_faces=((15, 10, 9, 14, 1), (2, 6, 12, 11, 5), (5, 11, 7, 3, 19),
                     (11, 12, 8, 16, 7), (12, 6, 20, 4, 8), (6, 2, 13, 18, 20),
                     (2, 5, 19, 17, 13), (4, 20, 18, 10, 15), (18, 13, 17, 9, 10),
                     (17, 19, 3, 14, 9), (3, 7, 16, 1, 14), (16, 8, 4, 15, 1))
        self.dodeca_face_edges=[]
        for f in dodeca_faces:
            self.dodeca_face_edges.append( [dodeca_points[f[0]-1],
                                            dodeca_points[f[1]-1],
                                            dodeca_points[f[2]-1],
                                            dodeca_points[f[3]-1],
                                            dodeca_points[f[4]-1]] )