SuperCollider CLASSES (extension)

WrapSummer
ExtensionExtension

Pulse counter with floating point steps
Inherits from: UGen : AbstractFunction : Object

Description

WrapSummer, based on Stepper, but allowing floats as inputs, so that you can increment a sum with each step. WrapSummer differs from Summer in that it wraps around min and max values.

Class Methods

*ar (trig: 0, step: 1, min: 0, max: 1, reset: 0, resetval)

*kr (trig: 0, step: 1, min: 0, max: 1, reset: 0, resetval)

Arguments:

trig

The trigger. Trigger can be any signal. A trigger happens when the signal changes from non-positive to positive.

step

The step size. Can be a Float

min

Minimum value of the counter.

max

Maximum value of the counter.

reset

Resets the counter to resetval when triggered.

resetval

Value to which the counter is reset when it receives a reset trigger. If nil, then this is patched to min .

Inherited class methods

Instance Methods

Inherited instance methods

Examples

{SinOsc.ar(WrapSummer.kr(Impulse.kr(10), 1.5, 3, 13).poll * 100, 0, 0.1)}.play;

{SinOsc.ar(WrapSummer.kr(Impulse.kr(12), 1.33, MouseX.kr(1, 5), MouseY.kr(5, 10)) * 100, 0, 0.1)}.play;

(
{
    var trig = Dust.kr([5, 5]);
    BPF.ar(Saw.ar(WrapSummer.kr(trig, 1.0008, 1, 8) * 100, 0.2));
}.play;
)