/ HALion Developer Resource / HALion Script / Class Reference /

ParameterDefinition

The ParameterDefinition class describes the properties of parameters.


On this page:

ParameterDefinition Class, getDisplayString


Classes

ParameterDefinition Class

Description

The ParameterDefinition object describes the properties of a parameter. It has the following fields.

Available in: Controller, Processor.

Fields

FieldDescriptionValue Type
.nameReturns the name of the parameter.string
.longNameReturns the long name of the parameter.string
.idReturns the ID of the parameter.number
.typeReturns the data type of the parameter.string
.defaultReturns the default value of the parameter.number
.minReturns the minimum value of the parameter.number
.maxReturns the maximum value of the parameter.number
.readOnlyReturns true if the value of the parameter is read-only and false if it is not.boolean
.writeAlwaysReturns true if the value is always set and false if it is not. If this returns true, the parameter sends a changed message even if the actual value did not change when it was set.boolean
.automatableReturns true if the parameter can be automated and false if it cannot.boolean
.persistentReturns true if the parameter restores from the VST preset and false if it does not.boolean
.unitReturns the unit of the parameter value, for example, dB.string
-- Print the parameter definition with corresponding data type of the parent layer's level parameter.

function onLoadIntoSlot()
 
    local def = this.parent:getParameterDefinition("Level")
 
    print("Name = "..def.name..", "..type(def.name))
    print("Long Name = "..def.longName..", "..type(def.longName))
    print("ID = "..def.id..", "..type(def.id))
    print("Type = "..def.type..", "..type(def.type))
    print("Default = "..def.default..", "..type(def.default))
    print("Min = "..def.min..", "..type(def.min))
    print("Max = "..def.max..", "..type(def.max))
    print("Read Only = "..tostring(def.readOnly)..", "..type(def.readOnly))
    print("Write Always = "..tostring(def.writeAlways)..", "..type(def.writeAlways))
    print("Automatable = "..tostring(def.automatable)..", "..type(def.automatable))
    print("Persistent = "..tostring(def.persistent)..", "..type(def.persistent))
    print("Unit = "..def.unit..", "..type(def.unit).."\n")
 
end

Jump to Top

Methods

getDisplayString

getDisplayString(value)

Description

The internal precision of parameter values is usually higher than the precision of the corresponding display string on the user interface. You can use this function to obtain the display string of the specified parameter and value. You specify the parameter with getParameterDefinition.

Available in: Controller, Processor.

Arguments

ArgumentDescriptionValue Type
valueThe value for the display string.number or string

❕ The data type of the value for getDisplayString must match the data type of the corresponding parameter value.

Return Values

Returns the display string of the specified parameter and value.

Example

-- Get the display string of a value.

value = -2.471
print("value = "..value)
print("Display String = "..this.program:getParameterDefinition("Level"):getDisplayString(-2.471))

Jump to Top