Code broke - solved

I am completely baffled - the SynthDef below (using DWGPlucked) worked fine until last week. I did not change anything in this Def; I did not update SC; yet now it is breaking often - producing NaN and infinity values frequently to the point that it just doesn’t work.

SynthDef(\dwgplucked, { |out=0, freq=440, amp=0.5, gate=1, pos = 0.1, c1=1, c3=20, fB=2,pan=0|
    var env = Env.new([0,1, 1, 0],[0.001,0.006, 0.0005],[5,-5, -8]);
    var inp = amp * LFClipNoise.ar(2000) * EnvGen.ar(env,gate);
    var son = DWGPluckedStiff.ar(freq, amp, gate,pos,c1,c3,inp,0.1,fB);
	son = Select.ar(CheckBadValues.ar(son) > 0, [son, DC.ar(0)]);
	son = OteySoundBoard.ar(son,5,15,0.5);
	DetectSilence.ar(son+Impulse.ar(0), 0.01, doneAction:2);
    Out.ar(out, Pan2.ar(son * 0.04, pan));
}).add;

and a sample of errors
CheckBadValues: infinity found in Synth 1789, ID 0 (previous 1752 values were normal)
CheckBadValues: NaN found in Synth 1789, ID 0 (previous 11 values were infinity)
CheckBadValues: infinity found in Synth 1601, ID 0 (previous 10466327 values were normal)
CheckBadValues: NaN found in Synth 1601, ID 0 (previous 1 values were infinity)
CheckBadValues: infinity found in Synth 1601, ID 0 (previous 10466327 values were normal)
CheckBadValues: NaN found in Synth 1601, ID 0 (previous 1 values were infinity)
CheckBadValues: infinity found in Synth 1793, ID 0 (previous 1752 values were normal)
CheckBadValues: NaN found in Synth 1793, ID 0 (previous 11 values were infinity)
CheckBadValues: normal found in Synth 1601, ID 0 (previous 191080 values were NaN)
CheckBadValues: normal found in Synth 1601, ID 0 (previous 191080 values were NaN

I tried changing the way CheckBadValues is used (e.g. to make it release the Synth with bad values) that didn’t help much. But I am just mystified what could have caused this change in results. Any clues how I might track the problem, and even better fix it, would be great.

Managed to solve (I think). It seems it was a by-product of how I was calling the Synth. I still don’t fully understand how the problem resulted in NaN values in the synth. But at least things are running.

For what it’s worth, I had a nice harp-like sound that used one of the DWG units, and I had to retire it some years ago when it started producing NaNs more often. The SynthDef didn’t change, and I’m pretty sure nothing changed in the UGen source code either, just more blowups. I never could figure out why; I only observed that it was becoming risky to use that SynthDef in a performance.

hjh

thanks. That was what I thought happened in my case too. But I discovered that what seems to have happened is that an error somewhere else (what I thought was an array was actually a list) cascaded into unreasonable values being used by the SynthDef. At least I think this was the case since I just used the code, including this synthdef, in an extended rehearsal this morning without a problem. I am still hazy how the error caused the synth to go haywire. And I couldn’t find an alternative that will give me something that sounds similar enough.