blob: c4a56f54b9611569d2b7c77f6813c7d1ce1541b7 (
plain) (
tree)
|
|
#include "osc.h"
osc_t OSC_tri = {
.name = "w_triangle",
.start = 0,
.end = 2,
.len = 2,
};
float
tri(int index)
{
if (index == 0) return -1.0f;
else if (index == 1) return 1.0f;
else return 0.0f;
}
float
osc_tri(float offset)
{
return osc_interpolate(offset,
tri((int)offset),
tri(osc_next_index(&OSC_tri, offset)));
}
float
osc_tri_next(float f, float offset)
{
return osc_next_offset(&OSC_tri, f, offset);
}
|