Skip to content

Commit

Permalink
arpegg.py: Fix voices-relaunch crash by keeping a copy of the bound m…
Browse files Browse the repository at this point in the history
…ethod object.
  • Loading branch information
dpwe committed May 28, 2024
1 parent 7c59c46 commit d031509
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tulip/shared/py/arpegg.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self, synth, channel=0):
self.arpeggiate_base_notes = set()
self.full_sequence = []
self.slot = -1
self.step_callback = self.arp_step # Ensure bound_method_obj created just once.

def note_on(self, note, vel):
if not self.active or note >= self.split_note:
Expand Down Expand Up @@ -71,7 +72,7 @@ def run(self):
self.current_step = -1
# Semaphore to the run loop to start going.
self.running = True
self.slot = tulip.seq_add_callback(self.arp_step, int(tulip.seq_ppq()/2))
self.slot = tulip.seq_add_callback(self.step_callback, int(tulip.seq_ppq()/2))

def stop(self):
self.running = False
Expand Down

0 comments on commit d031509

Please sign in to comment.