-
Notifications
You must be signed in to change notification settings - Fork 0
/
phrases-main-tables.lua
114 lines (100 loc) · 2.19 KB
/
phrases-main-tables.lua
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
return {
-- Buttons that are used in the editor as a computer-keyboard-piano, indexed by the notes they represent.
kbnames = {
"z", "s", "x", "d", "c", "v", "g", "b", "h", "n", "j", "m",
{",", "q"},
{"l", "2"},
"w", "3", "e", "r", "5", "t", "6", "y", "7", "u", "i", "9", "o", "0", "p",
},
-- Build a hashmap of keyboard-keys and MIDI-offset values for the editor
kbhash = function(names)
local hash = {}
for k, v in ipairs(names) do
if #v > 1 then
for _, vv in pairs(v) do
hash[vv] = k - 1
end
else
hash[v] = k - 1
end
end
return hash
end,
-- Table of user-readable note values, indexed appropriately
-- Pd keeps the pound sign (#) as a reserved character, and throws a fit if it has to handle them in any manner, so we'll just use flats for now.
notenames = {
"C",
"Db",
"D",
"Eb",
"E",
"F",
"Gb",
"G",
"Ab",
"A",
"Bb",
"B",
},
-- Holds the command-types that the user toggles between, and which when active are held in self.command
cmdtable = {
-2, -- Global BPM
-3, -- Global TPB
-4, -- Global GATE
-5, -- Local BPM
-6, -- Local TPB
-7, -- Local GATE
128, -- MIDI NOTE-OFF
144, -- MIDI NOTE-ON
160, -- MIDI poly-key pressure
176, -- MIDI control change
192, -- MIDI program change
208, -- MIDI mono-key pressure
224, -- MIDI pitch bend
240, -- MIDI system message
},
-- MIDI command names, condensed to fit in the GUI
cmdnames = {
"GlobalBPM",
"GlobalTPB",
"GlobalGATE",
"LocalBPM",
"LocalTPB",
"LocalGATE",
"NOTE-OFF",
"NOTE-ON",
"PolyPress",
"CtrlChange",
"ProgChange",
"MonoPress",
"PitchBend",
"System",
},
-- Table of transference direction names, to make the GUI's transference-mode friendlier
trnames = {
"Up-Left",
"Up",
"Up-Right",
"Left",
"Stationary",
"Right",
"Down-Left",
"Down",
"Down-Right",
"Persistence",
},
-- Table of MIDI-input catching modes, which are tabbed through by the user and acted upon by other code
catchtypes = {
"all",
"no-offs",
"auto-offs",
"notes",
"ignore",
},
-- Table of the various input modes, which are toggled by the user and acted upon by other code
modenames = {
"note",
"tr",
"adc",
},
}