Package net.paulhertz.pixelaudio.voices
Interface PAPlayable
- All Known Subinterfaces:
PASamplerPlayable
- All Known Implementing Classes:
PASamplerInstrument,PASamplerInstrumentPool,PASamplerInstrumentPoolMulti
public interface PAPlayable
Generic interface for anything that can be "played."
Provides a minimal playback API plus backward-compatible overloads
for sampler instruments and other PAPlayable classes.
-
Method Summary
Modifier and TypeMethodDescriptiondefault intplay()Simple play call using default amplitude, pitch, and pan.default intplay(float amplitude) Play with amplitude only.default intplay(float amplitude, float pitch) Play with amplitude and pitch.intplay(float amplitude, float pitch, float pan) Minimal play signature for generic playables.default intplay(float amplitude, float pitch, float pan, boolean unused) Play with amplitude, pitch, and pan.default intplay(float amplitude, ADSRParams env, float pitch, float pan) Optional interface for playables that support envelopes.voidstop()Stop playback immediately (implementation-defined).
-
Method Details
-
play
int play(float amplitude, float pitch, float pan) Minimal play signature for generic playables. Implementations may ignore parameters they don't need.- Parameters:
amplitude- gain multiplier (0..1+)pitch- playback rate or pitch factor (implementation-defined)pan- stereo pan (-1 left .. +1 right)- Returns:
- non-zero if a voice/event was triggered
-
stop
void stop()Stop playback immediately (implementation-defined). -
play
default int play()Simple play call using default amplitude, pitch, and pan. -
play
default int play(float amplitude) Play with amplitude only. -
play
default int play(float amplitude, float pitch) Play with amplitude and pitch. -
play
default int play(float amplitude, float pitch, float pan, boolean unused) Play with amplitude, pitch, and pan. -
play
Optional interface for playables that support envelopes. Implementations that don't use ADSR can ignore this overload.
-