Class GranularPath.GrainSpec
java.lang.Object
net.paulhertz.pixelaudio.granular.GranularPath.GrainSpec
- Enclosing class:
- GranularPath
Represents one "grain blueprint":
where to read in the source, how long, and optional per-grain parameters.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal floatPer-grain gain (linear scalar).final intGrain length in samples; if <= 0, a default grain length may be used.final longfinal floatPer-grain pan in [-1..+1], where: -1.0 = left, 0.0 = center, +1.0 = right.final floatPer-grain transposition hint.final longSample index in the source buffer where this grain is anchored (e.g., center or start). -
Constructor Summary
ConstructorsConstructorDescriptionGrainSpec(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
-
Field Details
-
sourceSampleIndex
public final long sourceSampleIndexSample index in the source buffer where this grain is anchored (e.g., center or start). -
grainLengthSamples
public final int grainLengthSamplesGrain length in samples; if <= 0, a default grain length may be used. -
pitchHint
public final float pitchHintPer-grain transposition hint. Interpretation depends on the granular engine: - semitones relative to 1.0 - or direct rate multiplier. -
gain
public final float gainPer-grain gain (linear scalar). -
pan
public final float panPer-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.
-