count

Files: count.h, count.c

Trigger-based fixed counter
The signal output will count from 0 to [N-1], and then repeat itself. Count will start when it has been triggered, otherwise it will be -1.

Functions

sp_count_create(sp_count **count)
sp_count_init(sp_data *sp, sp_count *count)
sp_count_compute(sp_data *sp, sp_count *count, SPFLOAT *trig, SPFLOAT *out)
sp_count_destroy(sp_count **count)

Optional Parameters

count: Number to count up to (count - 1). Decimal points will be truncated.
(Default value: 4)
mode: Counting mode. 0 = wrap-around, 1 = count up to N -1, then stop and spit out -1
(Default value: 0)

Inputs

trig: When non-zero, this value will increment.

Outputs

out: Signal output.

Example Code

#include "soundpipe"

int main() {
    /* TODO */
    return 0;
}