-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathelements.py
39 lines (30 loc) · 1.09 KB
/
elements.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from __future__ import absolute_import, print_function, unicode_literals
from ableton.v3.control_surface import ElementsBase, MapMode
class Elements(ElementsBase):
def __init__(self, *a, **k):
super().__init__(*a, **k)
# Encoders 1-8
self.add_encoder_matrix(
[list(range(1, 10))],
"encoders",
map_mode=MapMode.Absolute,
)
self.add_submatrix(self.encoders, "Encoders_1_thru_8", columns=(0, 8))
# Encoder 9
self.add_encoder(9, "Encoder_9")
# Buttons 1-9
self.add_button_matrix(
[list(range(9, 19))],
"buttons",
)
self.add_submatrix(self.buttons, "Buttons_1_thru_8", columns=(9, 18))
# Button 9
self.add_modifier_button(18, "Button_9")
# Encoder Buttons 1-9
self.add_button_matrix(
[list(range(24, 33))],
"encoder_buttons",
)
self.add_submatrix(self.buttons, "Encoder_Buttons_1_thru_8", columns=(23, 31))
# Encoder Button 9
self.add_modifier_button(32, "Encoder_Button_9")