pp

Define a plug-in parameter

Description

Note: plug-in building for hosts other than Ableton Live is no longer supported. For more information to help you make the transition to creating plug-ins in Max for Live, see Max for Live for Pluggo Developers.

The pp object (an abbreviation for plug-in parameter) defines plug-in parameters. It has a number of optional arguments that let you define the parameter minimum and maximum, hide the parameter from display, set the color of the egg slider associated with it, etc. You connect the output of the pp object to something you want to control with a stored parameter. If your plug-in will use a Max patcher interface, you need to connect the interface element that will change the parameter's value to the inlet of the pp object. The pp object will send new parameter values out its outlet at various times: when you move an egg slider, when the user switches to a new effect program, and when the host mixer is automating the parameter changes of your plug-in.

Internally, the pp object and the runtime plug-in environment store values between 0 and 1.0. By giving the pp object optional arguments for minimum and maximum, you can store and receive any range of values and the object will convert between the range you want and the internal representation. If for some reason you want to know the internal 0-1.0 representation, you can get it from the object's right outlet. If you want to send a value that is based on the internal 0-1.0 representation, use the rawfloat message.

Arguments

Name Type Opt Description
The pp object takes a number of arguments. They are listed in the order that they need to appear.
int int Obligatory. The first argument sets the parameter number. The first parameter is 1. Parameter numbers should be consecutive (but they need not be), and two pp objects should not have the same parameter number. An error will be reported in the Messages view of the runtime plug-in environment if duplicate parameter numbers are encountered.
hidden symbol opt If the word hidden appears as an argument, the parameter will not be given an egg slider in the plug-in edit window and will not appear in the pop-up menu generated by the plugmod object.
fixed symbol opt If the word fixed appears as an argument, the parameter will not be affected by the Randomize and Evolve commands in the parameter pop-up menu available in the plug-in edit window when the user holds down the command key and clicks in the interface. This is appropriate for gain parameters, where randomization usually produces irritating results.
c2 symbol - c5 Optional. If c2, c3, c4,or c5 appears as argument, the color of the egg slider is set to something other than the usual purple. Currently c2 is Wild Cherry, c3 is Turquoise, c4 is Harvest Gold, and c5 is Peaceful Orange.
symbol symbol opt The next symbol after any of the optional keywords names the parameter. This name appears in the Name column of the Parameters view and in the pop-up menu generated by the plugmod object.
float or int float or int opt After the parameter name, a number sets the minimum value of the parameter. The minimum and maximum values determine the range of values that are sent into and out of the pp object's outlets, as well as the displayed value in the Parameters view. The type of the minimum value determines the type of the parameter values the object accepts and outputs. If the minimum value is an integer, the parameters will interpreted and output as integers. If the minimum value is a float, the parameters will be interpreted and output as floats.
float or int float or int opt After the minimum value, a number sets the maximum value of the parameter. The minimum and maximum values determine the range of values that are sent into and out of the pp object's outlets, as well as the displayed value in the Parameters view.
symbol symbol opt After the minimum and maximum values, a symbol sets the label used to display the units of the parameter. Examples include Hz for frequency, dB for amplitude, and ms for milliseconds.
choices symbol opt If the word choices appears after the minimum and maximum values, subsequent symbol arguments are taken as a list of discrete settings for the object and are displayed as such in the Parameters view. As an example pp 1 Mode 0 3 choices Thin Medium Fat would divide the parameter space into three values. 0 (anything less than 0.33) would correspond to Thin, 0.5 (and anything between 0.33 and 0.67) would correspond to Medium, and 1 (and anything between 0.67 and 1.0) would correspond to Fat. Only the name of the choice, rather than the actual value of the parameter, is displayed in the Parameters view.
db symbol opt If the word choices does not appear as argument, the word db (all lower-case) can be used to specify that the value of the parameter be displayed in decibel notation, where 1.0 is 0 dB and 0.0 is negative infinity dB. Caution: be careful that you don't use this in place of the symbol "dB" (with an upper-case B) given for the parameter name to be displayed in the Name column the Parameters view. (see symbol message, above.)

Messages

bang Sends the current value of the parameter out the object's right outlet in its internal (unscaled) form between 0 and 1.0, then out the object's left outlet scaled by the object's minimum and maximum.
int parameter number [int]
In right inlet: Sets the current value of the parameter without any output. The incoming number is constrained between the minimum and maximum values of the object.
float parameter value [float]
In right inlet: Sets the current value of the parameter without any output. The incoming number is constrained between the minimum and maximum values of the object.
disable parameter number [int]
The word disable, followed by a number that specifies a parameter, disables the parameter and causes the plug-in's eggslider to be visually disabled (i.e. clicking on it is disabled).
indicator parameter number [int]
The word indicator, followed by a number that specifies a parameter, causes the plug-in's eggslider to be visually disabled.
poke parameter number parameter setting (0. - 1.0) [float]
The word poke, followed by a number that specifies a parameter and a value, sets the parameter value.
rawfloat parameter value [float]
The word rawfloat, followed by a number between 0 and 1.0 sets the current parameter value to the number without scaling it by the object's minimum and maximum. The value is then send out the right and left outlets of the object as described above for the bang message.
text text to be displayed [symbol]
The word text, followed by a single symbol, allows you to set the text displayed in the Parameters view of the plug-in edit window when the user moves the mouse over the egg slider corresponding to the parameter.
set parameter number parameter setting (0. - 1.0) [list]
The word set, followed by a number that specifies a parameter and a floating point value between 0. and 1.0, sets a value for the specified parameter without causing any output.

Attributes

Name Type g/s Description
sendto symbol Sets up a forward object for remote sending of parameters.

Information for box attributes common to all objects

Output

float: Out left outlet: The scaled value of the parameter is output when it is changed within the runtime environment or when a bang, int, float, or rawfloat message is received in the object's inlet. The parameter value can be changed in the runtime environment in the following ways: the user moves an egg slider, the parameter is being automated by the host mixer, or the user has selected a new effect program for the plug-in within the host mixer.
float: Out right outlet: The unscaled value of the parameter is output when it is changed by the runtime environment or when a bang, int, float, or rawfloat message is received in the object's inlet. You might use this value if you want to use a different value in your plug-in's computation than you display to the user.
int: Out left outlet: The scaled value of the parameter is output when it is changed within the runtime environment or when a bang, int, float, or rawfloat message is received in the object's inlet. The parameter value can be changed in the runtime environment in the following ways: the user moves an egg slider, the parameter is being automated by the host mixer, or the user has selected a new effect program for the plug-in within the host mixer.

Examples

See Also

Name Description
plugmultiparam Define an array of plug-in parameters
plugstore Store multiple plug-in parameter values