def main( ramp_start=START, ramp_end=START + RISE, ramp_seconds=RISE * 60, feel=90, speed=30, seq_min=-20, seq_max=20, seq_step=2, step_seconds=5, ): ramp = Ramp(ramp_start, ramp_end, ramp_seconds) seq = Sequence(min_value=seq_min, max_value=seq_max, step=seq_step) with commander() as cmd: cmd.set_mode(Mode.PULSE) cmd.set_power('H') cmd.set_speed(speed) cmd.set_feel(feel) while True: level = ramp.get_value() level += max(seq.get_value(), 0) cmd.set_level('A', level) sleep(step_seconds)
def main( ramp_start=START, ramp_end=START + RISE, ramp_seconds=RISE * 60, speed=71, feel_min=20, feel_max=90, active_seconds=10, inactive_seconds_min=5, inactive_seconds_max=15, ): ramp = Ramp(ramp_start, ramp_end, ramp_seconds) with commander() as cmd: cmd.set_power('H') cmd.set_mode(Mode.TRAINING) cmd.set_speed(speed) while True: # 35 + (-5..5) = 30..40 feel = randint(feel_min, feel_max) cmd.set_feel(feel) level = ramp.get_value() + fate_dice(5) cmd.set_level('A', level) logger.info('Sleeping in active cycle for %d seconds', active_seconds) sleep(active_seconds) cmd.set_level('A', 0) inactive_seconds = randint(inactive_seconds_min, inactive_seconds_max) logger.info('Sleeping in inactive cycle for %d seconds', inactive_seconds) sleep(inactive_seconds)
def main( ramp_start=START, ramp_end=START + RISE, ramp_seconds=RISE * 60, feel=90, osc_multiplier=3, active_seceonds=2, inactive_seconds_min=2, inactive_seconds_max=10, ): ramp = Ramp(ramp_start, ramp_end, ramp_seconds) seq = Sequence() time_osc = Oscillator(inactive_seconds_min, inactive_seconds_max, 120) with commander() as cmd: cmd.set_power('H') cmd.set_mode(Mode.CONTINUOUS) cmd.set_feel(feel) while True: base_level = ramp.get_value() + osc_multiplier * seq.get_value() cmd.set_level('A', base_level) sleep(active_seceonds) cmd.set_level('A', 0) # inactive_seconds = randint(inactive_seconds_min, inactive_seconds_max) inactive_seconds = time_osc.get_value() sleep(inactive_seconds)
def main( ramp_start=START, ramp_end=START + RISE, ramp_seconds=RISE * 60, warn_adjustment=2, feel=80, warn_seconds=3, bang_adjustment_min=10, bang_adjustment_max=20, active_seconds=1, inactive_seconds_min=10, inactive_seconds_max=30, ): ramp = Ramp(ramp_start, ramp_end, ramp_seconds) seq = Sequence() time_osc = Oscillator(inactive_seconds_min, inactive_seconds_max, 120) bang_adjustment = bang_adjustment_min with commander() as cmd: cmd.set_mode(Mode.CONTINUOUS) cmd.set_power('H') cmd.set_feel(feel) while True: active_level = ramp.get_value() warn_level = active_level // warn_adjustment if randint(1, 6) == 1: # bang active_level += bang_adjustment bang_adjustment = min(bang_adjustment + 1, bang_adjustment_max) cmd.set_level('A', warn_level) sleep(warn_seconds) cmd.set_level('A', active_level) sleep(active_seconds) cmd.set_level('A', 0) # inactive_seconds = randint(inactive_seconds_min, inactive_seconds_max) inactive_seconds = time_osc.get_value() sleep(inactive_seconds)
def main( ramp_start=40, ramp_end=60, ramp_seconds=20*60, short_ramp_rounds=20, short_ramp_multiplier=2, speed=40, feel=80, ): ramp = Ramp(ramp_start, ramp_end, ramp_seconds) with commander() as cmd: cmd.set_mode(Mode.PULSE) cmd.set_feel(feel) cmd.set_speed(speed) while True: base_value = ramp.get_value() for short_ramp_adjustment in range(short_ramp_rounds): cmd.set_level('A', base_value + short_ramp_adjustment * short_ramp_multiplier) cmd.set_level('A', 0)
def main( level=25, feel=80, active_seconds=2, ): with commander() as cmd: cmd.set_mode(Mode.CONTINUOUS) cmd.set_feel(feel) while True: cmd.set_level('A', level) sleep(active_seconds) cmd.set_level('A', 0) line = input() new_level = 0 try: new_level = int(line) except ValueError: pass if 1 <= new_level <= 100: level = new_level
def main( ramp_start=START, ramp_end=START + RISE, ramp_seconds=RISE * 60, feel=80, speed=65, osc_max=10, osc_period_seconds=120, step_seconds=5, ): ramp = Ramp(ramp_start, ramp_end, ramp_seconds) osc = Oscillator(0, osc_max, osc_period_seconds) with commander() as cmd: cmd.set_mode(Mode.WATERFALL) cmd.set_power('H') cmd.set_speed(speed) cmd.set_feel(feel) while True: base_level = ramp.get_value() + osc.get_value() cmd.set_level('A', base_level) sleep(step_seconds)
def main( ramp_start=25, ramp_end=100, warn_adjustment=2, feel=80, warn_seconds=3, active_seconds=1, inactive_seconds=10, ): with commander() as cmd: cmd.set_power('H') cmd.set_mode(Mode.CONTINUOUS) cmd.set_feel(feel) for base_level in range(ramp_start, ramp_end + 1): warn_level = base_level // warn_adjustment cmd.set_level('A', warn_level) sleep(warn_seconds) cmd.set_level('A', base_level) sleep(active_seconds) cmd.set_level('A', 0) sleep(inactive_seconds)
def main( ramp_start=START, ramp_end=START + RISE, ramp_seconds=RISE * 60, warn_adjustment=10, feel=80, speed=90, warn_seconds=3, osc_multiplier=2, active_seconds=5, inactive_seconds_min=5, inactive_seconds_max=15, ): ramp = Ramp(ramp_start, ramp_end, ramp_seconds) seq = Sequence() time_osc = Oscillator(inactive_seconds_min, inactive_seconds_max, 120) with commander() as cmd: cmd.set_power('H') cmd.set_mode(Mode.PULSE) cmd.set_feel(feel) cmd.set_speed(speed) while True: base_level = ramp.get_value() + osc_multiplier * seq.get_value() warn_level = base_level - warn_adjustment cmd.set_level('A', warn_level) sleep(warn_seconds) cmd.set_level('A', base_level) sleep(active_seconds) cmd.set_level('A', 0) # inactive_seconds = randint(inactive_seconds_min, inactive_seconds_max) inactive_seconds = time_osc.get_value() sleep(inactive_seconds)