Methods
findSlots
Description
Function to find the slots of the plug-in instance. Before calling this function you must access the Instance object with this.program.instance
. The function returns an array with the Slot objects of the found slots. Particular slots can be searched by name or through a filter function. If searching by name, findSlots accepts only the Slot objects that match the specified name. The filter function uses the Slot object of each slot as argument. Only those Slot objects that return true
for the search criteria defined in the filter function will be accepted by findSlots. Without a name or filter function the Slot objects of all slots in the instance will be returned.
Available in: Controller, Processor.
Arguments
nameOrFilterFunction | The name of the slots searched for or a filter function. Only the Slot objects that match the name or return true for the search criteria of the filter function will be accepted. Set this to nil to deactivate any name filter or search criteria. | string or function, optional |
---|
Return Values
Returns an array with the Slot objects of the found slots. Returns an empty table if no slots are found.
Example
-- print the names of all slots slots = this.program.instance:findSlots() for i, slot in ipairs(slots) do print(slot.name) end
getSlot
Description
Function to retrieve the Slot object of a slot of the plug-in instance. Before calling this function you must access the Instance object with this.program.instance
. A particular slot can be searched by name or index. The index equals the slot numbering in the Slot Rack. If no argument is set, the function returns the first slot it finds.
Available in: Controller, Processor
Arguments
nameOrIndex | The name or index of the slot. Set this to nil to deactivate the search filter. | string or number, optional |
---|
Return Values
Returns the Slot object of the found slot. Returns nil
if no slot is found.
Example
-- print the name of slot index 3 slot = this.program.instance:getSlot(3) print(slot.name)
getProgramInBank