surge-synthesizer / shortcircuit-xt

Will be a sampler when its done!
GNU General Public License v3.0
231 stars 26 forks source link

Complete the voice effect harvesting from 'previous'; other voice effects we should add #836

Closed baconpaul closed 1 week ago

baconpaul commented 3 months ago

The only part of 'previous' (the SC2 code) we haven't really scoured for the new code yet is the voice effects. We have most other things ported over.

So this issue is kinda a checklist of both (1) voice effects I want to add which weren't in SC2 and (2) the ones in previous we haven't ported yet. More a note to self and a place to park other ideas

The code in 'previous'

New voice effects to add or consider

also

mkruselj commented 3 months ago

morphEQ presets are in SC1, I have all of them.

baconpaul commented 3 months ago

Oh awesome can you zip them and add them Here?

mkruselj commented 3 months ago

It's all in one XML file, here goes:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<morphEQ>
    <snapshot name="flat" gain="0">
    </snapshot>
    <snapshot name="tone LP 1" gain="-6">
        <band i="1" freq="-2" gain="24" BW=".1" />
        <band i="2" freq="-1" gain="24" BW=".1" />
        <band i="3" freq="0" gain="24" BW=".1" />
        <band i="4" freq="1" gain="24" BW=".1" />
        <band i="5" freq="2.0" gain="24" BW=".1" />
        <band i="7" freq="0"/>
    </snapshot>
    <snapshot name="tone LP 2" gain="-6">
        <band i="1" freq="-.2" gain="24" BW=".01" />
        <band i="2" freq="-.1" gain="24" BW=".01" />
        <band i="3" freq="0" gain="24" BW=".01" />
        <band i="4" freq=".1" gain="24" BW=".01" />
        <band i="5" freq=".2" gain="24" BW=".01" />
        <band i="7" freq="0"/>
    </snapshot>
    <snapshot name="Bell labs" gain="-40">
        <band i="0" freq="-6"/>
        <band i="1" freq="-1" gain="50" BW="0.02" />
        <band i="2" freq="1" gain="40" BW="0.04" />
        <band i="3" freq="1.58" gain="40" BW="0.06" />
        <band i="4" freq="2.07" gain="40" BW="0.07" />
        <band i="5" freq="2.43" gain="40" BW="0.08" />
        <band i="6" freq="2.77" gain="40" BW="0.1" />
        <band i="7" freq="6"/>
    </snapshot>
    <snapshot name="combs" gain="0">
        <band i="1" freq="0" gain="-80" BW="0.01" />
        <band i="2" freq="1" gain="-80" BW="0.01" />
        <band i="3" freq="1.58" gain="-80" BW="0.01" />
        <band i="4" freq="2" gain="-80" BW="0.01" />
        <band i="5" freq="2.32" gain="-80" BW="0.01" />
        <band i="6" freq="2.58" gain="-80" BW="0.01" />
    </snapshot>
    <snapshot name="random dips" gain="0">
        <band i="1" freq="0" gain="-80" BW="0.01" />
        <band i="2" freq="0.7" gain="-80" BW="0.01" />
        <band i="3" freq="1.6" gain="-80" BW="0.01" />
        <band i="4" freq="2.3" gain="-80" BW="0.01" />
        <band i="5" freq="3.1" gain="-80" BW="0.01" />
        <band i="6" freq="4.54" gain="-80" BW="0.01" />
    </snapshot>
    <snapshot name="ups and downs" gain="0">
        <band i="1" freq="0" gain="-80" BW="0.01" />
        <band i="2" freq="1" gain="12" BW="0.1" />
        <band i="3" freq="1.58" gain="-80" BW="0.01" />
        <band i="4" freq="2" gain="12" BW="0.1" />
        <band i="5" freq="2.32" gain="-80" BW="0.01" />
        <band i="6" freq="2.58" gain="12" BW="0.1" />
    </snapshot>
    <snapshot name="formant A1" gain="-40">
        <band i="1" freq="0.686" gain="60" BW="1.6" />
        <band i="2" freq="1.33" gain="30" BW="0.13" />
        <band i="3" freq="2.51" gain="30" BW="0.07" />
        <band i="4" freq="2.77" gain="30" BW="0.05" />
    </snapshot>
    <snapshot name="formant A2" gain="-40">
        <band i="1" freq="0.433" gain="60" BW="1.8" />
        <band i="2" freq="1.01" gain="30" BW="0.15" />
        <band i="3" freq="2.51" gain="30" BW="0.07" />
        <band i="4" freq="2.77" gain="30" BW="0.05" />
    </snapshot>
    <snapshot name="formant E" gain="-40">
        <band i="1" freq="0.35" gain="60" BW="2.0" />
        <band i="2" freq="2.05" gain="30" BW="0.11" />
        <band i="3" freq="2.51" gain="30" BW="0.07" />
        <band i="4" freq="2.77" gain="30" BW="0.05" />
    </snapshot>
    <snapshot name="formant I" gain="-40">
        <band i="1" freq="-0.65" gain="60" BW="2.4" />
        <band i="2" freq="2.357" gain="30" BW="0.1" />
        <band i="3" freq="2.51" gain="30" BW="0.07" />
        <band i="4" freq="2.77" gain="30" BW="0.05" />
    </snapshot>
    <snapshot name="formant O" gain="-40">
        <band i="1" freq="0.04" gain="60" BW="2.0" />
        <band i="2" freq="0.87" gain="30" BW="0.3" />
        <band i="3" freq="2.51" gain="30" BW="0.07" />
        <band i="4" freq="2.77" gain="30" BW="0.05" />
    </snapshot>
    <snapshot name="formant U" gain="-40">
        <band i="1" freq="-0.5" gain="60" BW="2.3" />
        <band i="2" freq="0.99" gain="30" BW="0.4" />
        <band i="3" freq="2.51" gain="30" BW="0.07" />
        <band i="4" freq="2.77" gain="30" BW="0.05" />
    </snapshot>
