<commit_before>import sys

from birdfish.input.midi import MidiDispatcher
from birdfish.lights import RGBLight, Chase, LightShow
from birdfish.output.lumos_network import LumosNetwork
from birdfish import tween


# from birdfish.log_setup import logger
# logger.setLevel(10)

# create a light show - manages the updating of all lights
show = LightShow()

# Create a network - in this case, universe 3
dmx3 = LumosNetwork(3)

# add the network to the show
show.networks.append(dmx3)

# create an input interface
dispatcher = MidiDispatcher("MidiKeys")


p = Chase(name="bluechase")
elementid = 0
for i in range(1,360,3):
    elementid += 1
    l = RGBLight(
            start_channel=i,
            name="pulse_%s" % elementid,
            attack_duration=.3,
            decay_duration=0,
            release_duration=.4,
            sustain_value=1,
            )
    l.hue = .54
    l.saturation = 1
    l.update_rgb()
    l.bell_mode = True
    # l.simple = True
    # add the light to the network
    dmx3.add_element(l)
    p.elements.append(l)


p.start_pos = 12
# p.left_width = p.right_width = 10
p.speed = 1
p.moveto = p.end_pos = 65
p.continuation_mode = 'loop'
p.trigger_toggle = True

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)


# ------------------------------------------------------------------------------------------------------------------
purple_chase = Chase(
        name="purple chase",
        start_pos=12,
        end_pos=65,
        )

elementid = 0
for i in range(1,360,3):
    elementid += 1
    l = RGBLight(
            start_channel=i,
            name="pulse_%s" % elementid,
            attack_duration=.2,
            decay_duration=0,
            release_duration=0.2,
            sustain_value=1,
            )
    l.hue = .1
    l.saturation = 1
    l.update_rgb()
    # l.simple = True
    # add the light to the network
    dmx3.add_element(l)
    purple_chase.elements.append(l)

show.add_element(purple_chase)
# set the input interface to trigger the element
# midi code 70 is the "M" key on the qwerty keyboard for the midikeys app
dispatcher.add_observer((0,71), purple_chase)

 # ------------------------------------------------------------------------------------------------------------------

highlow = Chase(
        name="purple chase",
        start_pos=65,
        end_pos=12,
        )

elementid = 0
for i in range(1,360,3):
    elementid += 1
    l = RGBLight(
            start_channel=i,
            name="pulse_%s" % elementid,
            attack_duration=.2,
            decay_duration=0,
            release_duration=0.2,
            sustain_value=1,
            )
    l.hue = .1
    l.saturation = 1
    l.update_rgb()
    # l.simple = True
    # add the light to the network
    dmx3.add_element(l)
    highlow.elements.append(l)

show.add_element(highlow)
# set the input interface to trigger the element
# midi code 70 is the "l" key on the qwerty keyboard for the midikeys app
dispatcher.add_observer((0,73), highlow)

 # ------------------------------------------------------------------------------------------------------------------
follow_chase = Chase(
        name="follow chase",<commit_msg>add bell mode to reverse chase example<commit_after>import sys

from birdfish.input.midi import MidiDispatcher
from birdfish.lights import RGBLight, Chase, LightShow
from birdfish.output.lumos_network import LumosNetwork
from birdfish import tween


# from birdfish.log_setup import logger
# logger.setLevel(10)

# create a light show - manages the updating of all lights
show = LightShow()

# Create a network - in this case, universe 3
dmx3 = LumosNetwork(3)

# add the network to the show
show.networks.append(dmx3)

# create an input interface
dispatcher = MidiDispatcher("MidiKeys")


p = Chase(name="bluechase")
elementid = 0
for i in range(1,360,3):
    elementid += 1
    l = RGBLight(
            start_channel=i,
            name="pulse_%s" % elementid,
            attack_duration=.3,
            decay_duration=0,
            release_duration=.4,
            sustain_value=1,
            )
    l.hue = .54
    l.saturation = 1
    l.update_rgb()
    l.bell_mode = True
    # l.simple = True
    # add the light to the network
    dmx3.add_element(l)
    p.elements.append(l)


p.start_pos = 12
# p.left_width = p.right_width = 10
p.speed = 1
p.moveto = p.end_pos = 65
p.continuation_mode = 'loop'
p.trigger_toggle = True

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)


# ------------------------------------------------------------------------------------------------------------------
purple_chase = Chase(
        name="purple chase",
        start_pos=12,
        end_pos=65,
        )

elementid = 0
for i in range(1,360,3):
    elementid += 1
    l = RGBLight(
            start_channel=i,
            name="pulse_%s" % elementid,
            attack_duration=.2,
            decay_duration=0,
            release_duration=0.2,
            sustain_value=1,
            )
    l.hue = .1
    l.saturation = 1
    l.update_rgb()
    # l.simple = True
    # add the light to the network
    dmx3.add_element(l)
    purple_chase.elements.append(l)

show.add_element(purple_chase)
# set the input interface to trigger the element
# midi code 70 is the "M" key on the qwerty keyboard for the midikeys app
dispatcher.add_observer((0,71), purple_chase)

 # ------------------------------------------------------------------------------------------------------------------

highlow = Chase(
        name="purple chase",
        start_pos=65,
        end_pos=12,
        )

elementid = 0
for i in range(1,360,3):
    elementid += 1
    l = RGBLight(
            start_channel=i,
            name="pulse_%s" % elementid,
            attack_duration=.2,
            decay_duration=0,
            release_duration=0.2,
            sustain_value=1,
            )
    l.hue = .1
    l.saturation = 1
    l.update_rgb()
    # l.simple = True
    # add the light to the network
    dmx3.add_element(l)
    highlow.elements.append(l)

highlow.off_mode = "reverse"
highlow.bell_mode = True
show.add_element(highlow)
# set the input interface to trigger the element
# midi code 70 is the "l" key on the qwerty keyboard for the midikeys app
dispatcher.add_observer((0,73), highlow)

 # ------------------------------------------------------------------------------------------------------------------
follow_chase = Chase(
        name="follow chase",
{'fraction_non_alphanumeric': 0.18780889621087316, 'fraction_numerical': 0.02426239329039988, 'mean_word_length': 1.78134110787172, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1021311', 'n_tokens_mistral': 2127, 'n_tokens_neox': 2022, 'n_words': 545}