-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisplay.py
More file actions
81 lines (70 loc) · 1.62 KB
/
display.py
File metadata and controls
81 lines (70 loc) · 1.62 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import APC_mini_custom as APC
O = 0
G = 1
g = 2
R = 3
r = 4
Y = 5
y = 6
CLEAR = [
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, 0, 0, 0, 0, 0, 0]
]
RED = [
[R, R, R, R, R, R, R, R],
[R, R, R, R, R, R, R, R],
[R, R, R, R, R, R, R, R],
[R, R, R, R, R, R, R, R],
[R, R, R, R, R, R, R, R],
[R, R, R, R, R, R, R, R],
[R, R, R, R, R, R, R, R],
[R, R, R, R, R, R, R, R]
]
JOB = [
[0, 0, 0, 0, 0, 0, 0, 0],
[0, 0, G, Y, Y, R, 0, 0],
[0, 0, G, Y, Y, R, 0, 0],
[0, 0, G, Y, Y, R, R, R],
[G, 0, G, Y, Y, R, 0, R],
[G, G, G, Y, Y, R, R, R],
[G, G, G, Y, Y, R, R, R],
[0, 0, 0, 0, 0, 0, 0, 0]
]
def clearAll (apc):
clearM(apc)
clearV(apc)
clearH(apc)
def clearM (apc):
img(apc, CLEAR)
def clearV (apc):
allV(apc, 0)
def clearH (apc):
allH(apc, 0)
def img (apc, img):
for y in range(8):
for x in range(8):
apc.really_send_midi((APC.NOTE_ON_STATUS, x+(7-y)*8 , img[y][x]))
def M (apc, x, y, color):
M(apc, x + y * 8, color)
def M (apc, i, color):
apc.really_send_midi((APC.NOTE_ON_STATUS, i, color))
def V(apc, i, color):
apc.really_send_midi((APC.NOTE_ON_STATUS, 82+i, color))
def H(apc, i, color):
apc.really_send_midi((APC.NOTE_ON_STATUS, 64+i, color))
def allV(apc, color):
for v in range(8):
V(apc, v, color)
def allH(apc, color):
for h in range(8):
H(apc, h, color)
def splash(apc):
img(apc, JOB)
allH(apc, 1)
allV(apc, 1)