I’ve been happy with my APC40 Controller, but the more you use its functionality, you find that its default mapping just isn’t good enough, in both a production and dj live set scenario.

So, after some googling, I found remotescripts.blogspot.com who has an awesome write up on how to actually change how your APC works. What really got me going, was that Ableton’s controller interface is written in Python… Its the core language I code in every day of my life!
After checking out Ableton’s Live Object Model it was really easy to pull the code into my favorite development environment and get cracking on some modifications.
My first modification I’ve made is to keep the Ableton “red box” in view / focus if I select a scene / track with my keyboard or mouse. I just added a new function called _keep_session_in_view():
def _keep_session_in_view(self):
"""
When a select track / select scene event is triggered and that track is
outside the current session position, move it so that it remains
in view. This catches mouse or keyboard events as well as your normal
bank move buttons.
It moves the grid a session size at a time, so for the APC 40 it
moves every 8 cells to the right, and 5 to the bottom.
@note: Getting the index of the selected track and scene could probably
be improved, off hand couldn't find a helper method or property.
"""
try:
selected_track = self.song().view.selected_track
selected_scene = self.song().view.selected_scene
track_index = 0
for track in self.song().tracks:
if track == selected_track:
break
track_index += 1
scene_index = 0
for scene in self.song().scenes:
if scene == selected_scene:
break
scene_index += 1
x = 0
y = 0
while (x < track_index + 1 - self._session.width()):
x += self._session.width()
while (y < scene_index + 1 - self._session.height()):
y += self._session.height()
self._session.set_offsets(x, y)
self._session.update()
except Exception, ex:
self.log_message('Could not keep session in view: %s' % ex)
Its called from both _on_selected_scene_changed() and _on_selected_track_changed():
def _on_selected_track_changed(self):
self.log_message('on_selected_track_changed called...')
ControlSurface._on_selected_track_changed(self)
track = self.song().view.selected_track
device_to_select = track.view.selected_device
self._keep_session_in_view()
if device_to_select == None and len(track.devices) > 0:
device_to_select = track.devices[0]
if device_to_select != None:
self.song().view.select_device(device_to_select)
self._device_component.set_device(device_to_select)
return None
def _on_selected_scene_changed(self):
ControlSurface._on_selected_scene_changed(self)
self._keep_session_in_view()
You can download the Gravity South APC40 script here, and copy it to your Ableton MIDI Remote Scripts folder.