Skip to content

Original dirty compressor #304

Open
Open
@yaxu

Description

@yaxu

One thing missing from SuperDirt is the original compressor.

https://github.com/tidalcycles/Dirt/blob/071fd88b3e004a11215afd11b718e92d3ab44d18/audio.c#L770-L777

Thankfully Pulu has ported it, code below. It sounds excellent, very useful for from-scratch performance. I think it would be great to incorporate it into superdirt, although probably default off. It needs miSCellaneous_lib as a dependency, perhaps it's better to hard fork Fb1?

// emulation of master compressor from original Dirt
// requires Fb1 from miSCellaeous for single-sample feedback
// https://github.com/dkmayer/miSCellaneous_lib
(
Ndef(\dirtComp, { |amount=1, speed=50|
	var in, max, env;
	in = In.ar(0, ~dirt.numChannels);

	max = Select.ar(ArrayMax.ar(in.abs)[1], in);
	env = Fb1({ |in, out|
		var env, prod;
		env = out[1];
		env = env + (speed / SampleRate.ir);
		prod = (in[0] * env).abs;
		Select.kr(prod > 1, [env, env/prod]);
	}, max, leakDC: false);

	ReplaceOut.ar(0, in * amount.linlin(0, 1, 1, env * 0.2));
}).play(
	group: RootNode(Server.default),
	addAction: \addToTail
);
)

// can also tune the parameters
Ndef(\dirtComp).set(\amount, 1);
Ndef(\dirtComp).set(\speed, 200);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions