Package net.paulhertz.pixelaudio.schedule


package net.paulhertz.pixelaudio.schedule
Package net.paulhertz.pixelaudio.schedule provides sample-accurate event scheduling, gesture-based time management, and audio utility functions for the PixelAudio library.

Core Scheduling

The AudioScheduler is a generic event scheduler supporting both point events (one-shot at a sample time) and span events (active over an interval). It provides sample-accurate callback delivery with thread-safe enqueuing and block-based processing on the audio thread.

  • AudioScheduler provides a sample-accurate scheduler for one-shot point events and duration-based span events, with support for late event policies, block-wise processing, and thread-safe scheduling.

Gesture and Time Management

  • GestureSchedule is a data container for a PAGesture with immutable points, times in milliseconds, and optional start time, serving as the base structure for gesture-driven playback.
  • GestureScheduleBuilder builds schedules for classes that implement PAGesture or use PAGesture implementers, supporting resampling, duration scaling, time warping, and hop mode conversion for flexible gesture playback control.
  • TimedLocation is used to schedule or track events that take place at specific coordinate locations, with support for duration and staleness tracking.
  • GesturePerformer (deprecated) is a placeholder interface for future gesture performance abstractions.

Audio Utilities

AudioUtility provides a comprehensive collection of audio processing functions including time/frequency conversions, gain/decibel conversions, signal level computation, normalization, resampling, and file I/O operations.

  • AudioUtility provides utility conversions for audio including:
    • Time conversions: milliseconds ↔ samples, seconds ↔ samples
    • Gain conversions: dB ↔ linear amplitude
    • Pitch/frequency: semitones ↔ frequency ratio, MIDI key number ↔ frequency
    • Signal analysis: peak, RMS, and normalization (by peak, by RMS, or with ceiling)
    • Resampling: mono and multi-channel buffer resampling with linear interpolation
    • File I/O: save audio to 16-bit or 32-bit PCM WAV format (mono or stereo)