[LAD] [ANN] LV2 beta3

torbenh at gmx.de torbenh at gmx.de
Fri May 11 01:45:36 UTC 2007


On Thu, May 10, 2007 at 11:44:54PM +0200, Fons Adriaensen wrote:
> On Thu, May 10, 2007 at 03:58:25PM +0100, Steve Harris wrote:
> 
> > I don't support it unless someone has a representation issue. You're  
> > not like to see if (fs == 44100) anyway, and if you did you'd want to  
> > hedge a bit: if (fs > 44090 && fs < 44110). If you have to write if  
> > (fs_num / fs_denom == 44100) then things are bit dodgy anyway.
> 
> Let me state once and for all, even it will not gain me any popularity:
> 
>   Anyone who thinks that writing a range check on a fraction A/B is too
>   difficult is very probably completely incompetent and should not waste
>   his/her time trying to write audio DSP code for a plugin.

Anyone who refuses to write LV2 extensions has a bad taste.
this is about aesthetics. 

we all love the sound, but look:


void Ladspa_Moogvcf2::runproc (unsigned long len, bool add)
{
    int   k;
    float *p0, *p1, *p2, *p3, *p4;
    float c1, c2, c3, c4, c5;
    float g0, g1, r, dr, w, dw, x, t;

    p0 = _port [0];
    p1 = _port [1];
    p2 = _port [2] - 1;
    p3 = _port [3] - 1;
    p4 = _port [4] - 1;
    g0 = exp2ap (0.1661 * _port  [5][0]) / 2;
    g1 = exp2ap (0.1661 * _port [10][0]) * 2;
    if (add) g1 *= _gain;

    c1 = _c1 + 1e-6;
    c2 = _c2;
    c3 = _c3;
    c4 = _c4;
    c5 = _c5;
    w = _w; 
    r = _r;

    do
    {
        k = (len > 24) ? 16 : len;
        p2 += k;
        p3 += k;
        p4 += k;
        len -= k;

        t = exp2ap (_port [7][0] * *p3 + _port [6][0] + *p2 + 10.71) / _fsam;
	if (t < 0.8) t *= 1 - 0.4 * t - 0.125 * t * t;
        else 
	{
            t *= 0.6; 
            if (t > 0.92) t = 0.92;
	}
        dw = (t - w) / k;

        t = _port [9][0] * *p4 + _port [8][0];
        if (t > 1) t = 1;
        if (t < 0) t = 0;
        dr = (t - r) / k;  

        while (k--)
	{
            w += dw;                        
            r += dr;

	    x = -4.5 * r * c5 + *p0++ * g0 + 1e-10;
//	    x = tanh (x); 
            x /= sqrt (1 + x * x);
            c1 += w * (x  - c1) / (1 + c1 * c1);            
            c2 += w * (c1 - c2) / (1 + c2 * c2);            
            c3 += w * (c2 - c3) / (1 + c3 * c3);            
            c4 += w * (c3 - c4) / (1 + c4 * c4);            

	    if (add) *p1++ += g1 * (c4);
	    else     *p1++  = g1 * (c4);
	    c5 += 0.5 * (c4 - c5);
	}
    }
    while (len);

    _c1 = c1;
    _c2 = c2;
    _c3 = c3;
    _c4 = c4;
    _c5 = c5;
    _w = w;
    _r = r;
}



you are IMO disqualified from aestetics discussions :)




-- 
torben Hohn
http://galan.sourceforge.net -- The graphical Audio language



More information about the Linux-audio-dev mailing list