grandMA3 User Manual Publication

GetButton(handle)

grandMA3 User Manual » Plugins » Lua Functions - Object-Free API » GetButton(handle)
Version 2.1

Description

The GetButton Lua function returns a key-value pairs table indicating, with a boolean value, whether a button is pressed on an MA3Module.

Below the example is a table listing all the grandMA3 hardware modules and which index number matches which button on the hardware module.

Arguments

  • Handle:
    The handle for the MA3 module.

Return

  • Table:
    The returned table is a key-value pairs table with a set of 512 pairs with a boolean value. A true boolean value indicates that the button is pressed or the fader is touched. The table key is 1-indexed. 

Example

This example requests the buttons states on the master module on a grandMA3 full-size console:

Lua
return function()
--- grandMA3 full-size modules are:
--- Master Module (MM): "UsbDeviceMA3 2"
--- Fader Module Encoder (MFE): "UsbDeviceMA3 3"
--- Fader Module Crossfader (MFX): "UsbDeviceMA3 4"

-- Get a handle to the Master Module on a grandMA3 full-size.
local usbDeviceHandle = Root().UsbNotifier.MA3Modules["UsbDeviceMA3 2"]
-- Create a table with the button status.
local buttonTable = GetButton(usbDeviceHandle)
-- Check if the table is nil and then print an error.
if buttonTable == nil then
ErrPrintf("nil")
return
end
-- If the table is not nil, then print a usefull feedback about pressed buttons.
for key,value in pairs(buttonTable) do
if tostring(value) == "true" then
Printf("The button with the index " .. key .. " is pressed.")
end
end
end

Hardware Modules Button Table

This table provides a list of index numbers (0-indexed and 1-indexed). The numbers are matched with elements on the three different kinds of hardware modules. Notice that the naming here comes from the internal hardware definition and might not match exactly the print on the keys or the official name.

0-Index 1-Index

grandMA3
Master Module(MM)

grandMA3
Fader Module Encoder(MFE)
grandMA3
Fader Module Crossfader(MFX)
0 1



1 2



2 3
ENCODER_INSIDE4 EXEC_108
EXEC_108
3 4
ENCODER_OUTSIDE3 EXEC_110
EXEC_110
4 5



5 6



6 7



7 8



8 9



9 10
ENCODER_INSIDE2
EXEC_211
EXEC_211
10 11
EXEC_GrandKnob
EXEC_212
EXEC_212
11 12
MENU EXEC_213
EXEC_213
12 13

EXEC_214
EXEC_214
13 14
ENCODER_OUTSIDE2 EXEC_215
EXEC_215
14 15
ENCODER_INSIDE1

15 16
ENCODER_OUTSIDE1

16 17

EXEC_209
EXEC_209
17 18

EXEC_210
EXEC_210
18 19

EXEC_208
EXEC_208
19 20



20 21



21 22


DEF_GO
22 23

EXEC_115
EXEC_115
23 24

EXEC_114
EXEC_114
24 25

EXEC_113
EXEC_113
25 26

EXEC_112
EXEC_112
26 27

EXEC_207
EXEC_207
27 28

EXEC_206 EXEC_206
28 29

EXEC_205
EXEC_205
29 30



30 31



31 32



32 33

EXEC_105
EXEC_105
33 34
ENCODER_OUTSIDE4 EXEC_106
EXEC_106
34 35

EXEC_107
EXEC_107
35 36



36 37



37 38

EXEC_109
EXEC_109
38 39

EXEC_204
EXEC_204
39 40

EXEC_203
EXEC_203
40 41

EXEC_202
EXEC_202
41 42

EXEC_201
EXEC_201
42 43


EXEC_XFade2Btn
43 44


DEF_PAUSE
44 45


EXEC_XFade1Btn
45 46

EXEC_111
EXEC_111
46 47
ENCODER_OUTSIDE5
EXEC_101
EXEC_101
47 48
ENCODER_INSIDE5
EXEC_102
EXEC_102
48 49

