Stealing VCV Rack's analog "exciter" formula

Credit:

(
a = {
	var saw = Saw.ar(MouseX.kr(50, 8000, 1));
	var x = saw * 0.5 + 0.5;
	var saw2 = LeakDC.ar(((x * 5 - 13) * x + 3) / (x * 2 + 3)).neg;
	var trig = Impulse.kr(1);
	var index = ToggleFF.kr(trig);
	SendReply.kr(trig, '/index', index);
	(Select.ar(index, [saw, saw2]) * 0.1).dup
}.play;

if(v.tryPerform(\isClosed) ? true) {
	v = Button(nil, Rect(800, 200, 200, 50)).states_([
		["Digital", Color.white, Color.gray(0.1)],
		["Analog", Color.black, Color.gray(0.6)]
	]).font_(Font.default.size_(36)).front;
};

OSCdef(\index, { |msg|
	defer { v.value = msg[3] };
}, '/index', s.addr);
)

To my ear it adds some pleasing high-frequency content. Also works well with Pulse.ar.

Comments? Improvements?

EDIT: Rewrote the formula to suit SC’s operator order better.

EDIT: You could try two versions.

  • VCV’s exact formula LeakDC.ar(((x * 5 - 13) * x + 3) / (x * 2 + 3)).neg – mellower
  • Or my first typo version LeakDC.ar(((x * (5 - 13)) * x + 3) / (x * 2 + 3)).neg – adds a touch of distortion. TBH I like this sound better :smiling_imp: though it’s technically wrong. – -7 instead of -8 sounds slightly nicer.

hjh

4 Likes