Package net.paulhertz.pixelaudio.sampler
package net.paulhertz.pixelaudio.sampler
Digital audio sampling synthesis classes for PixelAudio.
PixelAudio's sampler engine follows the chain
PASamplerInstrumentPoolMulti -> PASamplerInstrumentPool ->
PASamplerInstrument -> PASharedBufferSampler -> PASamplerVoice. Small sketches may
use PASamplerInstrument
directly, while larger gesture-driven sketches can route playback through one or more
instrument pools.
The package provides shared-buffer sample playback, polyphonic sampler instruments, ADSR envelope support, pitch and pan controls, gain staging, and event objects used by gesture-driven sampler workflows. It is built on the Minim library for Processing.
Sampler playback processing chain
PASamplerInstrumentPoolMultimanages named sampler pools and routes playback to the active pool or a tagged pool.PASamplerInstrumentPoolowns a reusable group of sampler instruments, selects an available instrument for each event, and propagates buffer, gain, pan, pitch, and envelope defaults.PASamplerInstrumentapplies instrument-level gain, pitch, pan, envelope defaults, and sample-rate correction, then forwards playback requests to the sampler backend.PASharedBufferSamplerowns the voice pool for one shared mono buffer, starts voices, mixes active voices into Minim's audio callback, and applies mix normalization and soft clipping.PASamplerVoicereads samples from the source buffer, applies per-voice gain, pan, pitch, envelope state, looping state, and release/finish lifecycle handling.
Sampler synthesis engine
PASamplerInstrumentprovides the high-level instrument API for pan, gain, pitch scaling, envelopes, buffer replacement, and sampler backend access.PASamplerInstrumentPoolmanages a collection of sampler instruments for polyphony, reuse, and group gain.PASamplerInstrumentPoolMultimanages multiple sampler pools for multi-buffer or multi-sample playback.PASharedBufferSamplermanages sampler voices, voice pooling, looping defaults, panning, gain, smooth voice stealing, and mix profiles.PASamplerVoicerenders individual sampler voices with gain, pitch, pan, and optional ADSR envelope.
Interfaces and event data
PAPlayabledefines the minimal playable audio API used by sampler instruments and pools.PASamplerdefines the backend sampler contract, including play, looping, stop, sample-rate, and buffer update methods.PASamplerPlayableextends PAPlayable for sample-based playback with buffer position, duration, gain, pitch, pan, and envelope parameters.PlaybackInfostores computed duration and timing information for triggered sampler events.PitchPolicydefines pitch behavior for sample playback.SamplerBrushEventstores gesture-derived sampler event data such as location, timing, sample position, gain, pitch, pan, and envelope.
Envelope support
ADSRParamsstores parameters for ADSR envelopes and can create Minim ADSR instances.ADSRUtilsprovides utility methods for fitting envelope times to event durations.SimpleADSRprovides a sample-by-sample ADSR envelope used by sampler voices.
-
ClassDescriptionValue object for Minim ADSR parameters.Utility functions for ADSRParams.Generic interface for anything that can be "played." Provides a minimal playback API plus backward-compatible overloads for sampler instruments and other PAPlayable classes.Backend engine contract for sampler implementations.Represents a playable instrument that uses a PASampler instantiated as a PASharedBufferSampler to trigger audio playback from a shared buffer that is (currently) a Minim MultiChannelBuffer.Manages a group of PASamplerInstruments sharing the same source buffer and audio output.PASamplerInstrumentPoolMulti Manages multiple PASamplerInstrumentPool instances, each keyed by name.Specialized playable interface for sample-based instruments.PASamplerVoice - a single playback "voice" reading from a shared mono buffer.UGen-based sampler that plays multiple PASamplerVoice instances from a single shared mono buffer (channel 0 of a MultiChannelBuffer) which is an array of floating point samples over (-1.0..1.0).Mix-density normalization profiles for polyphonic sampler output, used to control noise and distortion.PitchPolicy determines how PASamplerInstrument / PASamplerVoice should interpret their pitch parameter in combination with a given PASource.Holds information about a triggered playback event.Stores values used for SamplerBrush event staging, used in tutorial examples such as
TutorialOne_03_Drawing.SimpleADSR - software envelope generator with optional exponential curves.