How can i maintain the distorted signal when recording?

Hello everyone, I’m not sure if I’m formatting this post correctly but I am trying.

I have posted my code below for a synth bass I’m going to use in a composition, the sound is clipping HARD and it sounds really cool.
I’ve recorded it as it is and the gain gets reduced massively and no longer sounds cool and buzzy when I listen to it. I have also tried using a -30/-10.dbamp attenuation and have also tried .tanh

Although they sound much better when recorded, they lose some of that insane clipping that makes it sound cool to me.

Could anyone help me find a way to be able to record the sound as I hear it when it clips?
Thank you


// setting the scale to be used in the Pbind by assigning it to a variable
~a = Scale.locrian;

// creating the synthdef and giving it a few arguments
SynthDef(\bass, { arg dur, freq, amp=0.2, out=0, 
	pmax=1, pmin=(-1), 
	cfmax=250, cfmin=150, 
	rqmin=0.1, rqmax=0.5,
	// declaring the variables to be used
	var sig, sin, saw, tri, hiSaw,
	env, panner, phase, 
	lpf, bpf, modSin, am, rhpf;
	// defining the phase variable to move between the phase of the sine wave
	phase =, pmax)
	// setting up the oscillators, utilising the phase variable, saw is half the frequency
	sin =, phase, 0.5);
	hiSaw =*2), 0.5);
	saw = {, 0.35, 1.0)}!2;
	tri =, phase, 1.0);
	// making the envelope and the filters, the filters change as the synth progresses
	env =[0, 0.8, 0.9, 0.5, 0.0], [0.1, 1.0, 0.25, (dur/2)]), doneAction:2);
	lpf =,, 500)
	bpf =,, 1500, 0.5, 1.0),, rqmax)
	rhpf =,, 2000, 0.5),, 0.5, 10)
	// summing things together to spit out the signal, am, which is then sent to the panner and added 
	hiSaw = ((hiSaw * env) * rhpf) * amp;
	sin = (sin * lpf);
	saw = saw * bpf;
	sig = ((saw + sin) * tri) * env;
	modSin =;
	am = ((sig * modFreq) + hiSaw);
	panner =, 0, 0.5);, panner);


You can manually add hard clipping by using signal.clip(low, high).
Perhaps you could do this in your synth…

signal.clip(\, \;

Whait, if it is not recorded in a floating-point audio format, but for example 16bit, it clips and distort badly…

I’m recording it as a .WAV file, do I need to set the bit depth and sample rate in the server options?

Thank you for your reply! Though I’m not sure how to implement this. I’m quite new to supercollider so I’m sorry if this is painfully simple!

panner =, 0, 0.5);
panner = panner.clip(-0.5, 0.5);, panner);

It is possible some of the sound comes from depth and sampling rate. You can use Decimator for that.

You are very clever thank you! I’ll look into decimator but for now the recorded version sounds just as distorted as the sound from supercollider!!