{
   "labels" : [
      "pads",
      "kick",
      "gate",
      "compressor",
      "compression",
      "side chain",
      "sidechain"
   ],
   "code" : "////////////////////////////////////////////////////////////////////////////\r\n// Quick example of side chaining via direct audio channels and with proxyspace\r\n// by rukano\r\n\r\ns.boot;\r\n\r\n////////////////////////////////////////\r\n// side chain compression w/o proxyspace\r\n\r\nk = Bus.audio(s, 2); // channels for the kick\r\nx = Bus.audio(s, 2); // channels for the pad\r\n\r\n{ Out.ar(k, Decay2.ar(Impulse.ar(2), 0.01, 1) * SinOsc.ar(80).dup) }.play; // shitty kick\r\n{ Out.ar(x, Splay.ar(Saw.ar([60, 62, 65, 67].midicps/2)) * 0.5) }.play; // shitty pads\r\n\r\n// master out\r\n(\r\nz.free; // so you can change parameters and reexecute it w/o adding more fx on top of each other\r\nz = {\r\n\tvar kick = In.ar(k, 2); // get the kick signal\r\n\tvar pads = In.ar(x, 2); // get the pads signal\r\n\tvar thresh = 0.1; // this would be the amp threshold when the Compander should \"do\" something\r\n\tvar compression = 0.1; // the reduction ratio (reduction if below 1... expansion if above 1 !\r\n\tvar attack = 0.01;\r\n\tvar release = 0.1;\r\n\tvar snd = Compander.ar(pads, kick, thresh, 1, compression, attack, release); // compressed signal with sidechain\r\n\tOut.ar(0, snd + kick); // add the kick to it, cause otherwise you will only have the compressed pads!\r\n}.play(addAction: \\addToTail); // add to tail to work as master effect\r\n)\r\n\r\n/////////////////////////////\r\n// side chain with proxy space:\r\n\r\n// our favourite live coding environment:\r\np = ProxySpace.push(s);\r\n\r\n~pads = { Splay.ar(Saw.ar([60, 62, 65, 67].midicps/2)) * 0.5 }; // shitty pads\r\n~kick = { Decay2.ar(Impulse.ar(2), 0.01, 1) * SinOsc.ar(80).dup }; // shitty kicks\r\n\r\n~master.play; // node proxy for everything (as a master effect)\r\n(\r\n~master = {\r\n\t// same arguments as the other example:\r\n\tvar thresh = 0.1;\r\n\tvar compression = 0.1;\r\n\tvar attack = 0.01;\r\n\tvar release = 0.1;\r\n\t// here you get the signals directly from the node proxies, not over audio channels... easier to read\r\n\tvar snd = Compander.ar(~pads.ar, ~kick.ar, thresh, 1, compression, attack, release);\r\n\tsnd + ~kick.ar // the proxy has it's own output. Alternatively you can ~kick.play to hear the kick directly, you won't have to add it here\r\n}\r\n)\r\n\r\n// That's it",
   "is_private" : null,
   "id" : "1-55m",
   "name" : "Easy side chain / side compression / gating",
   "author" : "rukano",
   "description" : "Quick example how to use the Compander UGen for gating/side chaining",
   "ancestor_list" : []
}
