Package net.paulhertz.pixelaudio.curves
package net.paulhertz.pixelaudio.curves
Package net.paulhertz.pixelaudio.curves implements light weight classes for Bezier curve modeling.
Adapted from IgnoCodeLib Processing library for use with PixelAudio library. IgnoCodeLib is available in the Processing contributed libraries and at https://paulhertz.net/ignocodelib/ and https://github.com/Ignotus-mago/IgnoCodeLib3
PAVertex2DINF.provides an interface for line and curve vertices.PALineVertexstores a line vertex Interface for line and curve verticesPABezVertexprovides storage for a cubic Bezier curves's control points and anchor point.PABezShapestores open or closed paths composed of lines and Bezier curves, and implements attributes and geometric transforms for them.PACurveMakeris a utility and storage class for interactive drawing and curve modeling.PACurveUtilityprovides static methods that support curve modeling and drawing.
-
ClassDescriptionAbstract class for combining gesture data from PACurveMaker with settings for modifying gesture data and setting audio generation parameters with GestureGranularConfig.Builder.Maps gesture points to indices into a mappingSnapshot array.Default: interpret p as pixel coordinates and mappingSnapshot as width*height raster.Class to store a path composed of lines and Bezier curves, along with fill, stroke, weight and opacity values.Provides storage for a cubic Bezier curves's control points and anchor point.PACurveMaker is a utility and storage class for gestures and curve modeling, with point reduction and drawing to on-screen PApplets or off-screen PGraphics.Simple Processing-friendly callback interface.A class to maintain static versions of point reduction and curve-modeling methods.PAGesture provides a definitional interface for "gestures": A gesture is constructed from 1) a list of points and 2) a list of time offsets where 3) both lists have the same cardinality and 4) time offsets are monotonically non-dereasing.PAGestureParametric Treats a gesture defined by (time, x, y) samples as a parametric curve: u ∈ [0,1] → (t(u), x(u), y(u)) Under the hood: - timesMs: int[] of time offsets (ms), ascending, timesMs[0] == 0 - points: PVector list (x,y) of same length You can: - sample with a linear parameter: f(u) = u - pass a warp function f(u) to speed up/slow down traversal Exponential warp (speeding up over time)
DoubleUnaryOperator expWarp = u -> (float_ Math.pow(u, 2.0); // u^2 GestureParametric.Sample s = gp.sample(0.5f, expWarp);Log-like warp (fast at start, slow at end)DoubleUnaryOperator sqrtWarp = u -> (float_ Math.sqrt(u); // GestureParametric.Sample s = gp.sample(0.5f, sqrtWarp);Something like f(u) = (e^{k * u} - 1) / (e^{k} - 1) for more dramatic warps.PAIndexParametric Parametric view of a indexed offsets, typically into a float[] buffer (audio signal).Stores a line vertex consisting of a single point.PAPathParametric Parametric view of a polyline path (e.g., polygonized Bezier).Interface for line and curve vertices.