summaryrefslogblamecommitdiffstats
path: root/src/osc_sqr.c
blob: 130ede66a6bf8b4601fb5a1b0aada553dfc7b620 (plain) (tree)
1
2
3
4
5
6





                  












                                              
#include "osc.h"

osc_t OSC_sqr = {
  .name = "f_sqr",
  .len = 1,
  .start = 0,
};

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);
}