Package net.paulhertz.pixelaudio.granular


package net.paulhertz.pixelaudio.granular
Granular synthesis classes for PixelAudio.

The modern granular synthesis engine follows the chain PAGranularInstrumentDirector -> PAGranularInstrument -> PAGranularSampler -> PAGranularVoice, with PASource implementations providing sample data and grain behavior. Example code makes exclusive use of PABurstGranularSource as the most versatile PASource.

Modern granular synthesis engine

  • PAGranularInstrumentDirector coordinates gesture playback, scheduling, event parameters, and granular source creation.
  • PAGranularInstrument provides the high-level instrument API for pan, gain, envelopes, looping, and scheduled starts.
  • PAGranularSampler manages granular voices, voice pooling, and sample-accurate scheduling.
  • PAGranularVoice renders individual granular voices with envelope, pan, gain, and optional looping.

Sources and audio data

  • PAFloatSource defines the minimal audio source abstraction used by granular voices.
  • PASource extends PAFloatSource with pitch-policy and buffer-access support.
  • PABurstGranularSource provides windowed granular synthesis with normalization and powers the granular synthesis engine.

Gesture configuration and event data

  • GestureGranularConfig stores editable gesture, timing, and synthesis settings, with builder support.
  • GestureGranularParams provides immutable granular playback parameters used by the engine.
  • GestureEventParams stores schedule-aligned sample indices and optional per-event pan, gain, and pitch data.

Utilities

  • WindowCache caches generated window curves for granular playback.
  • OverlapUtil computes block/span overlaps for sample-accurate audio processing.