In processReplacing() I declared
Code: Select all
float out;
Code: Select all
out = // result of some processing;
if (*in < 0) { out = -out; }
*in = lerp(mix, *in, out);
The result was kind of hilarious. Running my plugin in Maschine, it produced some periodic bursts of noise when I didn't touch anything, crackles whenever I turned a knob on the hardware not even associated with a plugin parameter (I swear it sounded almost like a bad volume pot), a noisy but kind of fun distortion when audio was playing through it, and total silence if I hit "play" on the transport. Freaked me out until I realized what I'd done.
Obviously its behavior would be extremely dependent on the host, OS, build configuration, etc. Even so, I might release something like that just for the hell of it -- those knob crackle sounds could have been useful samples.