Element Referencing
Functions referring to elements
element
shortname: ele
- How:
self:element_index() - What: Returns the value of the element # number.
- Example: Inputting the code
print(self:element_index())into a Code Block will output the # number of the control element into the debug field. E.g. this Code Block on the top left button will output the message0. By default all Grid configurations use this function to define a local variable namednumon each interactable event, such as a potmeter. Thisnumvariable is given value based on theself:element_index()function.
element name
shortname: gen
- How:
self:element_name("name")- "name": string, put between " " or ' ' symbols
- What: This function gives a name to the control element, or when called without parameters, it returns the name of the control element as a string. IMPORTANT: The name will only work, if it's put in the first place of the action chain.
- Example: The function
self:element_name("helloworld")in a code block, put in the top of the action chain, will name the control element helloworld.
element name send
shortname: gens
- How:
self:element_name_send() - What:
- Example:
Hardware version
How:
hardware_configuration()What: It returns a value corresponding to the module hardware version.
Example: Open System event Setup and print out the value of your Grid module. You can see the result in the MIDI monitor Debug view:
print(hardware_configuration())"GRID_MODULE_PO16_RevB": "0", "GRID_MODULE_PO16_RevC": "8", "GRID_MODULE_PO16_RevD": "1", "GRID_MODULE_BU16_RevB": "128", "GRID_MODULE_BU16_RevC": "136", "GRID_MODULE_BU16_RevD": "129", "GRID_MODULE_PBF4_RevA": "64", "GRID_MODULE_PBF4_RevD": "65", "GRID_MODULE_EN16_RevA": "192", "GRID_MODULE_EN16_RevD": "193", "GRID_MODULE_EN16_ND_RevA": "200", "GRID_MODULE_EN16_ND_RevD": "201", "GRID_MODULE_EF44_RevA": "32", "GRID_MODULE_EF44_RevD": "33", "GRID_MODULE_TEK1_RevA": "225", "GRID_MODULE_TEK2_RevA": "17", "GRID_MODULE_PB44_RevA": "145",