Closed markusschloesser closed 2 years ago
I assume most of theses came when track changing from/in GUI. That was also the time, when the selected device on the C4 was not anymore the selected device in Live. IMHO this relates to https://github.com/markusschloesser/MackieC4_P3/issues/16 https://github.com/markusschloesser/MackieC4_P3/issues/53 https://github.com/markusschloesser/MackieC4_P3/issues/58
Have a look at https://github.com/markusschloesser/AbletonRemoteScriptsPY/blob/main/Push2/track_selection.py that's how Push 2 does is (relies on event object in v2 https://github.com/markusschloesser/AbletonRemoteScriptsPY/blob/main/ableton/v2/base/event.py )
So how would one start replacing the old track stuff and do it like Push does it?
From my understanding it relies on events (EventObject
)and listens (listenable_property
, ObservablePropertyAlias
) to those (coming from Live), and when "things" change, all listeners get notified (but through an intermediary (liveobj_valid
, liveobj_changed
etc) and do their thing without the need to keep track of indexes
There are two ways, at least. Starting over from scratch, building up from a clean base. The other way is to work with what you have and replace piece by piece or whatever.
I mean you could start from a blank sheet of paper, or for example, you could start with a method like "handle bank switch IDs" The "bank/page incrementing" part is all about data related to "remembering where you were", but the other part the "changing the current selected device" with the "single" buttons part. Has places where LOM data is updated and where the local data is updated. self.song().view.select_device(current_selected_device)
is making the change in Live and the rest of the code is about updating the script. These three methods do the heavy lifting
self.__chosen_plugin = current_selected_device
self.__reorder_parameters()
self.__reassign_encoder_parameters(for_display_only=False)
of updating the script "database", and then the "midi map" gets rebuilt. There isn't a lot of fat to trim.
I just found ../ableton/v2/control_surface/internal_parameter.py
This looks like exactly what we need in cases where we want to "map with feedback" without also having a "DeviceParameter" object to pass to the mapper method. We can pass a subclass or instance of InternalParameter that we create ourselves.
haven't seen this error in ages, so closing issue
after working quite a bit with the script, this keeps popping up frequently:
referring to https://github.com/markusschloesser/MackieC4_P3/blob/78e323a9f34618539afd68eac2c70aa0cd77e6b4/wip/MackieC4/MackieC4.py#L876
ToDo: either fix it, or it will be fixed with @listener stuff