Skip to content

Commit 3ddedee

Browse files
first commit
0 parents  commit 3ddedee

20 files changed

+3648
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.DS_Store

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Ableton live files are just gzipped xml files. This is an attempt at writing a python script that extracts the automation information and returns a nice JSON object with each curve mapped to it's (track, clip, parameter) tuple, with a special clip-ID used to specify session-view automation.
2+
3+
Also includes a dummy max for live device as a template for making devices with custom named knobs. This combines well with the "OSC Send" device in the Max For Live Connection Kit pack for sending realtime OSC automation via Ableton.
4+
5+
very not finished atm.

extractAutomation.py

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import gzip
2+
import sys
3+
import xml.etree.ElementTree as ET
4+
5+
6+
als_xml = gzip.open('p5Control.als').read()
7+
tree = ET.fromstring(als_xml)
8+
9+
def getClipsForTrack(trackNumber):
10+
trackNum = trackNumber #maybe make this track name instead?
11+
track = tree[0].find("Tracks").findall("MidiTrack")[trackNum]
12+
clipSlots = track.find("DeviceChain").find("MainSequencer").find("ClipSlotList").findall("ClipSlot")
13+
clipval = lambda cs: cs.find("ClipSlot").find("Value").find("MidiClip")
14+
clips = [clipval(cs) for cs in clipSlots if clipval(cs) is not None]
15+
return clips
16+
17+
def getAutomationsForClip(clip):
18+
clipEnvelopes = clip.find("Envelopes").find("Envelopes").findall("ClipEnvelope")
19+
20+
return clipEnvelopes
21+
22+
clips = getClipsForTrack(0)
23+
getAutomationsForClip(clips[0])
24+
25+
26+
# FloatEvent tag holds automation events
27+
# PointeeId in ClipEnvelope refers to device param being automated
28+
# MxDFloatParameter->AutomationTarget[Id] is same id as PointeeId
29+
# MxDFloatParameter->ShortName gives displayName of the parameter

map_dummy.amxd

8.27 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 40,
6+
"metadata": {
7+
"collapsed": true
8+
},
9+
"outputs": [],
10+
"source": [
11+
"import gzip\n",
12+
"import sys \n",
13+
"import xml.etree.ElementTree as ET\n",
14+
"\n",
15+
"\n",
16+
"als_xml = gzip.open('p5Control.als').read()\n",
17+
"tree = ET.fromstring(als_xml)"
18+
]
19+
},
20+
{
21+
"cell_type": "code",
22+
"execution_count": 9,
23+
"metadata": {},
24+
"outputs": [
25+
{
26+
"data": {
27+
"text/plain": [
28+
"[('MajorVersion', '5'),\n",
29+
" ('Creator', 'Ableton Live 10.1.9'),\n",
30+
" ('SchemaChangeCount', '3'),\n",
31+
" ('MinorVersion', '10.0_377'),\n",
32+
" ('Revision', '758e3a2f6f6390598b388489d358dd799e7bb207')]"
33+
]
34+
},
35+
"execution_count": 9,
36+
"metadata": {},
37+
"output_type": "execute_result"
38+
}
39+
],
40+
"source": [
41+
"tree.items()"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 41,
47+
"metadata": {},
48+
"outputs": [],
49+
"source": [
50+
"def getClipsForTrack(trackNumber)\n",
51+
"trackNum = trackNumber #maybe make this track name instead?\n",
52+
"track = tree[0].find(\"Tracks\").findall(\"MidiTrack\")[trackNum]\n",
53+
"clipSlots = track.find(\"DeviceChain\").find(\"MainSequencer\").find(\"ClipSlotList\").findall(\"ClipSlot\")\n",
54+
"clipval = lambda cs: cs.find(\"ClipSlot\").find(\"Value\").find(\"MidiClip\")\n",
55+
"clips = [clipval(cs) for cs in clipSlots if clipval(cs) is not None]\n",
56+
"\n",
57+
"def get\n",
58+
"\n"
59+
]
60+
},
61+
{
62+
"cell_type": "code",
63+
"execution_count": 42,
64+
"metadata": {},
65+
"outputs": [
66+
{
67+
"data": {
68+
"text/plain": [
69+
"[<Element 'MidiClip' at 0x10876de10>, <Element 'MidiClip' at 0x1087867d0>]"
70+
]
71+
},
72+
"execution_count": 42,
73+
"metadata": {},
74+
"output_type": "execute_result"
75+
}
76+
],
77+
"source": [
78+
"clips"
79+
]
80+
}
81+
],
82+
"metadata": {
83+
"kernelspec": {
84+
"display_name": "Python 2",
85+
"language": "python",
86+
"name": "python2"
87+
},
88+
"language_info": {
89+
"codemirror_mode": {
90+
"name": "ipython",
91+
"version": 2
92+
},
93+
"file_extension": ".py",
94+
"mimetype": "text/x-python",
95+
"name": "python",
96+
"nbconvert_exporter": "python",
97+
"pygments_lexer": "ipython2",
98+
"version": "2.7.15"
99+
}
100+
},
101+
"nbformat": 4,
102+
"nbformat_minor": 2
103+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

p5Control Project/Icon

Whitespace-only changes.

0 commit comments

Comments
 (0)