Code Monkey home page Code Monkey logo

Comments (7)

Cioppa90 avatar Cioppa90 commented on July 1, 2024 1

Yeah, he is a friend of mine, I just didn't know he was already on this, my bad!

from faustlibraries.

sletz avatar sletz commented on July 1, 2024

from faustlibraries.

sletz avatar sletz commented on July 1, 2024

The discussion currently takes place on the #faust channel on "The Audio Programmer" Discord channel, see https://faust.grame.fr/community/help/

from faustlibraries.

dariosanfilippo avatar dariosanfilippo commented on July 1, 2024

@sletz I'm having issues with authentication; I need to get the token thing sorted on Github. Please do the fix yourself if you can, here is the code that you should use, replacing what currently is at line 126 of vaeffects.lib

//------------------`(ve.)moogLadder`-----------------
// Virtual analog model of the 4th-order Moog Ladder, which is arguably the 
// most well-known ladder filter in analog synthesizers. Several 
// 1st-order filters are cascaded in series. Feedback is then used, in part, to 
// control the cut-off frequency and the resonance.
//
// #### References
//
// [Zavalishin 2012] (revision 2.1.2, February 2020): https://www.native-instruments.com/fileadmin/ni_media/downloads/pdf/VAFilterDesign_2.1.2.pdf.
// This fix is based on Lorenzo Della Cioppa's correction to Pirkle's implementation; see this post: https://www.kvraudio.com/forum/viewtopic.php?f=33&t=571909.
//
// #### Usage
//
// ```
// _ : moogLadder(normFreq,Q) : _
// ```
//
// Where:
//
// * `normFreq`: normalized frequency (0-1)
// * `Q`: quality factor between .707 (0 feedback coefficient) to 25 (feedback = 4, which is the self-oscillating threshold).
//---------------------------------------------------------------------
declare moogLadder author "Dario Sanfilippo";
declare moogLadder license "MIT-style STK-4.3 license";
moogLadder(normFreq, Q, x) = loop ~ si.bus(4) : (! , ! , ! , ! , _)
    with {
        loop(s1, s2, s3, s4) =  v1 + lp1 , // define s1
                                v2 + lp2 , // define s2
                                v3 + lp3 , // define s3
                                v4 + lp4 , // define s4
                                lp4 // system output
            with {
                T = 1.0 / ma.SR;
                cf = normFreq * .5 * ma.SR;
                k = 4.0 * (Q - 0.707) / (25.0 - 0.707);
                omegaWarp = tan(ma.PI * cf * T);
                g = omegaWarp / (1.0 + omegaWarp);
                G = g * g * g * g; // ladder's G in generalised form y = G * xi + S
                S = g * g * g * (s1 * (1 - g)) + g * g * (s2 * (1 - g)) + g * (s3 * (1 - g)) + (s4 * (1 - g)); // ladder's S in generalised form y = G * xi + S
                u = (x - k * S) / (1.0 + k * G); // input to the first LP stage: u = (x - kS) / (1 + kG)
                v1 = g * (u - s1); // v-signals in TPT integrator (Zavalishin, Figure 3.30)
                v2 = g * (lp1 - s2); // second stage
                v3 = g * (lp2 - s3); // third stage
                v4 = g * (lp3 - s4); // fourth stage
                lp1 = v1 + s1; // define outputs
                lp2 = v2 + s2;
                lp3 = v3 + s3;
                lp4 = v4 + s4;
            };
    };

from faustlibraries.

sletz avatar sletz commented on July 1, 2024

Done in 4748e34

from faustlibraries.

dariosanfilippo avatar dariosanfilippo commented on July 1, 2024

Thanks, @sletz. I don't fully understand why a normalised cutoff is used for these filters but I left it like that for back-compatibility.

Thanks a lot to @Cioppa90 too for this nicely spotted issue: the filter is now stable for all cutoffs even at self-oscillating resonance and, if I remember correctly, I also tested it with modulated parameters and it was still solid.

Ciao,
Dario

from faustlibraries.

sletz avatar sletz commented on July 1, 2024

Thanks, @sletz. I don't fully understand why a normalised cutoff is used for these filters but I left it like that for back-compatibility.

No idea, you would have to ask the original author for that.

from faustlibraries.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.