Class GestureGranularParams
java.lang.Object
net.paulhertz.pixelaudio.granular.GestureGranularParams
Immutable runtime parameters for gesture-driven granular playback.
GestureGranularParams is the DSP-facing counterpart to
GestureGranularConfig. A configuration object describes the editable, user-facing
gesture settings; this class stores the values needed by the granular playback engine after
unit conversions such as decibels to linear gain and semitones to pitch ratio.
Used by:
PAGranularInstrumentDirector, for gesture scheduling and granular source creation;PASourceimplementations, for burst and grain rendering behavior.
Not included:
- gesture path-building settings such as reduction tolerance, curve steps, and arc-length timing;
- per-event overrides such as start indices, pan, gain, and pitch arrays, which belong to
GestureEventParams.
Timing transform rules: playback transforms are value-driven and may be combined:
- resample when
targetCountis greater than 1; - scale duration when
targetDurationMsis greater than 0; - warp event times when
warpShapeis notGestureGranularParams.WarpShape.LINEAR.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for immutableGestureGranularParamsinstances.static enumSelects whether event timing follows the transformed gesture schedule or fixed sample hops.static enumDescribes the primary timing transform selected by a configuration or user interface.static enumShape used to remap normalized gesture time. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanTrue to apply automatic gain compensation when one event produces multiple burst grains.final intNumber of grains produced for each scheduled event.final ADSRParamsEnvelope applied to granular voices; null lets the instrument or sampler use its default envelope.final floatLinear gain scalar applied to each event before any per-event gain override.final intLength of each granular grain in samples.final ddf.minim.analysis.WindowFunctionGrain amplitude window; null lets the director choose its default window, currently Hann.final intHop length in samples, used for fixed event timing and burst spacing.final booleanTrue to loop the granular source path when the lower-level voice supports looping.final floatDefault stereo pan in the range [-1, 1]; builder values are clamped when the object is built.final floatDefault playback pitch ratio.final intTarget event count for resampling; values less than 2 disable resampling.final floatTarget duration in milliseconds; values less than or equal to 0 disable duration scaling.Primary timing transform label supplied by the builder.UI-oriented timing label retained for compatibility with preset and control code.final floatExponent used by exponential and square-root timing warps.Timing warp shape;GestureGranularParams.WarpShape.LINEARdisables warping. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
timingMode
UI-oriented timing label retained for compatibility with preset and control code.Runtime playback uses
timeTransform,targetCount,targetDurationMs, andwarpShapefor the actual transform decisions. -
grainLengthSamples
public final int grainLengthSamplesLength of each granular grain in samples. Values passed to the builder are clamped to at least 1. -
hopLengthSamples
public final int hopLengthSamplesHop length in samples, used for fixed event timing and burst spacing. -
burstGrains
public final int burstGrainsNumber of grains produced for each scheduled event. Values passed to the builder are clamped to at least 1. -
autoBurstGainComp
public final boolean autoBurstGainCompTrue to apply automatic gain compensation when one event produces multiple burst grains. -
gainLinear
public final float gainLinearLinear gain scalar applied to each event before any per-event gain override. -
pan
public final float panDefault stereo pan in the range [-1, 1]; builder values are clamped when the object is built. -
pitchRatio
public final float pitchRatioDefault playback pitch ratio. Values are clamped to a small positive minimum when built. -
env
Envelope applied to granular voices; null lets the instrument or sampler use its default envelope. -
looping
public final boolean loopingTrue to loop the granular source path when the lower-level voice supports looping. -
timeTransform
Primary timing transform label supplied by the builder. -
targetCount
public final int targetCountTarget event count for resampling; values less than 2 disable resampling. -
targetDurationMs
public final float targetDurationMsTarget duration in milliseconds; values less than or equal to 0 disable duration scaling. -
warpShape
Timing warp shape;GestureGranularParams.WarpShape.LINEARdisables warping. -
warpExponent
public final float warpExponentExponent used by exponential and square-root timing warps. -
grainWindow
public final ddf.minim.analysis.WindowFunction grainWindowGrain amplitude window; null lets the director choose its default window, currently Hann. -
hopMode
-
-
Constructor Details
-
GestureGranularParams
-
-
Method Details
-
builder
Creates a builder initialized with runtime defaults.- Returns:
- a new builder
-
clampPan
private static float clampPan(float p)
-