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

pv

Share variables specific to a patch and its subpatches

Description

pv operates identically to the value object, with two exceptions. First, pv objects that share the same name only share the same value if they are in the same patcher, or one of its subpatches. Second, the pv object cannot be the receiver of a message sent remotely by a message box (the first symbol after a semicolon). So, pv means private value--a value that is shared between objects, but only within a single patcher.

Arguments

Name Type Opt Description
ID-name symbol Obligatory. The first argument provides an identifying name. All pv objects with that name within the patcher will share the same value.
initialization-message symbol opt Any message typed in after the first argument initializes the stored contents of the pv object. Note that when two or more pv objects in a patcher file that share the same name are initialized to different values, the one which is initialized last determines the value. Since the order in which pv objects will be initialized cannot be precisely determined, the best practice is to initialize only one of the related pv objects.

Messages

bang Sends out the stored message.
int input [int]
Performs the same as the anything message.
float input [float]
Performs the same as the anything message.
list input [list]
Performs the same as the anything message.
anything input [list]
The message is stored, to be shared by all other pv objects of the same name that are inside the object's patcher or its subpatches (or, if in a subpatch, its parent patch). A message received in any other such pv object will change the stored message.
status Posts information about the communications between all pv objects involved in the patcher.
symbol input [symbol]
Performs the same as the anything message.

Information for box attributes common to all objects

Output

any message: When bang is received in the inlet, the stored message is sent out.

Examples

See Also

Name Description
float Store a decimal number
int Store an integer value
pvar Connect to a named object in a patcher
receive Receive messages without patch cords
send Send messages without patch cords
value Share a stored number with other objects