Hey there,
I would like to organize everything related to the Ableton Push interaction inside of a class named PushService. However, when the decorated function is called, I need to have access to the object's properties. How can I access self property inside of that function?
Here's my class definition:
classPushService():
def__init__(self, eventQueueService: EventQueueService):
self.eventQueueService=eventQueueServiceprint("Initializing push service...")
self.push=push2_python.Push2(run_simulator=True)
# Start by setting all pad colors to whiteself.push.pads.set_all_pads_to_color('white')
@push2_python.on_pad_pressed()defon_pad_pressed(push, pad_n, pad_ij, velocity):
ifpad_ij== (7,7):
self.eventQueueService.registerBeat() # <= Here I need access to the self property to call the registerBeat function# Set pressed pad color to greenprint('Pad', pad_ij, 'pressed with velocity', velocity)
push.pads.set_pad_color(pad_ij, 'green')Thanks a lot in advance!
Hey there,
I would like to organize everything related to the Ableton Push interaction inside of a class named
PushService. However, when the decorated function is called, I need to have access to the object's properties. How can I accessselfproperty inside of that function?Here's my class definition:
Thanks a lot in advance!