Ask Your Question
2

Side-chain ducking in SuperDirt

asked 2016-06-22 15:30:35 -0500

kcebulski gravatar image

updated 2016-12-16 02:39:41 -0500

lennart gravatar image

Hi all,

Trying to figure out a way to side-chain a compressor in SuperDirt. I'd prefer to be able to do it from within SuperDirt instead of sending the audio elsewhere (i.e. to a DAW) to do it. I've come across a couple of examples on the web, but I'm not sure how to implement them into Superdirt.

(
{
    var in, snd, control ;
    in = LPF.ar(Saw.ar(40), 500);
    control = Ringz.ar(
        in: LPF.ar(
            in: Impulse.ar(2),
            freq: 1000),
        freq: 30,
        decaytime: 0.25,
        mul: 7).tanh.sin*2;
    snd = Compander.ar(
        in: in,
        control: control,
        thresh: 0.01,
        slopeBelow: 1,
        slopeAbove: 0.1,
        clampTime: 0.01,
        // longer release
        relaxTime: 0.1
    );
    Splay.ar([snd, control, snd])
}.play;
)
edit retag flag offensive close merge delete

Comments

I had the same idea, but haven't hit upon a good solution. I don't think there's an easy way of doing it as a regular effect (or even global effect) because in SuperDirt things are separate SynthDefs and they don't really communicate. Cut groups are the exception, so that might provide a hint.

bgold gravatar imagebgold ( 2016-06-22 20:09:15 -0500 )edit

At the very least, what is the best way to send out multichannel in 0.8 and Superdirt. With classic I just used pan, but I remember having to initialize Dirt with a multichannel argument to get that to work. I'm sure this is really easy to implement in Superdirt, I'm just not sure where to start.

kcebulski gravatar imagekcebulski ( 2016-06-22 20:13:18 -0500 )edit

I think multichannel in SuperDirt is more or less the same: you start it with SuperDirt.start(8) for eight channels, and use pan to switch between them.

bgold gravatar imagebgold ( 2016-06-22 21:06:25 -0500 )edit
1

I just noticed that the hacks directory in SuperDirt has a few examples of sidechaining (cross-orbit-routing.scd and filtering-dirt-output.scd), so I'll try to figure out how those work.

bgold gravatar imagebgold ( 2016-06-22 21:08:41 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
2

answered 2016-06-23 22:34:04 -0500

bgold gravatar image

updated 2016-07-21 17:12:16 -0500

Yes, @telephon's example works perfectly! For the record, here it is slightly repackaged: [EDITED to incorporate his comment below]

(
~bus.free
~bus = Bus.audio(s, numChannels:2); // assuming stereo, expand if needed
~dirt.orbits[0].outBus = ~bus; // play into that bus.
Ndef(\x, {
  var control = InBus.ar(~dirt.orbits[1].dryBus, 2).sum;
  var dirt = InBus.ar(~bus, 2);
  Compander.ar(dirt, control, thresh:0.01, slopeBelow:1, slopeAbove: 0.1, clampTime:0.02, relaxTime:0.1)
}).play;
)

Just execute the code block after you start SuperDirt, then anything sent to orbit 1 will duck audio in orbit 0. It's separated into two blocks so you can change the settings on the compressor by re-evaluating the second block (re-evaluating the first will keep creating new buses, which will eventually strain your computer).

edit flag offensive delete link more

Comments

If you want to make your first statement re-evaluatable, just write ``` ( ~bus.free; ~bus = Bus.audio(s, numChannels:2); // assuming stereo, expand if needed ~dirt.orbits[0].outBus = ~bus; // play into that bus. ) ``` because `nil.free` defaults to nothing, this will always work.

telephon gravatar imagetelephon ( 2016-07-21 15:06:10 -0500 )edit
2

answered 2016-06-23 13:52:54 -0500

telephon gravatar image

updated 2016-07-21 15:07:40 -0500

There is an example in hacks/filtering-dirt-output.scd, does this help?

Btw.

If you want to make your first statement re-evaluatable, just write

(
~bus.free;
~bus = Bus.audio(s, numChannels:2); // assuming stereo, expand if needed
~dirt.orbits[0].outBus = ~bus; // play into that bus.
)

because nil.free defaults to nothing, this will always work.

edit flag offensive delete link more

Comments

ah I just saw this was suggested anyhow. Let us know how it works...

telephon gravatar imagetelephon ( 2016-06-23 13:54:34 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-06-22 15:30:35 -0500

Seen: 204 times

Last updated: Dec 16 '16