if clue.touch_0: patch_index = (patch_index + 1) % patch_count midi.send( # Bank select [ ControlChange(0, 0), # MSB ControlChange(32, touch_patch[patch_index][0]), # LSB ]) midi.send(ProgramChange( touch_patch[patch_index][1])) # Program Change patch_label.text = "Patch {}".format(patch_index + 1) time.sleep(0.2) if clue.touch_1: cc_num_pick_toggle = (cc_num_pick_toggle + 1) % 3 picker_box.y = picker_box_row[cc_num_pick_toggle] time.sleep(0.1) if clue.touch_2: cc_send_toggle = not cc_send_toggle if cc_send_toggle: footer_label.x = 110 footer_label.color = SILVER footer_label.text = "sending CC" else: footer_label.x = 114 footer_label.color = ORANGE footer_label.text = "CC paused" time.sleep(0.1) print("Disconnected")
left_scroll = 3 x_pos = left_scroll right_scroll = left_scroll # if you press right on the 5-way switch... if not right.value and right_state is None: # print("scroll", down_scroll) right_state = "pressed" # track the switch's position right_scroll += 1 if right_scroll > 3: right_scroll = 0 x_pos = right_scroll left_scroll = right_scroll # update square's position on the GUI rect.y = select_y[y_pos] rect.x = select_x[x_pos] # update the currently highlighted button on the GUI for coords in switch_coordinates: if x_pos == coords[0] and y_pos == coords[1]: button_pos = switch_coordinates.index(coords) # print(button_pos) button_num = text_labels[button_pos].text # if you press select on the 5-way switch... if not select.value and select_state is None: select_state = "pressed" # grab the selected button's MIDI note midi_num = int(button_num) # change into the secondary GUI menu