‹ Pwm system.log ›

extMasterEQ

2014-10-03 02:25 supercollider

clean-up: #40

Found an old extension to Wouter Snoei's nice MasterEQ class (it's in his wslib quark). My extension just takes the current setting and posts code that recreates that. It's handy for when you want to hardcode an equaliser into some piece of code and when you don't want to be dependent on wslib being installed.

Save as extMasterEQ.sc in your extensions folder.

//redFrik 120901
//post SynthDef code for current preset
//requires wslib from quarks

+MasterEQ {
  *manual {|strip= true|
    var params;
    if(eq.notNil, {

      params= eq[\frdb][0][[0, 2, 1]];
      if(params[2]!=0 or:{strip.not}, {
        "input= BLowShelf.ar(input, %, %, %);".format(*params).postln;
      });

      params= eq[\frdb][1][[0, 2, 1]];
      if(params[2]!=0 or:{strip.not}, {
        "input= BPeakEQ.ar(input, %, %, %);".format(*params).postln;
      });

      params= eq[\frdb][2][[0, 2, 1]];
      if(params[2]!=0 or:{strip.not}, {
        "input= BPeakEQ.ar(input, %, %, %);".format(*params).postln;
      });

      params= eq[\frdb][3][[0, 2, 1]];
      if(params[2]!=0 or:{strip.not}, {
        "input= BPeakEQ.ar(input, %, %, %);".format(*params).postln;
      });

      params= eq[\frdb][4][[0, 2, 1]];
      if(params[2]!=0 or:{strip.not}, {
        "input= BHiShelf.ar(input, %, %, %);".format(*params).postln;
      });
    }, {
      "start MasterEQ first".warn;
    });
  }
}

/*
MasterEQ.start
MasterEQ.manual
MasterEQ.manual(false)  //keep zero gain poles
*/

‹ Pwm system.log ›