Live Audio Formant shifting

Hi all,
I’m currently working on a harmonizer for live audio input to re-pitch audio using midi input.
I have a crude script working that I can successfully pitch shift incoming audio and do so with multiple voices.

Is there any way in SuperCollider to change the format of live audio in order to “normalize” the pitch shifted audio? I’m guessing Fourier analyses and transform would be the way to go but I can’t find any resources that show this is possible.

PitchShiftPA might also be a solution but, I’d like to use stock uGens as I plan to use this script on devices where SuperCollider runs kind of in the background alongside LUA and prefer for the users in these communities not to have to install extra extensions to make it work.

Here’s the work in progress:

Live Pitch Shift


~aNotes = Array.newClear(128);
	arg vel, nn, chan, src;
	[vel, nn].postln;
	~aNotes[nn] =
			\nFreq, nn.midicps,
			\amp, vel.linexp(1,127,0.1,0.3),
			\gate, 1,

	arg vel, nn;
	[vel, nn].postln;
	~aNotes[nn].set(\gate, 0);
	~aNotes[nn] = nil;

(\aTune, {
	arg gate = 0, nFreq = 4, amp = 0.3;
	var in, freq, hasFreq, out, trig, env;
	trig =;;

	# freq, hasFreq =,440, 80, 700, ampThreshold: 0.02, median: 7);
	freq =, 1.midicps, 128.midicps);
	out =, 0.1, ((, 0, nFreq) + 20).midicps / freq), 0, 0.01);

	env = 0.1), gate, doneAction: 2);
	out = out * env * amp;[0,1],out);