From faea3a25e1bf278b971caecbf90d3553528d2d75 Mon Sep 17 00:00:00 2001 From: Angelo Ruggieri Date: Sat, 9 Mar 2024 16:07:18 +0100 Subject: [PATCH] Update ableton.py Updated MasterTrack finder for Ableton 12 --- dawtool/daw/ableton.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dawtool/daw/ableton.py b/dawtool/daw/ableton.py index de35a69..78ceaac 100644 --- a/dawtool/daw/ableton.py +++ b/dawtool/daw/ableton.py @@ -283,9 +283,12 @@ def _parse_automation(self, contents): if self.version.minorA < 10: events = self._parse_arranger_automation_events(contents) else: - # TODO: need better code structure to manage diff Ableton version - # This only applies to Ableton 10 - master_track_chunk = self._find_tag(contents, 'MasterTrack') + if self.version.minorA in [10,11]: + # This only applies to Ableton 10 and 11 + master_track_chunk = self._find_tag(contents, 'MasterTrack') + else: + # This only applies to Ableton 12 + master_track_chunk = self._find_tag(contents, 'MainTrack') try: master_track = ET.fromstring(master_track_chunk) except ParseError: