Default amp value

What's the default amp value for samples? Looking at SuperDirt/core-synths.scd at develop · musikinformatik/SuperDirt · GitHub it seems 1, but listening to some samples, it seems like the default value is around 0.4 - 0.5 (# amp 1 is clearly louder than the default).

Pinging @julian as I think this is your code.

here is an explanation, I hope it helps (sorry for the lack of documentation).
IIRC, we chose 0.4 because that was the value from classic dirt.
But it is also reasonable, avoiding distortion, but not too quiet.

// amplitude is controlled by the gate synth:

 sendGateSynth {
		server.sendMsg(\s_new,
			"dirt_gate" ++ ~numChannels,
			-1, // no id
			1, // add action: addToTail
			~synthGroup, // send to group
			*[
				in: orbit.synthBus.index, // read from synth bus, which is reused
				out: orbit.dryBus.index, // write to orbital dry bus
				amp: ~amp,
				gain: ~gain,
				overgain: ~overgain,
				sample: ~hash, // required for the cutgroup mechanism
				cut: ~cut.abs,
				sustain: ~sustain, // after sustain, free all synths and group
				fadeInTime: ~fadeInTime, // fade in
				fadeTime: ~fadeTime // fade out
			]
		)
	}

// the default parameters for amp and gain you can find in the orbit: 

~dirt = SuperDirt(2, s);
~dirt.start;
~dirt.orbits.first.get(\amp) // 0.4
~dirt.orbits.first.get(\gain) // 1.0
~dirt.orbits.first.get(\overgain) // 0.0


// these two parameters are passed to a synth called "dirt_gate"

SynthDef("dirt_gate" ++ numChannels, { |out, in, sustain = 1, fadeInTime = 0.001, fadeTime = 0.001, amp = 1, gain = 1, overgain = 0|
		var signal = In.ar(in, numChannels);
		 //  doneAction: 14: free surrounding group and all nodes
		var env = EnvGen.ar(Env([0, 1, 1, 0], [fadeInTime, sustain, fadeTime], \sin), doneAction: 14);
		amp = amp * pow(gain.min(2) + overgain, 4);
		signal = signal * env * amp * DirtGateCutGroup.ar(fadeTime, doneAction: 14);
		// this takes the signal and offsets it so it matches precisely onto the sample
		// as scheduled within one block (a synth is always started on the block bondary)
		OffsetOut.ar(out, signal);
		ReplaceOut.ar(in, Silent.ar(numChannels)) // clears bus signal for subsequent synths
	}, [\ir, \ir, \ir, \ir, \ir, \kr, \ir, \ir]).add; // amp can be modulated, gain and overgain can't

// => the formula is this:

 amp * pow(gain.min(2) + overgain, 4);

// so for the defaults, you get

0.4 * pow(1 + 0, 4) // => 0.4 
1 Like

Thank you, @julian , for your detailed answer. I missed the default values in the orbits.

good that you asked! I am sure it is unclear also for others …

I hope no more, as it's now documented here: Samplers | Tidal Cycles

1 Like