Inexplicable Synthdef Behaviour! :(

I was using supercollider with foxdot to make music, when I unfortunately decided to take a break, turn off supercollider, and restart/update my computer. Here is the code for the synth that inexplicably “broke.”

    SynthDef.new(\kneasiest,
	{|amp=1, sus=1, pan=0, freq=0, vib=0, fmod=0, rate=0, bus=0, cutoff=440|
		var osc, env;

		freq = In.kr(bus, 1);
		freq=Vibrato.kr(freq, (rate + [-1,1]));

		amp = amp / 32;

        env=EnvGen.ar(Env.perc(attackTime: 0 ,releaseTime: sus*0.01,level: amp,curve: -2), doneAction: 0);
		osc = SinOsc.ar(freq + (rate * 120) * XFade2.ar(LFPar.ar(freq), LFTri.ar(freq/2)), phase: 0, mul: 1);
		
        ReplaceOut.ar(bus, osc)}).add;

As I was typing this post, on a hunch, I used the recorder in supercollider, threw the new, broken version of the synth into my DAW, quieted it down by about ten decibels, and … it sounded like the old one again! Unfortunately, changing the amp=amp/(number bigger than 32) is not changing the volume at all nor does writing amp=1/(sizable denominator) in Foxdot fix the issue.

The reason I care so much is because the careful interplay between this synth and another custom one in foxot had really fun results, and I want to edit and finish this into a proper song, and I’m sad at the loss of my synth after it decided to get unbearably loud. https://soundcloud.com/ondrew-t/blur-rough-demo

I know I am new at this and playing around with a fair amount of code I do not fully understand (I do a lot of messing around with premade synths and combining features of them), so I apologize them if this is a newb affair, but why is my synthdef suddenly screeching at me after I restarted foxdot and my computer and why does nothing I do to the code fix it? Also, Foxdot’s neat, though I’m betting most of you have heard of it already: https://foxdot.org/ (I’m more comfortable with python than the supercollider language hence foxdot. I promise I’ll get there eventually haha <3 )

env is defined, but not used anywhere… and this is the only place where amp is used. So amp is not controlling anything. (Btw I didn’t see this at first, myself!)

hjh

Thanks, shark! I must have accidentally erased the line “osc = Mix(osc)*env;” before restarting my computer. :sweat_smile: