Beispiel #1
0
def main():
    while True:
        menu.loop()
        color_handler.loop()
        midi.loop()

        for i in range(88):
            led_data = led_data_list[i]
            if led_data.value == 0:
                led_handle[i] = (led_data.hue, 1, 0)
                continue

            decay_rate_idx = _pedal_poses[0]
            if led_data.key_down:
                decay_rate_idx = 2
            if led_data.value > led_data.start_value * 0.6:
                decay_rate_idx = 3

            decay_rate = [24, 4, 1, 10][decay_rate_idx]
            led_data.value = max(0, led_data.value - decay_rate/255.0)

            if color_handler.get_global_hue():
                hue = _global_hue
            else:
                hue = led_data.hue

            led_handle[i] = (hue, led_data.sat, led_data.value)
        led_handle.show()

        sleep(0.01)
Beispiel #2
0
def main():
    menu.loop()
Beispiel #3
0
def Main():
  graph = run()
  loop(graph)