PV_SpectralEnhance: ratio values below 1

Hello everybody!

Since values for PV_SpectralEnhance’s ratio argument “should be greater [than] 1… usually [even] 2 or greater”, I was wondering if I have any chances to change that…

I’ve got some code where I use an EnvGen with values below 1 - and it works! … sometimes…

Are there any possibilities to change PV_SpectralEnhance’s behavor regarding this issue? I mean by editing the class/implementation or so?

Maybe it’s a stupid question, but because it works in some cases, I’ve decided to ask.

Thank you all in advance and have a nice day!

If I remember correctly, it’s some sort of a harmonic multiplier. If less than 1 it should work? I just am not sure what it would do (since, mostly, it would probably shift high harmonic material down). Might be fun and sludgy.

So this is my code:

(
Ndef(\test, {
	arg fftSize = 2048, amp = 1;
	var env, input, chain;
	env = Env([0, 1, 1, 0], [0.17, 9.9, 0.1], 'sin').kr(2);
	input = [PlayBuf.ar(1, ~myBuffer_L), PlayBuf.ar(1, ~myBuffer_R)];
	chain = FFT(LocalBuf([fftSize, fftSize], 1), input);

	chain = PV_Freeze(chain, Duty.kr(Dseq([0.17, 10.0], inf), 0, Dseq([0, 1], 1), doneAction: 2));

	chain = PV_SpectralEnhance(
		chain,
		numPartials: 3,
		ratio: EnvGen.kr(Env([0.1, 0.1, 0.4, 0.2, 0.25, 0.5, 0.29, 1], [3.0, 0.4, 0.4, 1.9, 0.3, 0.3, 3.8], 'wel'), doneAction: 0),
		strength: 0.1
	);

	chain = IFFT(chain);
	chain = (chain * env) * amp;
}).play;
)

Sometimes it works perfectly but after some time I get tons of “CheckBadValues: NaN found in Synth 1022, ID 0 (previous 2 values were normal)”…

Then I guess there is something wrong about this Ndef? Where exactly do I get NaN?