-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
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:
class PushService():
def __init__(self, eventQueueService: EventQueueService):
self.eventQueueService = eventQueueService
print("Initializing push service...")
self.push = push2_python.Push2(run_simulator=True)
# Start by setting all pad colors to white
self.push.pads.set_all_pads_to_color('white')
@push2_python.on_pad_pressed()
def on_pad_pressed(push, pad_n, pad_ij, velocity):
if pad_ij == (7,7):
self.eventQueueService.registerBeat() # <= Here I need access to the self property to call the registerBeat function
# Set pressed pad color to green
print('Pad', pad_ij, 'pressed with velocity', velocity)
push.pads.set_pad_color(pad_ij, 'green')Thanks a lot in advance!
Metadata
Metadata
Assignees
Labels
No labels