Strange grinding ambience

(
// PLAY WITH THE MOUSE-X POSITION

Ndef(\difference, {
	var f1, f2, f3, f, fmod, sig, diff, form, band, droop;
	var switch, noise, low, shiftWindow, lpf;

	switch = 1 - LFPulse.kr(1/10);
	switch = Impulse.kr(0) + switch;

	f = (24 + [50, 54, 57.01]).midicps;

	f1 = 9100;
	
	lpf = MouseX.kr(50, 400, 0, 1).poll(1);

	fmod = [f1] ++ (f1 - f);

	sig = SinOsc.ar(fmod).sum;
	sig = sig * SinOsc.ar(f).sum;
	sig = -6.dbamp * sig;

	noise = BHiPass4.ar(WhiteNoise.ar([1, 1]), 1000, 0.8).pow(2.1);
	noise = BHiPass4.ar(noise, 12000, 0.5);
	noise = -44.dbamp * noise;

	droop = 2.pow(
		Env.perc(5, 10).kr(gate:switch).lincurve(0.0, 1, 0.5, 1, 0)
		* [1.1, 1.5, 2]
	);
	shiftWindow = 0.05;

	low = LFSaw.ar(
		[1.04, 2, 8.04] * Env.perc(0.01, 16).kr(gate:switch).lincurve(0, 1, 25, 45, -4),
		0.4,
	);
	low = Splay.ar(low);
	low = BLowPass4.ar(low, 160, 0.4);
	low = low + (low * Splay.ar(PitchShift.ar(low, shiftWindow, droop, 0.0, 0.0)));
	low = Rotate2.ar(low[0], low[1], SinOsc.kr(1/50, Rand(-1, 1)).range(-1, 1));

	low = SoftClipAmp8.ar(low, 15.5);
	low = BLowPass4.ar(low, 1640, 0.9);
	low = low + (low * Splay.ar(PitchShift.ar(low, shiftWindow, droop, 0.0, 0.0)));
	low = Rotate2.ar(low[0], low[1], SinOsc.kr(1/50, Rand(-1, 1)).range(-1, 1));

	low = SoftClipAmp8.ar(low, 5.0);
	low = low + Pluck.ar(low, low, 1, (12 + [50, TWChoose.kr(switch, [53, 55]), 59]).midicps.reciprocal, 13, 0.1, -7.dbamp);
	low = LeakDC.ar(low);
	low = BLowPass4.ar(low, lpf, 0.9);
	low = low + (low * Splay.ar(PitchShift.ar(low, [1, 2, 4], droop, 0.0, 0.0)));
	low = Rotate2.ar(low[0], low[1], SinOsc.kr(1/50, Rand(-1, 1)).range(-1, 1));

	sig = SelectX.ar(switch.lag(0.05), [sig, sig]);

	sig = sig + (
		Env([0, 1, 0], [9, 1]).kr(gate:Changed.kr(switch))
		* SinOsc.ar(Env([20, 40], [10]).kr(gate:Changed.kr(switch)))
		* -15.dbamp
	);
	sig = low + (low * sig * -10.dbamp);

	sig = sig + (-20.dbamp * GVerb.ar(HPF.ar(sig, 7000), 20));

}).play

)

1 Like