How to set the "duration" parameter for a flanger with LFO oscillator I am reading this book Designing Audio Effect Plugins in C++: For AAX, AU, and VST3 with DSP Theory. Here I implemented the Flanger effect. Quick summary: A flanger effect is basically a echo effect but the delay parameter is changed with an LFO oscillator to give the &quot;flanging&quot; sound.
Here is the graph:

My problem is this version of flanger only has the following properties:

In modern DJ equipments you see flanger with options such as &quot;1beats,2beats,4beats...&quot;. What I noticed is The smaller lfoRate is the longer my flanger effect becomes. So If I set lfoRate around 10.26, my flanger becomes 1/8beats flanger. The book does not mention anything related to this. So I wonder what is the relationship between lforate and &quot;Xbeats&quot; of flanger. Lets say that my music is 128 bpm, is there is a special formula which is used to calculate lfoRate so that I have 4 beats flanger?
The LFO rate is the speed of the delay modulation. One full cycle is going from &quot;down&quot; to up&quot; back to &quot;down&quot; again. It's in Hz, i.e. &quot;per second&quot;. Let's says the music is 120 bpm and your LFO rate is 0.5Hz. 120 pbm is 2 beats per second or 4 beats per flanger cycle.
Beats Per Cycle = Music_speed/60/flanger_rate