#include "osc.h" osc_t OSC_sqr = { .name = "f_sqr", .len = 1, .start = 0, .end = 1, }; float osc_sqr(float offset) { return offset < 0.5 ? -1 : 1; } float osc_sqr_next(float f, float offset) { return osc_next_offset(&OSC_sqr, f, offset); }