I’ve got a simple little sound that’s kind of like a grainy jittery scrub through a sample, simply by using a Playbuf and a random Dust impulse signal to re-start playback at startPos based on MouseY. It’s very basic as I’m still a noob, and I’m sure there are more polished alternatives (maybe TGrains? something else?), but I’m wondering what my options are for getting rid of the popping sounds that often occur when it jumps around. I understand the cause (I’m abruptly cutting off the signal at some random value and beginning playback at some other random value), but I’m wondering how to properly think about this or approach problems like these. I guess I’d want some kind of envelope with a fast attack/release at each “edge” (each time the trigger causes a restart), but to do that I feel like I’d have to know in advance how long the random-length grain would be so that I could start fading out before the trigger fires.
Is it a common theme in SuperCollider (and programmatic audio stuff in general) that it’s easy to make crazy noises with math, but hard to polish the “edges”?
~buff = Buffer.read(s, Platform.resourceDir +/+ "sounds/a11wlk01.wav");
(
{
PlayBuf.ar(
numChannels: 1,
bufnum: ~buff,
rate: BufRateScale.kr(~buff),
trigger: Dust.ar(10),
startPos: ~buff.numFrames * 2 * MouseY.kr,
loop: 0);
}.scope(1);
)