Class GranularPath.GrainSpec

java.lang.Object
net.paulhertz.pixelaudio.granular.GranularPath.GrainSpec
Enclosing class:
GranularPath

public static final class GranularPath.GrainSpec extends Object
Represents one "grain blueprint": where to read in the source, how long, and optional per-grain parameters.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final float
    Per-grain gain (linear scalar).
    final int
    Grain length in samples; if <= 0, a default grain length may be used.
    final long
     
    final float
    Per-grain pan in [-1..+1], where: -1.0 = left, 0.0 = center, +1.0 = right.
    final float
    Per-grain transposition hint.
    final long
    Sample index in the source buffer where this grain is anchored (e.g., center or start).
  • Constructor Summary

    Constructors
    Constructor
    Description
    GrainSpec(long sourceSampleIndex, int grainLengthSamples, float pitchHint, float gain, float pan)
    Convenience for FIXED_HOP paths that don't care about offsets.
    GrainSpec(long sourceSampleIndex, int grainLengthSamples, float pitchHint, float gain, float pan, long offsetSamples)
     
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • sourceSampleIndex

      public final long sourceSampleIndex
      Sample index in the source buffer where this grain is anchored (e.g., center or start).
    • grainLengthSamples

      public final int grainLengthSamples
      Grain length in samples; if <= 0, a default grain length may be used.
    • pitchHint

      public final float pitchHint
      Per-grain transposition hint. Interpretation depends on the granular engine: - semitones relative to 1.0 - or direct rate multiplier.
    • gain

      public final float gain
      Per-grain gain (linear scalar).
    • pan

      public final float pan
      Per-grain pan in [-1..+1], where: -1.0 = left, 0.0 = center, +1.0 = right. Engines may ignore this if they don't support per-grain pan.
    • offsetSamples

      public final long offsetSamples
  • Constructor Details

    • GrainSpec

      public GrainSpec(long sourceSampleIndex, int grainLengthSamples, float pitchHint, float gain, float pan, long offsetSamples)
    • GrainSpec

      public GrainSpec(long sourceSampleIndex, int grainLengthSamples, float pitchHint, float gain, float pan)
      Convenience for FIXED_HOP paths that don't care about offsets.