counter
new counter([options])
Options
Name | Type | Default | Description |
---|---|---|---|
init | number | 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. |
Methods
next(a, reset, limit): [out1, out2, out3]
Arguments
Name | Type | Default | Description |
---|---|---|---|
a | number | ||
reset | number | ||
limit | number |
Returns
Name | Type | Description |
---|---|---|
out1 | number | The current value of the counter as a signal. |
out2 | number | Outputs a signal value of 1. whenever the limit value is reached, otherwise outputs a 0. |
out3 | number | 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. |