Comments (7)
Yeah, he is a friend of mine, I just didn't know he was already on this, my bad!
from faustlibraries.
- the source code is here: https://github.com/grame-cncm/faustlibraries/blob/master/vaeffects.lib#L126
- I understand @dariosanfilippo is on the same subject right? Then a PR of the fixed code in the Faust version (or rewrite) would be even better !
from faustlibraries.
The discussion currently takes place on the #faust channel on "The Audio Programmer" Discord channel, see https://faust.grame.fr/community/help/
from faustlibraries.
@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.
Done in 4748e34
from faustlibraries.
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.
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)
- Feature request: allow si.bus(0) HOT 1
- Add links to source code from libraries docs pages HOT 2
- co.RMS_compression_gain_mono causes core dump HOT 4
- Deprecated examples documentation ?
- N dimensional tabulate HOT 23
- Can the enable primitive become a fully supported feature? HOT 1
- backwards compatibility strategy / library versioning HOT 7
- DX7 Library is incomplete
- compilation of Max 8 externals for Apple ARM64 -> ok HOT 1
- Naming conventions for amplitude analysis functions HOT 18
- Strange behaviour of ba.if with fractional conditions < 1. HOT 1
- add edge detection to signal library HOT 1
- I want to help HOT 1
- oscillators.lib : 488 : ERROR : syntax error, unexpected IDENT HOT 6
- invalid links in inline documentation HOT 2
- hoa encoder3D HOT 4
- typo "quantizer.lib" in stdfaust.lib HOT 1
- Make the behaviour of si.smoo SR-independent. HOT 3
- pm.flute_ui_MIDI is not in tune
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from faustlibraries.