-
Notifications
You must be signed in to change notification settings - Fork 1
/
devices.py
140 lines (134 loc) · 3.37 KB
/
devices.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
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
"""
Device list lookup and other information for MUSYSim.
"""
full_devices = {
'O1': {
'number': 1,
'group': 'Oscillators',
'description': 'Oscillator 1',
'information_source': 'inferred from O2',
'arguments': {
'pitch': {
'bits': 6
}
}
},
'O2': {
'number': 2,
'group': 'Oscillators',
'description': 'Oscillator 2',
'information_source': 'Grogono, 1973, p.377',
'arguments': {
'pitch': {
'bits': 6
}
}
},
'O3': {
'number': 3,
'group': 'Oscillators',
'description': 'Oscillator 3',
'information_source': 'inferred from O2',
'arguments': {
'pitch': {
'bits': 6
}
}
},
'K1': {
'number': 8,
'group': 'Oscillators',
'description': 'Frequency Oscillator 1',
'information_source': 'Grogono, 1973, p.378',
'arguments': {
'frequency': {
'units': 'Hz',
'bits': 12
}
}
},
'L1': {
'number': 12,
'group': 'Amplifiers',
'description': 'Loudness amplifier 1',
'information_source': 'inferred from L2',
},
'L2': {
'number': 13,
'group': 'Amplifiers',
'description': 'Loudness amplifier 2',
'information_source': 'Grogono, 1973, p.377',
},
'L3': {
'number': 14,
'group': 'Amplifiers',
'description': 'Loudness amplifier 3',
'information_source': 'inferred from L2',
},
'A1': {
'number': 12,
'group': 'Amplifiers',
'description': 'Gain amplifier 1',
'information_source': '',
},
'A2': {
'number': 13,
'group': 'Amplifiers',
'description': 'Gain amplifier 2',
'information_source': '',
},
'E1': {
'number': 24,
'group': 'Envelope shapers',
'description': 'Envelope shaper 1',
'information_source': '',
},
'E2': {
'number': 25,
'group': 'Envelope shapers',
'description': 'Envelope shaper 2',
'information_source': '',
},
'E3': {
'number': 26,
'group': 'Envelope shapers',
'description': 'Envelope shaper 3',
'information_source': '',
},
'T1': {
'number': 60,
'group': 'Timers',
'description': 'Timer 1: Wait timer',
'information_source': 'Grogono, 1973, p.377',
'arguments': {
'wait': {
'units': 'interrupts',
'bits': 6
}
}
},
'T2': {
'number': 61,
'group': 'Timers',
'description': 'Timer 2',
'information_source': 'inferred from T1 and T3',
},
'T3': {
'number': 62,
'group': 'Timers',
'description': 'Timer 3: HW clock interrupt, 0.25Hz – 16KHz',
'information_source': 'Grogono, 1973, p.377',
'arguments': {
'rate': {
'units': 'interrupts / second',
'bits': 6
}
}
},
}
devices = {k: v['number'] for k, v in full_devices.items()}
def get_device(n):
# TODO: something efficient...
for k, v in full_devices.items():
if v['number'] == n:
return v