EXEC_103
EXEC_103
49 50

EXEC_104
EXEC_104
50 51
ENCODER_INSIDE3

DEF_GOBACK
51 52



52 53



53 54



54 55



55 56



56 57



57 58



58 59

FADER_211
FADER_211
59 60

FADER_212
FADER_212
60 61

FADER_213
FADER_213
61 62

FADER_214
FADER_214
62 63

FADER_215
FADER_215
63 64


FADER_XFade1
64 65



65 66



66 67
ESC
FADER_312 (Disabled)
FADER_312 (Disabled)
67 68
CLEAR
FADER_311 (Disabled)
FADER_311 (Disabled)
68 69



69 70



70 71



71 72



72 73



73 74
HELP
FADER_413 (Disabled)
FADER_413 (Disabled)
74 75

EXEC_411
EXEC_411
75 76
GOTO
EXEC_412
EXEC_412
76 77



77 78
ALIGN
FADER_414 (Disabled)
FADER_414 (Disabled)
78 79
COPY
FADER_411 (Disabled)
FADER_411 (Disabled)
79 80
OFF
FADER_412 (Disabled)
FADER_412 (Disabled)
80 81
FULL
EXEC_415
EXEC_415
81 82

EXEC_414
EXEC_414
82 83
PLEASE
EXEC_413
EXEC_413
83 84
NUM4


84 85
NUM5


85 86
UNDO


86 87
GROUP


87 88
THRU


88 89
NUM6


89 90
NUM2


90 91



91 92
STORE


92 93
ASSIGN


93 94



94 95



95 96



96 97
AT
EXEC_312
EXEC_312
97 98
MA1
FADER_313 (Disabled)
FADER_313 (Disabled)
98 99
SLASH
EXEC_311
EXEC_311
99 100
NUM1


100 101
CUE


101 102
TIME


102 103



103 104
SEQUENCE


104 105



105 106
CHANNEL


106 107
NUM7


107 108
NUM8


108 109
NUM9


109 110
NUM3
EXEC_313
EXEC_313
110 111
MINUS
FADER_315 (Disabled)
FADER_315 (Disabled)
111 112
NUM0
FADER_314 (Disabled)
FADER_314 (Disabled)
112 113
DOT
EXEC_314 EXEC_314
113 114
IF
EXEC_315
EXEC_315
114 115
PLUS
FADER_415 (Disabled)
FADER_415 (Disabled)
115 116



116 117



117 118



118 119



119 120



120 121

FADER_209
FADER_209
121 122

FADER_210 FADER_210
122 123


FADER_XFade2
123 124



124 125



125 126



126 127



127 128



128 129



129 130



130 131

FADER_307 (Disabled)
FADER_307 (Disabled)
131 132
LEARN
FADER_306 (Disabled)
FADER_306 (Disabled)
132 133



133 134



134 135



135 136



136 137



137 138
FADER_297 (Disabled)
FADER_408 (Disabled)
FADER_408 (Disabled)
138 139
X5
EXEC_406
EXEC_406
139 140
X6
EXEC_407
EXEC_407
140 141



141 142
FADER_298 (Disabled)
FADER_409 (Disabled)
FADER_409 (Disabled)
142 143
FADER_295 (Disabled)
FADER_406 (Disabled)
FADER_406 (Disabled)
143 144
FADER_296 (Disabled)
FADER_407 (Disabled)
FADER_407 (Disabled)
144 145
GOFAST EXEC_410
EXEC_410
145 146
X13 EXEC_409
EXEC_409
146 147
X14 EXEC_408
EXEC_408
147 148



148 149



149 150



150 151



151 152



152 153



153 154
DELETE

154 155
X15

155 156
GOBACKFAST

156 157
X8

157 158



158 159



159 160



160 161
STOMP EXEC_307
EXEC_307
161 162
SELECT FADER_308 (Disabled)
FADER_308 (Disabled)
162 163

EXEC_306
EXEC_306
163 164



