Package net.paulhertz.pixelaudio.curves
Class PAIndexParametric
java.lang.Object
net.paulhertz.pixelaudio.curves.PAIndexParametric
PAIndexParametric
Parametric view of a indexed offsets, typically into a float[] buffer (audio signal).
u ∈ [0,1] → f(u)
For now, u is interpreted over the *index* of the offset list:
- u = 0 → first index
- u = 1 → last index
- intermediate u → linear interpolation between neighboring offsets
-
Field Details
-
offsets
private final int[] offsets -
count
private final int count
-
-
Constructor Details
-
PAIndexParametric
public PAIndexParametric(int[] offsets) - Parameters:
offsets- ordered offsets in a buffer must contain at least 2 offsets.
-
-
Method Details
-
getPointCount
public int getPointCount() -
sample
public int sample(float u) Sample the path at parameter u ∈ [0,1], returning an interpolated point. u is clamped to [0,1]. -
lerp
private static float lerp(int a, int b, float u)
-