A newer version of Max is available. Click here to access the latest version of the Max documentation

The ParameterInfoProvider Object

The ParameterInfoProvider Object

The ParameterInfoProvider object provides a list of named Parameter objects within a patcher hierarchy, as well as information about specific Parameter objects. It can also notify when Parameter objects are added or removed from a patcher hierarchy.

ParameterInfoProvider Constructor

var pip = new ParameterInfoProvider(function);

The function argument specifies the function you want to execute to receive change notifications. The function may have a single argument, which is a ParameterInfoProviderData object.

Example:

function paramschanged(data) {
  post("something was added or removed, getting new list\n")
  if (data.added.length) {
    post(data.added.join(", ") + " added\n")
  }
  if (data.removed.length) {
    post(data.removed.join(", ") + " removed\n")
  }
}

pip = new ParameterInfoProvider(paramschanged)

ParameterInfoProvider Properties

ParameterInfoProvider Methods

getnames

Returns an Array value containing the names of Parameter objects in this patcher hierarchy.

getinfo

Arguments

parameter_name [string]

Returns a JS Object containing a variety of information about the specified Parameter, such as its type, range. The exact contents of the Object will vary depending on the type of the Parameter and will need to be enumerated. The Object always contains a property maxobject which is the Maxobj for the Max object hosting the Parameter.

var pip = new ParameterInfoProvider()
var info = pip.getinfo("live.dial") // the Parameter named 'live.dial'
// iterating the contents
for (var i in info) {
  post(i + ": " + info[i] + "\n")
}
// prints to the Max Console (for a default live.dial object)
// js: longname: live.dial
// js: shortname: live.dial
// js: scriptname: live.dial
// js: type: float
// js: visibility: automated
// js: min: 0
// js: max: 127
// js: exponent: 1
// js: maxobject: [object Maxobj]

ParameterInfoProviderData

The ParameterInfoProviderData object is the argument to your ParameterInfoProvider's function

ParameterInfoProviderData Properties

provider [ParameterInfoProvider]

g/s(get)

The ParameterInfoProvider which called the function.

added [Array]

g/s(get)

The names of any Parameters which were added.

removed [Array]

g/s(get)

The names of any Parameters which were removed.

See Also

Name Description
JavaScript Usage JavaScript Usage