SetFader(handle, {[number], [boolean], [string]})

grandMA3 ユーザマニュアル » プラグイン » Lua 関数 - Object-Free API » SetFader(handle, {[number], [boolean], [string]})
Version 2.1

説明

The SetFader function sets a fader to a specified level. It must be used on an object that has faders.

引数

  • handle:
    The function takes a handle of the type "light_userdata" as an argument.
    It can be omitted when using the colon notation on an object.

    The Colon Notation is a way to omit the handle as the first argument when using the Object functions.

    This is the general syntax with the colon notation: object:function()

    This is the general syntax with standard handle notation: object.function(object)

    Learn more in the Lua Functions - Object API topic.

  • table:
    The table can contain up to three named elements using the key/value methods.
    • "value":
      This is a float number indicating the fader position on a scale from 0 to 100. This should always be part of the table.
    • "token":
      This is a string indicating the fader. The string must start with "Fader". It can be omitted, and then the value will be assigned to the Master fader. The fader name must be valid for the object being used. Possible tokens include:
      • "FaderMaster"
      • "FaderX"
      • "FaderXA"
      • "FaderXB"
      • "FaderTemp"
      • "FaderRate"
      • "FaderSpeed"
      • "FaderHighlight"
      • "FaderLowlight"
      • "FaderTime"
      • "FaderSolo"
    • "faderEnabled":
      If the fader can be toggled, then this boolean can be used to enable or disable the fader. A true value sets the fader to enabled.

戻り値

この関数は何も返しません。

This example changes the selected sequences' Master fader to 100% and the Time fader to 5 seconds and enables the time fader.

Lua
return function()
-- SelectedSequence() creates a handle to the selected sequence.
local selectedSequence = SelectedSequence()
-- Set the master fader to 100. The FaderMaster is the default token, so it can be omitted.
selectedSequence:SetFader({value=100.0})
-- Set the time fader to 5 seconds and enable the fader.
selectedSequence:SetFader({value=50.0, faderEnabled=1, token="FaderTime"})
end