Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

Fade In LFO - Best Technique

For general discussion related FlowStone

Fade In LFO - Best Technique

Postby Tronic » Thu Jul 17, 2014 2:59 pm

Which technique you use to implement a fade-in to a LFO?
The concept would be to have a single envelope with attack and control the amplitude-stream of the LFO,
but as you well know to implement an envelope is always linked to a stressful computing for CPU,
you know or use other techniques to do this?
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: Fade In LFO - Best Technique

Postby Exo » Thu Jul 17, 2014 4:58 pm

For a synth?
Something like this should be enough....
Code: Select all
streamin lfo;
streamin fadeInTime;
streamin sampleRate;
streamout fadeInLfo;
float increment;
float fadeIn;
stage(0)
{
   increment = fadeInTime / sampleRate ;
   fadeIn = 0; //reset for every new voice
}

fadeInLfo = fadeIn * lfo;

fadeIn = min(fadeIn + increment, 1);
   


That should work for you. I don't think there is a simpler way than that.
Flowstone Guru. Blog and download site for Flowstone.
Best VST Plugins. Initial Audio.
Exo
 
Posts: 426
Joined: Wed Aug 04, 2010 8:58 pm
Location: UK

Re: Fade In LFO - Best Technique

Postby KG_is_back » Thu Jul 17, 2014 5:37 pm

Or alternatively you may use exponential fade in (basically the same idea of implementation as Exo's but different envelope shape)

Code: Select all
streamin lfo;
streamin fadeCoeff; //this is number usually around 0.9 (always 0-1 range)
streamout out;

float cut=1;

out=lfo*(1-cut); //cut is 1 on start and decays to zero over time

cut= cut*fadeCoeff; //fade coeff controls how fast cud decays


fadeCoef has to be calculated too. Generally it is e^(-1/T) where T is release time in samples.

Note that Release time is not the time it takes for the decay to reach 0, but 0.3679 instead. (exponential curve never really reaches 0).
Exponential curves often sound more natural to human eat than linear.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Fade In LFO - Best Technique

Postby Tronic » Fri Jul 18, 2014 6:33 pm

Thx for this code hint.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm


Return to General

Who is online

Users browsing this forum: No registered users and 60 guests