164 165



165 166



166 167



167 168



168 169
X16

169 170
X7

170 171



171 172
ON

172 173
MOVE

173 174
FIXTURE EXEC_308
EXEC_308
174 175
PRESET FADER_310 (Disabled)
FADER_310 (Disabled)
175 176
EDIT FADER_309 (Disabled)
FADER_309 (Disabled)
176 177
UPDATE EXEC_309
EXEC_309
177 178

EXEC_310
EXEC_310
178 179

FADER_410 (Disabled)
FADER_410 (Disabled)
179 180



180 181



181 182



182 183



183 184



184 185



185 186



186 187

FADER_203
FADER_203
187 188

FADER_204
FADER_204
188 189

FADER_205
FADER_205
189 190

FADER_206
FADER_206
190 191

FADER_207
FADER_207
191 192

FADER_208
FADER_208
192 193



193 194



194 195
PAUSE FADER_302 (Disabled)
FADER_302 (Disabled)
195 196
GOBACK FADER_301 (Disabled)
FADER_301 (Disabled)
196 197



197 198



198
199



199 200



200 201



201 202
FADER_293 (Disabled) FADER_403 (Disabled)
FADER_403 (Disabled)
202 203
SOLO EXEC_401
EXEC_401
203 204
HIGHLIGHT EXEC_402
EXEC_402
204 205



205 206
FADER_294 (Disabled) FADER_404 (Disabled)
FADER_404 (Disabled)
206 207
FADER_291 (Disabled) FADER_401 (Disabled)
FADER_401 (Disabled)
207 208
FADER_292 (Disabled) FADER_402 (Disabled)
FADER_402 (Disabled)
208 209
GO EXEC_405
EXEC_405
209 210
LIST EXEC_404 EXEC_404
210 211
PAGE_DOWN EXEC_403 EXEC_403
211 212



212 213



213 214



214 215



215 216
SELFIX

216
217
MA2


217
218



218
219
PAGE_UP


219
220
XKEYS


220
221
BLIND


221
222



222
223



223
224



224
225
X10
EXEC_302
EXEC_302
225
226
X11
FADER_303 (Disabled)
FADER_303 (Disabled)
226
227
X12
EXEC_301
EXEC_301
227
228



228
229



229
230



230
231



231
232
PREVIEW


232
233
FREEZE


233
234
DOWN


234
235
PREV


235
236
SET


236
237
UP


237
238
X1
EXEC_303
EXEC_303
238
239
X2
FADER_305 (Disabled)
FADER_305 (Disabled)
239
240
X3
FADER_304 (Disabled)
FADER_304 (Disabled)
240
241
X4
EXEC_304
EXEC_304
241
242
X9
EXEC_305
EXEC_305
242
243
NEXT
FADER_405 (Disabled)
FADER_405 (Disabled)
243
244



244
245



245
246



246
247



247
248



248
249

FADER_201
FADER_201
249
250

FADER_202
FADER_202
250
251



251
252



252
253



253
254



254
255



255
256



256
257



257
258



258
259

EXEC_RateBtn2

259
260

EXEC_ExecBtn1

260
261



261
262



262
263



263
264



264
265



265
266



266
267



267
268



268
269



269
270



270
271

EXEC_ProgEncoder

271
272

EXEC_ExecEncoder

272
273



273
274



274
275



275
276



276
277



277
278



278
279



279
280



280
281



281
282



282
283



283
284



284
285



285
286



286
287



287
288



288
289

EXEC_SpeedBtn1

289
290

EXEC_RateBtn1

290
291

EXEC_SpeedBtn2

291
292



292
293



293
294



294
295



295
296



296
297



297
298



298
299

EXEC_ProgBtn1

299
300

EXEC_ProgBtn2

300
301

EXEC_ProgBtn3

301
302



302
303



303
304



304
305

EXEC_ExecBtn3

305
306

EXEC_ExecBtn2

306
307



307
308



308
309



309
310