Here's some other stuff that might be useful. Feel free to add to
effect.lib or where it could fit, and/or comment for improvements!
Optimizations? Improved readability of faust code?

/*****************************************************
    peakhold(mode,sig);

    Outputs current max value above zero.
    'mode' means:
    0 - Pass through. A single sample 0 trigger will work as a reset.
    1 - Track and hold max value.
*****************************************************/

peakhold = (*,_:max) ~ _;

/*****************************************************
    sweep(period,run);

    Counts from 0 to 'period' samples repeatedly, while 'run' is 1.
    Outsputs zero while 'run' is 0.
*****************************************************/

sweep = %(int(*:max(1)))~+(1);

/*****************************************************
    peakholder(holdtime, sig);

    Tracks abs peak and holds peak for 'holdtime' samples.
*****************************************************/

peakholder(holdtime) = peakhold2 ~ reset : (!,_) with {
    reset = sweep(holdtime) > 0;
    // first out is gate that is 1 while holding last peak
    peakhold2 = _,abs <: peakhold,!,_ <: >=,_,!;
};

-- 
/Jonatan
http://kymatica.com

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Faudiostream-devel mailing list
Faudiostream-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-devel

Reply via email to