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

counter~ Reference

counter~

counter~

Examples

Arguments

reset [auto]

Optional

A non-zero value resets the counter to zero and stops counting. A zero value starts the counter.

limit [auto]

Optional

The upper limit for counting. Values above the limit are wrapped between 0 and the limit value.

Inlets

a [auto]

A value received in the left inlet is added to the internal value every sample.

reset [auto]

A non-zero value resets the counter to zero and stops counting. A zero value starts the counter.

limit [auto]

The upper limit for counting. Values above the limit are wrapped between 0 and the limit value.

Outlets

out1 [signal]

The current value of the counter as a signal.

out2 [signal]

Outputs a signal value of 1. whenever the limit value is reached, otherwise outputs a 0.

out3 [signal]

The total number of times the counter~ object has reached the limit since the last reset, as a signal value. Sending a non-zero value to the middle inlet resets the carry count.

Fixed Attributes

These attributes must be set in the object box and determine the behavior of the object at runtime.

init [number] (default: 0)

The initial value from which to begin counting. Note that this only applies to the first count loop and only when counting is enabled at startup (reset 0), because resetting the counter~ during run time will always start counting from zero.

Dynamic Attributes

These attributes can be modified in the code during execution using the set object

a [auto]

A value received in the left inlet is added to the internal value every sample.

limit [auto]

The upper limit for counting. Values above the limit are wrapped between 0 and the limit value.

reset [auto]

A non-zero value resets the counter to zero and stops counting. A zero value starts the counter.

See Also

Name Description
accum Additive accumulator
counter~
counter keep count based on input events