summaryrefslogblamecommitdiffstats
path: root/src/osc_weird.c
blob: 143cc23d935e57b08b27386c1a096728c0b9fed9 (plain) (tree)
























                                                                            
#include "osc.h"

float osc_weird_fun(int index)
{
  return ((float)(index * index * index) / (200 * 200 * 200)) * 2 - 1;
}

osc_t OSC_weird = {
  .name = "f_weird",
  .len = 200
};

float
osc_weird(float offset)
{
  return osc_interpolate(offset,
                         osc_weird_fun((int)offset),
                         osc_weird_fun(osc_next_index(&OSC_weird, offset)));
}

float
osc_weird_next(float f, float offset)
{
  return osc_next_offset(&OSC_weird, f, offset);
}