Function to find busses in the specified Element object. For example, Available in: Controller, Processor. Returns an array with the Bus objects of the found busses.
Description
this.parent
specifies the parent of the script module as the Element object to be searched in. If recursive is set to true
, subelements will also be searched. The function returns an array with the Bus objects of the found busses. Particular busses can be searched by name or through a filter function. If searching by name, findBusses accepts only the Bus objects that match the specified name. The filter function uses the Bus object of each bus as argument. Only those Bus objects that return true
for the search criteria defined in the filter function will be accepted by findBusses. Without a name or filter function the Bus objects of all busses in the searched Element obects will be returned.Arguments
recursive If set to false
, only the specified Element object will be searched. If set to true
, subelements will also be searched. The default is false.
boolean nameOrFilterFunction The name of the busses searched for or a filter function. Only the Bus 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
Example
-- find all busses and print their names
busses = this.program:findBusses(true)
if busses[1] then
for i, bus in ipairs(busses) do
print(bus.name)
end
else
print("Could not find any busses!")
end
See Also: findChildren, findEffects, findLayers, findMidiModules, findSlots, findZones, Bus
3 Comments
Sabine Pfeifer
proofread done
Matthias Klag
Please reread. Thanks!
Sabine Pfeifer
proofread done