EQ Question - how to use StaticEQ or BEQSuite on live input?


I am trying to use an EQ to be able to process an incoming live signal from a record deck and apply an curve which approximates RIAA de-emphasis (i.e. to change a phono signal to line input). I’ve tried both MultiEQ and StaticEQ, with the code below

    SynthDef(\kernelEncodeDecode, {arg buffer;
        var out, src, encode;

// live stereo source signal from phono input
src = SoundIn.ar(0!2);

// RIAA de-emphasis (if no phono preamp on audio interface)
riaa = StaticEQ.new(src, \loshelf, 141, 18, 0.143, \loshelf, 445, 2, 0.143, \hishelf, 2213, -0.9, 0.143, \hishelf, 6214, -18, 0.143);

    // encode to ambisonic using ambisonic encoder
    encode = FoaEncode.ar(riaa, encoder);

// decode using the chosen decoder (binaural/quad/octo/5.1)
    out = FoaDecode.ar(encode, decoder);

    Out.ar(0, out);

I was hoping that the EQ worked in the same way as a transform in that the first variable (‘src’) is run through the EQ and then returned as a new signal (‘riaa’) but I am getting a series of errors resulting in

ERROR: Convolution2 arg: ‘in’ has bad input: a StaticEQ

Can anyone see where I am going wrong here? I’ve also tried using four separate instances of BEQSuite, like this:

src = BLowShelf.new(src, 141, 0.143, 18);
src = BLowShelf.new(src, 445, 0.143, 2);
src = BHiShelf.new(src, 2213, 0.143, -0.9);
riaa = BHiShelf.new(src, 6214, 0.143, -18);

…but get the same result. If I comment out the EQ, everything works fine and I can add transformations and reverbs using the same method. Am I not understanding how the EQs work or how the input signal needs to be defined?

Any help much appreciated!

StaticEQ is my class – it’s a container for multiple EQ bands but it isn’t itself a pseudo-UGen.

I forget if I included a method to act like a pseudo-UGen or not… I don’t think so…? In any case new is definitely not that method, so you can’t use new in this way.

A UGen needs to use a rate selector instead of new: BLowShelf.ar instead of .new –


Hi James, thanks for the reply and explaining that for me. I’m pretty new to the language, but think I understand now. So, i went back to the second method and changed .new to .ar, with varied results. It seems to stop working when I enter a value of k (i.e. gain) > +/- 9.9. Would you happen to know if there’s a maximum value? My EQ settings are quite extreme, but I need the 18db cut/boost to replicate the RIAA curve.