-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparse.py
More file actions
executable file
·71 lines (57 loc) · 1.4 KB
/
Copy pathparse.py
File metadata and controls
executable file
·71 lines (57 loc) · 1.4 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
#!/usr/bin/env python3
import sys
ID_BYTES: dict[int, str] = {
0x01: "global settings",
0x0b: "input 1",
0x0c: "input 2",
0x0d: "input 3",
0x0e: "input 4",
0x15: "CV out 1",
0x16: "CV out 2",
0x17: "CV out 3",
0x18: "CV out 4",
0x1F: "gate out 1",
0x20: "gate out 2",
0x21: "gate out 3",
0x22: "gate out 4",
0x23: "gate out 5",
0x24: "gate out 6",
0x25: "gate out 7",
0x26: "gate out 8",
0x27: "gate out 9",
0x28: "gate out 10",
0x29: "gate out 11",
0x2A: "gate out 12",
}
COMP_BYTES: dict[int, str] = {
0x0200: "default channel",
0x0c01: "default trigger length",
}
PARAM_BYTES: dict[int, str] = {
0x01: "input/cv/gate mode",
0x02: "channel",
0x03: "minimum note",
0x04: "maximum note",
0x05: "minimum velocity",
# 0x06: "maximum velocity", ??? maybe this is valid?
0x07: "pitch bend",
0x08: "note mode",
0x0b: "tick offset",
0x0c: "trigger mode",
0x0d: "switch point",
0x0e: "transpose",
0x0f: "output range",
0x10: "voltage scheme",
}
def chunks(data, n):
"""chunks data into blocks of n size or less."""
for i in range(0, len(data), n):
yield data[i:i+n]
def read_block(block: bytes):
id = block[0]
print(bin(id))
def main():
data: bytes = sys.stdin.buffer.read()
blocks = list(chunks(data, 8))
if __name__ == "__main__":
main()