Interface PASource
- All Superinterfaces:
PAFloatSource
- All Known Implementing Classes:
PABurstGranularSource
PASource extends PAFloatSource with PixelAudio-specific hooks that voices
and instruments may use when preparing playback: pitch-policy hints, optional seeking,
optional grain-window configuration, and optional access to an underlying Minim
MultiChannelBuffer.
The current granular synthesis chain is:
PAGranularInstrumentDirector -> PAGranularInstrument ->
PAGranularSampler -> PAGranularVoice -> PASource
PABurstGranularSource is the primary implementation used by the granular
instrument director. Other implementations may represent plain buffers, streams, or
procedural sources as long as they satisfy the PAFloatSource rendering contract.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ddf.minim.MultiChannelBufferReturns the underlying Minim buffer when this source is backed by one.default PitchPolicyReturns a hint describing how an instrument should combine its pitch control with this source.default voidseekTo(long absoluteSample) Optional seek or rewind hook.default voidsetGrainWindow(ddf.minim.analysis.WindowFunction wf, int grainLenSamples) Optionally sets a grain amplitude window for sources that render windowed grains.Methods inherited from interface net.paulhertz.pixelaudio.granular.PAFloatSource
lengthSamples, renderBlock
-
Method Details
-
pitchPolicy
Returns a hint describing how an instrument should combine its pitch control with this source.The default,
PitchPolicy.INSTRUMENT_RATE, means the instrument may apply its playback-rate pitch control on top of the source. Sources that already control pitch or time internally may override this method.- Returns:
- pitch policy for this source
-
seekTo
default void seekTo(long absoluteSample) Optional seek or rewind hook.Voices call this method when a source is activated so the source can establish its playback origin. The default implementation does nothing, which is appropriate for sources that do not maintain seekable state.
- Parameters:
absoluteSample- absolute sample index to seek to
-
setGrainWindow
default void setGrainWindow(ddf.minim.analysis.WindowFunction wf, int grainLenSamples) Optionally sets a grain amplitude window for sources that render windowed grains.The default implementation does nothing. Implementations that support external grain windows may cache or precompute a window curve for the supplied grain length. The Minim library supplies several windows and a model for creating your own.
- Parameters:
wf- window function to apply, or null to keep the source defaultgrainLenSamples- grain length in samples- See Also:
-
getMultiChannelBuffer
default ddf.minim.MultiChannelBuffer getMultiChannelBuffer()Returns the underlying Minim buffer when this source is backed by one.Implementations that are not backed by a fixed
MultiChannelBuffer, such as true streams or procedural sources, should return null.- Returns:
- the backing buffer, or null if no fixed buffer is available
-