Page tree
Skip to end of metadata
Go to start of metadata
getAutomationIndex(element, nameOrID)

Description

Function to retrieve the index of the automation parameter to which the specified parameter is assigned.

Available in: Controller.

Arguments

elementThe Element object of the parameter to be connected.Element
nameOrIDThe ID of the parameter.number

Return Values

Returns the the index of the automation parameter to which the specified parameter is assigned, or nil if the specified parameter is not assigned.

Example

-- assign pitch octave, coarse and fine to the next free automation
zones = this.program:findZones(true)
parameters = { "Pitch.Octave", "Pitch.Coarse", "Pitch.Fine" }
for i, parameter in ipairs(parameters) do
    local automationIndex
    for j, zone in ipairs(zones) do
        assignAutomation(zone, parameter, automationIndex)
        automationIndex = getAutomationIndex(zone, parameter)
    end
end

2 Comments

  1. To Sabine Pfeifer:

    Please check if "automation parameter" is OK or should be changed to just "automation", for example.