예제 #1
0
 def getFrame(self):
     frame = dmx.Frame()
     for offset, value in self.getState():
         if (offset is None):
             continue
         frame[(self.address - 1) + offset] = value
     return frame
예제 #2
0
def generate_fade(start, end, secs=5.0, fps=40):
	for index in range(int(secs * fps)):
		f = dmx.Frame()
		for channel in range(len(start)):
			a = start[channel] or 0
			b = end[channel] or 0
			f[channel] = int(a + (((b - a) / (secs * fps)) * index))
		yield f
def main(config, controller=None):
    log.info("Running script %s" % __name__)
    f = dmx.Frame()
    p = packet.DmxPacket(f)
    with open('/Users/phil/Desktop/blackout-py.dmx', 'w') as f:
        f.write(p.encode())
예제 #4
0
	def __init__(self, frame=None, sequence=0, **kwargs):
		super(DmxPacket, self).__init__(**kwargs)
		from artnet import dmx
		self.sequence = sequence
		self.frame = frame or dmx.Frame()
예제 #5
0
	def parse_framedata(cls, b, fmt):
		from artnet import dmx
		return dmx.Frame([ord(x) for x in b.read('bytes:512')])