</morphEQ>
baconpaul commented 3 months ago

OK so here's what morphEQ is doing then

  1. A lot of code to load that data table from XML, which I think we shouldn't repeat. Lets just make the data table part of the effect
  2. Once you have that you have two int params (preset 1 and 2), a percent morph, and then a frequency bandwidth and gain offset
  3. Process is if anything changed calc coeffs input.scale-by-gain for (auto f : bandfilters) if (f.active) f.process
  4. calc_coeffs is where the work is. 8 bands of biquad. band 0 is a HP band 7 is a LP, rest are peak each has frequency of (preset0 (morph-1) + preset1 morph + frequency offset) and same for bandwidth LP and HP hardcode Q to 1/root 2
    1. frequency graph is the obvious choice

so looks like an easy and useful voice effect to port indeed!

baconpaul commented 2 months ago

Andreya points out that https://github.com/bogaudio/BogaudioModules/blob/master/src/Pressor.cpp the BOG "Pressor" compressor is a great example of a full featured basic compressor which would be very useful as a voice or group effect.

Andreya-Autumn commented 2 months ago

I do indeed. :) I'd be happy to take a swing at porting it, maybe next week. But if you feel the urge before then, by all means don't hold off!

baconpaul commented 2 months ago

I took a first swing at it but there's a few other bits and bobs i want to borrow and factor (I think I'm going to port their excellent envelope follower to basic blocks, for instance). So I've got it I think.

Andreya-Autumn commented 2 months ago

Nice! And (stating the obvious), also putting it in Surge (not voice-level, granted) for 1.3.2 would meet a very common feature request there.

baconpaul commented 2 months ago

Yeah. Yeah it would.

Right now bus-effects and voice-effects have different APIs (understandably) so I'm thinking about how to code it so we can project it to either.

baconpaul commented 2 months ago

https://github.com/bogaudio/BogaudioModules/issues/238

Just linking that here.

Andreya-Autumn commented 2 months ago

Right! I wonder how common the "both" case is going to be there. If it stays this rare perhaps it's easiest to just incude in both spots? But I don't know, maybeit won't be.

Andreya-Autumn commented 2 months ago

Nice

baconpaul commented 2 months ago

Right! I wonder how common the "both" case is going to be there. If it stays this rare perhaps it's easiest to just incude in both spots? But I don't know, maybeit won't be.

Yes I'm thinking about that right now. It's actually pretty easy to just push down one more level of implementer template. I'll use Pressor as a test case.

baconpaul commented 2 weeks ago

I'm going to close this issue as soon as tree monster is done, but only if tree monster is done with the bus and voice effect sharing dsp.