Finally giving the people what they want: a modern Swift refactored lid angle sensor demo app with adjustable parameters for prototyping, an app icon, and a menu bar extra https://github.com/samhenrigold/LidAngleSensor/releases/tag/1.1

Hmm. Mmhm.
What about using buffered, position-based playback via AVAudioEngine/AVAudioPlayerNode and map the slider value to a frame index in the audio file, rather than doing full granular synthesis.
Or using AVAudioEngine with an AVAudioPlayerNode playing from an AVAudioPCMBuffer (or AVAudioFile) so you have sample‑level control and low latency.
(I don’t know what any of these words mean)