Class GestureGranularConfig
java.lang.Object
net.paulhertz.pixelaudio.granular.GestureGranularConfig
End-user configuration for gesture-driven granular and sampler playback.
This class is the editable configuration model used by PixelAudio's gesture examples.
A GestureGranularConfig.Builder is convenient for GUI controls, presets, and JSON serialization; calling
GestureGranularConfig.Builder.build() creates an immutable snapshot that can be used to build a
GestureSchedule and converted to runtime synthesis parameters with toParams().
The configuration covers four related areas:
- which geometric points from a drawn gesture are selected for display to the screen
- and how those points correspond to scheduled events, controlled by
GestureGranularConfig.PathMode; - how those events are timed, resampled, duration-scaled, warped, or converted to fixed hops;
- how each event is rendered, including grain length, envelope, gain, pitch, and burst settings.
See the GesturePlayground and Bagatelle examples for live interfaces that expose these settings and show their effect on playback.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMutable builder forGestureGranularConfig.static enumSelects whether event timing follows the gesture or a fixed sample hop.static enumSelects which points from a gesture path are used to create a playback schedule.static enumDescribes the primary timing transform selected in a user interface or preset.static enumSelects the curve used to warp event timing along the gesture. -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanTrue to compensate gain automatically when one event produces multiple burst grains.final intNumber of grains created for each scheduled gesture event.final floatCurve-shaping value for Bezier control point scaling, not used for audio synthesis.final intNumber of divisions in each curve segment when polygonizing a curve path derived from a gesture.final ADSRParamsEnvelope applied to granular or sampler playback.final floatPlayback gain in decibels; converted to linear gain bygainLinear().final intLength of each granular grain in samples.final intFixed hop length in samples; meaningful whenhopModeisGestureGranularConfig.HopMode.FIXED.Timing mode for scheduled gesture events.Strategy for choosing the gesture points that become scheduled events.final floatPitch offset in semitones; converted to a playback ratio bypitchRatio().final floatSimplification tolerance used byGestureGranularConfig.PathMode.REDUCED_POINTSandGestureGranularConfig.PathMode.CURVE_POINTS.final intTarget event count forGestureGranularConfig.TimeTransform.RESAMPLED_COUNT; values below 2 mean no resampling.final intTarget gesture duration in milliseconds for duration scaling and warping; 0 means no override.User-facing timing mode for resampling, duration scaling, or warping.final booleanTrue to derive curve timing from arc length rather than point index.final floatExponent used by exponential and square-root warp shapes.Timing warp shape used when warping is enabled. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GestureGranularConfigCreates the default immutable gesture granular configuration.floatConvertsgainDbto a linear amplitude scalar.booleanReports whether this configuration is set to raw gesture timing.floatConvertspitchSemitonesto a playback speed or pitch ratio.toParams()Converts this user-facing configuration snapshot to runtime granular playback parameters.toString()Returns a multi-line summary of the current configuration snapshot.
-
Field Details
-
pathMode
Strategy for choosing the gesture points that become scheduled events. -
rdpEpsilon
public final float rdpEpsilonSimplification tolerance used byGestureGranularConfig.PathMode.REDUCED_POINTSandGestureGranularConfig.PathMode.CURVE_POINTS. -
curveSteps
public final int curveStepsNumber of divisions in each curve segment when polygonizing a curve path derived from a gesture. -
curveBias
public final float curveBiasCurve-shaping value for Bezier control point scaling, not used for audio synthesis. -
hopMode
Timing mode for scheduled gesture events. -
hopLengthSamples
public final int hopLengthSamplesFixed hop length in samples; meaningful whenhopModeisGestureGranularConfig.HopMode.FIXED. -
timingMode
User-facing timing mode for resampling, duration scaling, or warping. -
resampleCount
public final int resampleCountTarget event count forGestureGranularConfig.TimeTransform.RESAMPLED_COUNT; values below 2 mean no resampling. -
targetDurationMs
public final int targetDurationMsTarget gesture duration in milliseconds for duration scaling and warping; 0 means no override. -
warpShape
Timing warp shape used when warping is enabled. -
warpExponent
public final float warpExponentExponent used by exponential and square-root warp shapes. -
grainLengthSamples
public final int grainLengthSamplesLength of each granular grain in samples. -
env
Envelope applied to granular or sampler playback. -
gainDb
public final float gainDbPlayback gain in decibels; converted to linear gain bygainLinear(). -
pitchSemitones
public final float pitchSemitonesPitch offset in semitones; converted to a playback ratio bypitchRatio(). -
burstGrains
public final int burstGrainsNumber of grains created for each scheduled gesture event. -
autoBurstGainComp
public final boolean autoBurstGainCompTrue to compensate gain automatically when one event produces multiple burst grains. -
useArcLengthTime
public final boolean useArcLengthTimeTrue to derive curve timing from arc length rather than point index. TODO provide relevant case use in sample code, in a future release
-
-
Constructor Details
-
GestureGranularConfig
-
-
Method Details
-
defaultConfig
Creates the default immutable gesture granular configuration.- Returns:
- a configuration snapshot built from a new default builder
-
gainLinear
public float gainLinear()ConvertsgainDbto a linear amplitude scalar.- Returns:
- linear gain
-
pitchRatio
public float pitchRatio()ConvertspitchSemitonesto a playback speed or pitch ratio.- Returns:
- pitch ratio where 1.0 is untransposed playback
-
isRawGestureTiming
public boolean isRawGestureTiming()Reports whether this configuration is set to raw gesture timing.- Returns:
- true when
timingModeisGestureGranularConfig.TimeTransform.RAW_GESTURE
-
toParams
Converts this user-facing configuration snapshot to runtime granular playback parameters.Path-building settings such as
pathMode,rdpEpsilon,curveSteps, anduseArcLengthTimeare used by schedule-building code and are not represented in the returnedGestureGranularParams.- Returns:
- immutable runtime parameters for granular playback
-
toString
Returns a multi-line summary of the current configuration snapshot.
-