Class GestureGranularParams.Builder
java.lang.Object
net.paulhertz.pixelaudio.granular.GestureGranularParams.Builder
- Enclosing class:
- GestureGranularParams
Builder for immutable
GestureGranularParams instances.
The builder performs lightweight clamping for values that must remain positive or non-negative. It does not validate musical intent; for example, a very long grain or extreme pitch ratio may be valid for a particular texture.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate intprivate ADSRParamsprivate floatprivate intprivate ddf.minim.analysis.WindowFunctionprivate intprivate GestureGranularParams.HopModeprivate booleanprivate floatprivate floatprivate intprivate floatprivate floatprivate GestureGranularParams.WarpShape -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoBurstGainComp(boolean v) Enables or disables automatic gain compensation for burst grains.build()Builds an immutable runtime parameter set.burstGrains(int v) Sets the number of grains generated for each scheduled event.env(ADSRParams v) Sets the playback envelope.gainLinear(float v) Sets the default linear gain.grainLengthSamples(int v) Sets the grain length in samples.grainWindow(ddf.minim.analysis.WindowFunction wf) Sets the grain amplitude window.hopLengthSamples(int v) Sets the hop length in samples.Sets the hop mode.looping(boolean v) Sets whether the granular source path should loop.pan(float v) Sets the default pan.pitchRatio(float v) Sets the default pitch ratio.targetCount(int v) Sets the target event count for resampling.targetDurationMs(float v) Sets the target duration in milliseconds.Sets the primary timing transform label.warpExponent(float v) Sets the timing warp exponent.Sets the timing warp shape.
-
Field Details
-
grainLengthSamples
private int grainLengthSamples -
hopLengthSamples
private int hopLengthSamples -
burstGrains
private int burstGrains -
autoBurstGainComp
private boolean autoBurstGainComp -
gainLinear
private float gainLinear -
pan
private float pan -
pitchRatio
private float pitchRatio -
env
-
looping
private boolean looping -
hopMode
-
timeTransform
-
targetCount
private int targetCount -
targetDurationMs
private float targetDurationMs -
warpShape
-
warpExponent
private float warpExponent -
grainWindow
private ddf.minim.analysis.WindowFunction grainWindow
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
grainLengthSamples
Sets the grain length in samples.- Parameters:
v- grain length; values below 1 are clamped to 1- Returns:
- this builder
-
hopLengthSamples
Sets the hop length in samples.- Parameters:
v- hop length; values below 1 are clamped to 1- Returns:
- this builder
-
burstGrains
Sets the number of grains generated for each scheduled event.- Parameters:
v- burst grain count; values below 1 are clamped to 1- Returns:
- this builder
-
autoBurstGainComp
Enables or disables automatic gain compensation for burst grains.- Parameters:
v- true to compensate gain when an event creates multiple grains- Returns:
- this builder
-
gainLinear
Sets the default linear gain.- Parameters:
v- linear gain; negative values are clamped to 0- Returns:
- this builder
-
pan
Sets the default pan.- Parameters:
v- pan value; clamped to [-1, 1] when the object is built- Returns:
- this builder
-
pitchRatio
Sets the default pitch ratio.- Parameters:
v- pitch ratio; clamped to a small positive minimum when the object is built- Returns:
- this builder
-
env
Sets the playback envelope.- Parameters:
v- envelope parameters, or null to use the instrument or sampler default- Returns:
- this builder
-
looping
Sets whether the granular source path should loop.- Parameters:
v- true to enable looping where supported- Returns:
- this builder
-
hopMode
Sets the hop mode.- Parameters:
v- hop mode- Returns:
- this builder
- Throws:
NullPointerException- ifvis null
-
timeTransform
Sets the primary timing transform label.- Parameters:
v- timing transform- Returns:
- this builder
- Throws:
NullPointerException- ifvis null
-
targetCount
Sets the target event count for resampling.- Parameters:
v- target event count; negative values are clamped to 0- Returns:
- this builder
-
targetDurationMs
Sets the target duration in milliseconds.- Parameters:
v- target duration; negative values are clamped to 0- Returns:
- this builder
-
warpShape
Sets the timing warp shape.- Parameters:
v- warp shape- Returns:
- this builder
- Throws:
NullPointerException- ifvis null
-
warpExponent
Sets the timing warp exponent.- Parameters:
v- warp exponent; clamped to a small positive minimum when the object is built- Returns:
- this builder
-
grainWindow
Sets the grain amplitude window.- Parameters:
wf- window function, or null to use the director default- Returns:
- this builder
-
build
Builds an immutable runtime parameter set.- Returns:
- a new immutable parameter set
-