Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual filter unit as effect #1389

Open
itsmedavep opened this issue Dec 2, 2019 · 12 comments
Open

Dual filter unit as effect #1389

itsmedavep opened this issue Dec 2, 2019 · 12 comments
Labels
DSP Issues and feature requests related to sound generation in the synth Effects Feature Request New feature request
Milestone

Comments

@itsmedavep
Copy link
Contributor

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

@baconpaul baconpaul added this to the Currently Unscheduled milestone Dec 2, 2019
@baconpaul baconpaul modified the milestones: Currently Unscheduled, 1.6.5, 1.6.6 Feb 2, 2020
@mkruselj mkruselj added Feature Request New feature request DSP Issues and feature requests related to sound generation in the synth labels Feb 5, 2020
@mkruselj mkruselj mentioned this issue Apr 9, 2020
2 tasks
@mkruselj mkruselj modified the milestones: Currently Unscheduled, 1.7.n Jun 2, 2020
@baconpaul baconpaul modified the milestones: 1.7.n, 1.7 beta 1 Jun 5, 2020
@baconpaul
Copy link
Collaborator

@mkruselj as discussed

@mkruselj
Copy link
Collaborator

mkruselj commented Jun 5, 2020

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.

baconpaul added a commit to baconpaul/surge that referenced this issue Jun 9, 2020
@baconpaul
Copy link
Collaborator

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.

@baconpaul baconpaul modified the milestones: 1.7 beta 1, 1.7.n Jun 18, 2020
@mkruselj mkruselj modified the milestones: 1.7.n, 1.7.1 Jul 17, 2020
@mkruselj mkruselj modified the milestones: 1.7.1, 1.7.2 Jul 30, 2020
@baconpaul
Copy link
Collaborator

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?

@mkruselj
Copy link
Collaborator

mkruselj commented Aug 4, 2020

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?

@baconpaul
Copy link
Collaborator

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!

@mkruselj
Copy link
Collaborator

mkruselj commented Aug 4, 2020

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

@mkruselj
Copy link
Collaborator

mkruselj commented Aug 4, 2020

Here are some suggested filter configurations:

Serial 1

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

Serial 2

==> 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--|

@baconpaul
Copy link
Collaborator

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.

@mkruselj mkruselj modified the milestones: 1.7.2, 1.7.n Sep 8, 2020
@mkruselj mkruselj modified the milestones: 1.8.n, 1.9.0 Oct 8, 2020
@mkruselj mkruselj changed the title Filter effect would be a welcome addition Dual filter unit as effect Oct 8, 2020
@mkruselj
Copy link
Collaborator

mkruselj commented Oct 28, 2020

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)? Ugh, parameter mess...

@baconpaul
Copy link
Collaborator

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

@baconpaul
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DSP Issues and feature requests related to sound generation in the synth Effects Feature Request New feature request
Projects
None yet
Development

No branches or pull requests

3 participants