def note_off(x, y, note): global note_when_pressed player.note_off(note) curr_notes.discard(note) note_when_pressed[x][y] = None lp_colors.update() print("[LPMM] NOTE " + str(note) + " OFF")
def note_on(x, y, note, velocity=127): global note_when_pressed player.note_on(note, velocity) curr_notes.add(note) note_when_pressed[x][y] = note lp_colors.update() print("[LPMM] NOTE " + str(note) + " ON, VELOCITY " + str(velocity))
def set_as_mode(): global is_active lp_events.mode = "SCALEEDIT" lp_events.unbind_all() bind_grid() bind_function_keys() lp_colors.update() is_active = True lp_instrument.is_active = False print("[LPMM] SCALE EDIT MODE")
def set_as_mode(unbind = True): global is_active lp_events.mode = "INSTRUMENT" if unbind: lp_events.unbind_all() bind_grid() bind_function_keys() lp_colors.update() is_active = True lp_scaleedit.is_active = False print("[LPMM] INSTRUMENT MODE")
def unbind_all(update_colors=True): global press_funcs global release_funcs press_funcs = [[unbound_press for y in range(9)] for x in range(9)] release_funcs = [[unbound_release for y in range(9)] for x in range(9)] for x in range(9): for y in range(9): lp_colors.setXY(x, y, lp_colors.BLACK) lp_colors.effectXY(x, y, lp_colors.BLACK) if update_colors: lp_colors.update()
def octave_set(oct_in, rebind=True): global octave octave = oct_in octave_clip() if rebind: bind_grid() lp_scaleedit.update_active() if lp_events.mode == "SCALEEDIT": lp_events.unbind_all(False) lp_scaleedit.bind_grid() lp_scaleedit.bind_function_keys() lp_colors.update() print("[LPMM] OCTAVE SET, NOW " + str(octave))
def octave_down(rebind=True): global octave octave -= 1 octave_clip() if(rebind): bind_grid() lp_scaleedit.update_active() if lp_events.mode == "SCALEEDIT": lp_events.unbind_all(False) lp_scaleedit.bind_grid() lp_scaleedit.bind_function_keys() lp_colors.update() print("[LPMM] OCTAVE DOWN, NOW " + str(octave))
def scale_set(scale_in, rebind=True, print_mesg=True): global scale scale = globals()["SCALE_" + scale_in] #haha doing this just so I can print the name of the scale... and now it takes a string like the other funcs octave_clip() if rebind: bind_grid() lp_scaleedit.update_active() if lp_events.mode == "SCALEEDIT": lp_events.unbind_all(False) lp_scaleedit.bind_grid() lp_scaleedit.bind_function_keys() lp_colors.update() if print_mesg: print("[LPMM] SCALE SET, NOW " + str(scale_in))
def mode_set(mode_in, rebind=True): global mode global octave mode = mode_in octave_clip() if rebind: bind_grid() lp_scaleedit.update_active() if lp_events.mode == "SCALEEDIT": lp_events.unbind_all(False) lp_scaleedit.bind_grid() lp_scaleedit.bind_function_keys() lp_colors.update() print("[LPMM] MODE SET, NOW " + mode)
def key_set(key_in, rebind=True, print_mesg=True): global key key = key_in octave_clip() if rebind: bind_grid() lp_scaleedit.update_active() if lp_events.mode == "SCALEEDIT": lp_events.unbind_all(False) lp_scaleedit.bind_grid() lp_scaleedit.bind_function_keys() lp_colors.update() if print_mesg: print("[LPMM] KEY SET, NOW " + key)
def off_note_and_rebind_new_note(x, y, old_note, new_note, off_note = True): if off_note: lp_midi.note_off(x, y, old_note) lp_colors.update() lp_midi.bind_button_to_note(x, y, new_note)