How to fix track focusing using a MIDI device in Ableton Live 10

Alessio Premoli
3 min readJan 15, 2023

--

Recently I got myself a nanoKontrol to expand my electronic live rig: it’s a simple setup — a MacBook, a small synthesizer, an audio interface, and a APC Keys MIDI controller with keys and a launchpad — but I needed more control on the single tracks, as in managing the faders and being able to solo / mute single tracks, without finger dancing on the APC Keys.

my setup is the one on the right

The freshly connected nanoKontrol had a strange behavior: when you moved one of the faders or touched one of the buttons, the focus in Ableton Live 10 changed to the track you were interacting. And that is a problem since I’ve mapped various controls on the tracks, and I coulnd’t afford to click back and refocus where I was playing. The main idea of having the nanoKontrol was to use it as a sort of mixer.

Googling the problem, I found on Reddit this nice post by u/CouchAnalysis that was pointing in the direction I needed to solve it. To my surprise, Ableton Live interacts with the various MIDI controller with Python scripts called “Remote Scripts.” Julien Bayle has an unofficial series of repositories on GitHub with all the files already embedded in the software, so you can look and hack them.

This is the process that I followed for Ableton Live 10.1: for different versions the steps should look similar.

The nanoKontrol uses the MackieControl script to work with Ableton, and the part guilty of the unwanted behavior was in the ChannelStrip.py file at row 279:

def __select_track(self):
if self.__assigned_track:
all_tracks = tuple(self.song().visible_tracks) + tuple(self.song().return_tracks)
if self.song().view.selected_track != all_tracks[self.__assigned_track_index()]:
self.song().view.selected_track = all_tracks[self.__assigned_track_index()]
elif self.application().view.is_view_visible(u'Arranger'):
if self.__assigned_track:
self.__assigned_track.view.is_collapsed = not self.__assigned_track.view.is_collapsed

The second if statement makes the currently selected track the one you have just interacted with; to fix this, simply comment the code below the if statement and replace it with a pass:

def __select_track(self):
if self.__assigned_track:
all_tracks = tuple(self.song().visible_tracks) + tuple(self.song().return_tracks)
if self.song().view.selected_track != all_tracks[self.__assigned_track_index()]:
# self.song().view.selected_track = all_tracks[self.__assigned_track_index()]
pass
elif self.application().view.is_view_visible(u'Arranger'):
if self.__assigned_track:
self.__assigned_track.view.is_collapsed = not self.__assigned_track.view.is_collapsed

I packed this script in a folder called MackieControl_PreventFaderFocus.

The next step was to make Ableton Live use this script instead of the default one. Following Ableton’s support page, you need to create a “Remote Scripts” folder within the User Library and paste the one you just packed.

the Link / MIDI panel configured with the new script

Then you fire up Live, and in Preferences > Link / MIDI, click on the Control Surface dropdown next to the nanoKontrol row and select the MackieControl_PreventFaderFocus script: this enables it and let you control your DAW without the focus problem!

I forked Julien’s repo and added the folder I described in this post: you can have a look and download it here.

Thanks to u/CouchAnalysis and Julien Bayle for their hints and files!

--

--

Alessio Premoli
0 Followers

fullstack developer ~ noises & sound art as chelidon frame ~ data sonifications ~ coding art