Surge: Dual filter unit as effect

Created on 2 Dec 2019  路  12Comments  路  Source: surge-synthesizer/surge

While sound designing, I often utilize the filters in A as well as the filters in B.

It would be stellar to also be able to then run a filter over A & B's output. Even more generally just to have a filter effect.

Minimally, I was wanting to put the filter here in the graph:
Screen Shot 2019-12-02 at 10 05 42 AM

DSP Feature Request

All 12 comments

@mkruselj as discussed

The 12 parameters would be (with sections):

Filter 1
Type
Cutoff
Resonance

Filter 2
Type
Cutoff
Resonance

Routing
Configuration
F1<>F2 Mix
Feedback

Waveshaper
Type
Amount

Output
Mix

Now, I wonder if we should include all the configs, or just the ones that are stereo? I think S1 we can drop because S2 is exactly the same just with feedback. If we can make all of them stereo input just for the sake of the FX unit (I think we should), then all those that are mono dupes should be removed. OK that basically means S2 can be dropped because it's the same as Wide only it's mono.

So, I guess we would have these: S3赂, D1, D2, Ring (convert them to stereo in), L-R, Wide.

Still a welcome addition; but it will be a welcome addition in 1.7.1 or later. Sorry I'm just not gonna make the cut for an early Aug release.

So returning to this and the idea discussed on slack, that we don't need the same configurations. Basically we want a stereo effect which is a couple of filters. So we could lay out our 12 slots like this

Filter 1
Type
SubType
Cutoff
Resonance

Filter 2
Type
SubType
Cutoff
Resonance

Feedback
Drive
WaveShape
Feedback

Output
Mix

Then we have a single stereo configuration which is

F1 ---> F2 ---+->out
   WS <- FB<-|

Alternately we can fix the WaveShape at Soft and then have multiple configurations (so Feedback becomes Configuration with Algorithm, Feedback and Drive).

Then you basically just code this up anew using QuadFilterUnitState and QuadFilterUnit

Thoughts?

I think losing the configs would be a bit of a bummer.

Right-click on either Feedback or Mix slider to change the config?

Oh but we only need the non-redundant ones. So S1 is out, and if the filter is stereo then S2 is out too, right?

We could keep the configs and lose the wave shaper shape also?

The configs will be different with the effect than with the main bank of course. But I know you know that!

Waveshaper shape is kinda important, tho... Maybe waveshaper shape could be on right-click of Drive?

Here are some suggested filter configurations:

Serial 1

==> F1 => WS => F2 ==> out
 |=====FB==========|

Serial 1

==> F1 => WS => F2 ==> out
             |==FB==|

Serial 3

==> WS => F1 => out
 |==F2=<==FB=|

Parallel 1

        |==> F1 ====|
==> WS =| |==FB==|  +==> out
        |==> F2 ====|
          |==FB==|

Parallel 2

  |==> F1 ====|
==| |==FB==|  +=> WS => out
  |==> F2 ====|
    |==FB==|

Parallel 3

  |==> F1 => WS =|
==|              +==> out
  |==> F2 =======|
    |==FB==|

Parallel 4

        |--> F1 ---> L out
==> WS =| |--FB--|
        |--> F2 ---> R out
          |--FB--|

Discussed on slack
We really want type and subtype to be one slider. Couple of ways to do this. But then we could add in a gain and width param also with the set above.

So

F1: Type / Cut / Res
F2: Type / Cut / Res
Routing: Algo / Drive / WaveShape / Feedback
Output: Gain / Mix

if we do that we lose width but that's OK. There's other FX with M/S width expansion if we really need that.

Then the type would behave in some way that it was reasonable to use to be determined. In first draft I would probably just make it a super long list though.

I'm just thinking... regarding parameters... since this would always be a stereo in, stereo out filter... wouldn't we actually want to have individual pan for F1 and F2 as well?!

And then, what do we do with filter types that require 3rd slider (OB-Xd, Sallen-Key, Diode ladder whenever that's int)? Ugh, parameter mess...

So since we discussed on discord let me add a few implementation notes here

  1. Adding an FX is easy. Just follow the same pattern that the others have. Add an fxt_, add the implementation in src/common/dsp/effects/FilterEffect.cpp/h and make spawn_effect create it. The basic plumbing other than the process method is easy

  2. I would do this in 3 steps. A "Single filter no routing" just get it working / A "pair of filters in sequence" / Routing

  3. Basically you are re-implementing the innards of the SurgeSynthesizer / SurgeVoice filter handling. and doing an alternate implementation of QuadFilterChainState

    1. You have 2 filters in stereo so you need 4 QuadFilterUnitStates as 2 pairs as members
    2. You have 2 FilterCoefficientMakers (for each filter pair) on which you call MakeCoeffs and copy onto the QuadFilterUnitStates every BLOCK or so. Take a look around line 1000 of SurgeVoice
    3. You call GetQFPtrFilter to get a FilterUnitQFPtr
    4. You iterate on that over points with the QuadFilterUnitState you created above
  4. Then what you route where and when is the shape. And adding a wave shaper in the mix is a call to GetQFPtrWaveshaper and calling the process method on that.

So basically you do a very stripped down version of the QuadFilterChain in a new bit of standalone code build on the QuadFilterUnits

Oh also I think the fx run at regular rate not at oversample rate so we need to check that too?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mkruselj picture mkruselj  路  6Comments

sense-amr picture sense-amr  路  4Comments

mortfell picture mortfell  路  8Comments

esaruoho picture esaruoho  路  10Comments

hems picture hems  路  3Comments