Class GestureGranularParams

java.lang.Object
net.paulhertz.pixelaudio.granular.GestureGranularParams

public final class GestureGranularParams extends Object
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:

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:

  1. resample when targetCount is greater than 1;
  2. scale duration when targetDurationMs is greater than 0;
  3. warp event times when warpShape is not GestureGranularParams.WarpShape.LINEAR.
See Also:
  • Field Details

    • timingMode

      public final GestureGranularParams.TimeTransform timingMode
      UI-oriented timing label retained for compatibility with preset and control code.

      Runtime playback uses timeTransform, targetCount, targetDurationMs, and warpShape for the actual transform decisions.

    • grainLengthSamples

      public final int grainLengthSamples
      Length of each granular grain in samples. Values passed to the builder are clamped to at least 1.
    • hopLengthSamples

      public final int hopLengthSamples
      Hop length in samples, used for fixed event timing and burst spacing.
    • burstGrains

      public final int burstGrains
      Number of grains produced for each scheduled event. Values passed to the builder are clamped to at least 1.
    • autoBurstGainComp

      public final boolean autoBurstGainComp
      True to apply automatic gain compensation when one event produces multiple burst grains.
    • gainLinear

      public final float gainLinear
      Linear gain scalar applied to each event before any per-event gain override.
    • pan

      public final float pan
      Default stereo pan in the range [-1, 1]; builder values are clamped when the object is built.
    • pitchRatio

      public final float pitchRatio
      Default playback pitch ratio. Values are clamped to a small positive minimum when built.
    • env

      public final ADSRParams env
      Envelope applied to granular voices; null lets the instrument or sampler use its default envelope.
    • looping

      public final boolean looping
      True to loop the granular source path when the lower-level voice supports looping.
    • timeTransform

      public final GestureGranularParams.TimeTransform timeTransform
      Primary timing transform label supplied by the builder.
    • targetCount

      public final int targetCount
      Target event count for resampling; values less than 2 disable resampling.
    • targetDurationMs

      public final float targetDurationMs
      Target duration in milliseconds; values less than or equal to 0 disable duration scaling.
    • warpShape

      public final GestureGranularParams.WarpShape warpShape
      Timing warp shape; GestureGranularParams.WarpShape.LINEAR disables warping.
    • warpExponent

      public final float warpExponent
      Exponent used by exponential and square-root timing warps.
    • grainWindow

      public final ddf.minim.analysis.WindowFunction grainWindow
      Grain amplitude window; null lets the director choose its default window, currently Hann.
    • hopMode

      public final GestureGranularParams.HopMode hopMode
  • Constructor Details

  • Method Details

    • builder

      public static GestureGranularParams.Builder builder()
      Creates a builder initialized with runtime defaults.
      Returns:
      a new builder
    • clampPan

      private static float clampPan(float p)