pv Reference

Share data within a patch hierarchy

pv

Description

Creates a value that is shared between objects, but only within a single patcher. Unlike the value object, pv objects that share the same name only share the same value if they are in the same patcher, or one of its subpatches.

Examples

Discussion

The pv also object cannot be the receiver of a message sent remotely by a message box (the first symbol after a semicolon).

Arguments

name [symbol]

Obligatory. The first argument provides an identifying name. All pv objects with that name within the patcher will share the same value.

message [anything]

Optional

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.

Attributes

Common Box Attributes

Messages

bang

Sends out the stored message.

int

Arguments

input [int]
Performs the same as the anything message.

float

Arguments

input [float]
Performs the same as the anything message.

list

Arguments

input [list]
Performs the same as the anything message.

anything

Arguments

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

Arguments

input [symbol]
Performs the same as the anything message.

Output

any message

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

See Also

Name Description
Organizing Your Patch Organizing Your Patch
float
int
pvar
receive
send
value