) dmx3.add_element(l) chase.elements.append(l) # deepcopy is used so that each element has an independent fireball effect # over time, if they shared one copy of the effect, then the fade would # be synchronized, which is not what we want fb = deepcopy(fireball) l.effects.append(fb) chase.end_pos = 70 chase.speed = 3 show.add_element(chase) # set the input interface to trigger the element # midi code 41 is the "Q" key on the qwerty keyboard for the midikeys app dispatcher.add_observer((0, 41), single) #Q dispatcher.add_observer((0, 70), chase) #J # startup the midi communication - runs in its own thread dispatcher.start() # start the show in a try block so that we can catch ^C and stop the midi # dispatcher thread try: show.run_live() except KeyboardInterrupt: # cleanup dispatcher.stop() sys.exit(0)
osc_dispatcher = OSCDispatcher(('0.0.0.0', 8998)) # create a single channel light element single = LightElement( start_channel=1, name="singletest", attack_duration=1, release_duration=1.5, ) # add the light to a network show.add_element(single, network=dmx3) # set the input interface to trigger the element # midi code 41 is the "Q" key on the qwerty keyboard for the midikeys app midi_dispatcher.add_observer((0, 41), single) osc_dispatcher.add_trigger('/elements/push2', single) # startup the midi communication - runs in its own thread midi_dispatcher.start() osc_dispatcher.start() # start the show in a try block so that we can catch ^C and stop the midi # dispatcher thread try: show.run_live() except KeyboardInterrupt: # cleanup midi_dispatcher.stop() osc_dispatcher.stop() sys.exit(0)
name="pulse_%s" % elementid, attack_duration=1, decay_duration=.8, release_duration=0, sustain_value=0, ) l.hue = random() l.saturation = 1 l.update_rgb() # l.simple = True # add the light to the network dmx3.add_element(l) p.elements.append(l) show.add_element(p) # set the input interface to trigger the element # midi code 70 is the "J" key on the qwerty keyboard for the midikeys app dispatcher.add_observer((0, 70), p) # startup the midi communication - runs in its own thread dispatcher.start() # start the show in a try block so that we can catch ^C and stop the midi # dispatcher thread try: show.run_live() except KeyboardInterrupt: # cleanup dispatcher.stop() sys.exit(0)
show.networks.append(dmx3) # create an input interface midi_dispatcher = MidiDispatcher("MidiKeys") osc_dispatcher = OSCDispatcher(("0.0.0.0", 8998)) # create a single channel light element single = LightElement(start_channel=1, name="singletest", attack_duration=1, release_duration=1.5) # add the light to a network show.add_element(single, network=dmx3) # set the input interface to trigger the element # midi code 41 is the "Q" key on the qwerty keyboard for the midikeys app midi_dispatcher.add_observer((0, 41), single) osc_dispatcher.add_trigger("/elements/push2", single) # startup the midi communication - runs in its own thread midi_dispatcher.start() osc_dispatcher.start() # start the show in a try block so that we can catch ^C and stop the midi # dispatcher thread try: show.run_live() except KeyboardInterrupt: # cleanup midi_dispatcher.stop() osc_dispatcher.stop() sys.exit(0)