Minimum delay time, # of delay stages needed for flanger?

Started by earthtonesaudio, January 22, 2009, 03:36:56 PM

Previous topic - Next topic

earthtonesaudio

So all the flanger circuits I've seen so far use a BBD with at least 512 stages, most use 1024.  Isn't this overkill?  I want to know how hard it would be to construct a delay line using common parts (op-amps and maybe some CMOS), and the minimum number of stages needed to get good flanger effects.

Here's what I'm thinking so far:
1. 10kHz bandwidth (guitar fidelity) requires a minimum sample rate of 20kHz (maybe higher if aliasing is bad).
2. A single (ideal) sample-and-hold stage clocked at 20kHz will produce a .05ms delay.
3. "Flanger delay times" seem to range anywhere from 0.1ms up to maybe 15ms, the majority sweep between (I think) 1 and 10ms.
4. So with a minimum clock frequency of 20kHz, we would need 20 s&h stages to achieve a 1ms delay time... which would be a lot if you're building each one, but still a lot less than 512 (or 1024, or 2058, or 4096!).

Here's where it gets confusing for me:
How much does the "flanger sound" have to do with delay time, and how much does it have to do with the ratio between max and min delay times?  From what I've been reading, it seems that a large ratio produces a larger sweep (A/DA has 40:1 sweep) and longer delay times produce perhaps "deeper" sounding effects.  Hard to find that info.
If the only thing that matters is the ratio of times, that's great, because it's easy to speed up a clock (easier than building more delay stages).

So some fundamental questions are still eluding me:
What (if any) is the minimum delay time needed to produce flanger tones?
What range of delay times will produce a good effect?
Once the minimum number of stages are determined, based on delay time and fidelity required, where would one look for a suitable chip?

I'd be thrilled if Mark Hammer would share some wisdom on this, as he seems to pop up quite often in flanger-related threads.   :)

oskar

I've had the same idea

This thread bumped up yesterday...
http://www.diystompboxes.com/smfforum/index.php?topic=38024.0

Which praises this 256-stage unit.
http://img.photobucket.com/albums/v474/mhammer/YAMAHA_FL10MII_page1.png

I read somewhere that the bucket brigade chips has parallel stages where they are pulled low before receiving a new value. I started sketching on a circuit like that but each stage became too elaborate for practical use. It just struck me that you could make it muck simpler in a short delay, passing the value with a simple 4017 clocking two 4066 chips for an 8-stage delay or... and this could be better, skip the bucket brigade and parallel load capacitors with 2 4052... 4051's. Then you would only have one buffer involved... 16 stages would be rather easy to achieve.
But I don't know if I want Mr. Hammer to share his wisdom on this at all. I kind of would like to keep on to that bubble for a bit longer   ;)

oldschoolanalog

Quote from: oskar on January 22, 2009, 04:16:26 PM
Which praises this 256-stage unit.
http://img.photobucket.com/albums/v474/mhammer/YAMAHA_FL10MII_page1.png
Did anybody notice that the schematic says "256 stage BBD" while the component list specifies MN3207?
MN3207=1024 stages. MN3209=256 stages.
Hmm...
Mystery lounge. No tables, chairs or waiters here. In fact, we're all quite alone.

earthtonesaudio

I guess I was inspired by the videos by ForcedFire where he showed two PT2399 chips can make convincing flanger-ish tones, despite the fact that the minimum delay time of those chips is around 30ms, way too long for "correct" flanger delay, yet it works.
Made me wonder if "way too short for correct flanger delay" would also work...

Mark Hammer

Your quickest and surest route to flanger-wisdom is to read this article: http://hammer.ampage.org/files/Hyperflange.PDF and to read the issues of DEVICE at my site, particularly the interview with the late Steven St. Croix http://hammer.ampage.org/files/Device1-3.PDF

Some flangers use the 256-stage MN3009 or MN3209, though if you can show me a place that regularly stocked them, I'd be very surprised.  The 1024-stage chips likely ended up being the default simply because they were so plentiful and available and they did the job.  Moreover, if a company was going to make a flanger, they were probably going to make a chorus, so they could buy a whack of 1024-stage chips and use them for both.

Both time and ratio are important.  To my mind, key to what makes a flanger a flanger is that the min delay time attainable be so short that any notches produced are way up in the almost undetectable range.  As the delay time is increased, not only the location of the notches changes, but the number of audible notches increases dramatically.  I like to describe it as the signal getting "infected" with notches and then gradually "cured", then re-infected, and so on.

So, while a flanger that sweeps from 1msec to 20msec, and another that sweeps from 500usec to 10msec both have a 20:1 sweep, the min delay in the first one still leaves us with audible notches even at the very top of the sweep.

At the max delay end, of course, the delay time needs to be short enough that your attention is allocated primarily to the notches, and NOT to an audible delay.  I could, of course, sweep a chorus pedal from 3msec to 60msec, but then for most of that sweep, your attention would be attracted by both the pitch change and the audible delay, with little chance that you focus on the notches except for a tiny portion of the sweep.

So, the sort of large ratio that permits one to go from no audible notches to loads of them, without stepping over the line into audible delay/lag, is one that starts out at a very very short min delay so that it can achieve a big ratio easily.  So, with a flanger that sweeps from 250usec to 15msec, we have a 60:1 ratio, but we're still well within a range where what we hear is mostly notches with just a bit of pitch change to distract us.

I have a couple of MN3209 chips.  One of these days I'd like to throw together a flanger and stuff one in there just to hear what 256 stages sounds like.  I know the Boss HF-2 Hi-Band Flanger uses an MN3204 which is 512 stages, but I've never seen one with 256 stages.  The Washburn SC-7 Stereo Chorus I have came with an MN3209 but I took it out and replaced it with an MN3207 for "thicker" chorus.  I should stick the 3209 back in and adjust the clock cap to produce delays too short for chorus.


Now, if you consider this "wisdom", be my guest.

oskar


Thomeeque

#6
 Hi!

To do similar experiments without need to build anything and with chance to try literally "everything" (influence of mixing polarities, different LFO shapes including random, TZF, "weird" values etc.) I have programmed simple emulator (already introduced in pictures thread ;)). Even it's not perfect, it helped me a lot. Feel free to try - you can try a lot from GUI and of course much more by altering source code ;)



http://thmq.mysteria.cz/digital_mistress

Few notes:

- Since I'm not expert on digital processing, few things I had implemented just from top of my head (e.g. I did not know, how to emulate LPF so I have just implemented it as a simple integrator, "frequency" parameter value is probably not the correct cutoff frequency), but I believe basic flanger effect principles should be verifiable by this.

- Delay fader sets "central" delay time and depth fader sets, how many times this central delay time will be stretched/squeezed at LFO min/max (btw. my sweep mechanism is also maybe discutable, maaaybe it's close to "Hypertriangular" way of Hyperflange, but don't rely on it too much, this is something I wanted to ask about later actually)

- Actual version's (1.1.3) minimal time is 0.1ms (delay=1ms, depth=10), but it's just about constants inside.
Do you have a technical question? Please don't send private messages, use the FORUM!

Thomeeque

#7
 I've updated it to allow much (100x) shorter delay times ("short" mode checkbox under DELAY fader) and user can select from wide range of possible BBD lengths or even type any value he wishes to try..

And, actually, it creates interesting flange effect even with 16 cell BBD! :o



thmq.mysteria.cz/digital_mistress/BBD16_demo/FLANGED.wav
thmq.mysteria.cz/digital_mistress/BBD16_demo/settings.gif
Do you have a technical question? Please don't send private messages, use the FORUM!

oskar

Thanks for the software   :)

If you're interested in coding for VST, I recommend you to check out www.synthmaker.com which is a
graphic programming utility for VST pluggins.
It also includes a code component window so you can do lower level programming.

Thomeeque

Quote from: oskar on January 23, 2009, 08:59:48 AM
Thanks for the software   :)

If you're interested in coding for VST, I recommend you to check out www.synthmaker.com which is a
graphic programming utility for VST pluggins.
It also includes a code component window so you can do lower level programming.

Sounds cool, I'll definitely check that, thanks!  :)
Do you have a technical question? Please don't send private messages, use the FORUM!

earthtonesaudio

Thanks Thomeeque for the demo of the 16 stage BBD!

I'm on a Mac, so I can't try your program myself.  Would you (or someone else with the program) mind uploading some samples showing how much you can do with 16 or fewer stages?  Like some clips with more regeneration, slower LFOs, etc.
I'd greatly appreciate it!

I'm digesting the Hyperflange article right now.   :)

Thomeeque

Quote from: earthtonesaudio on January 23, 2009, 11:40:17 AM
Thanks Thomeeque for the demo of the 16 stage BBD!

I'm on a Mac, so I can't try your program myself.  Would you (or someone else with the program) mind uploading some samples showing how much you can do with 16 or fewer stages?  Like some clips with more regeneration, slower LFOs, etc.
I'd greatly appreciate it!

I'm digesting the Hyperflange article right now.   :)

You're welcome! :)

Since it's .NET 2.0 application, maybe you can run it on Mac: http://www.go-mono.com/mono-downloads/download.html (two friends of mine were able to run it via mono framework on Linux - there were some minor issues with GUI layout, but it worked) !!

Good luck! :) T.
Do you have a technical question? Please don't send private messages, use the FORUM!

Thomeeque

Quote from: earthtonesaudio on January 23, 2009, 11:40:17 AM
I'm digesting the Hyperflange article right now.   :)

That reminds me, that I should stop by our office printer  :icon_mrgreen:
Do you have a technical question? Please don't send private messages, use the FORUM!

oskar

Quote
And, actually, it creates interesting flange effect even with 16 cell BBD!

How do I know how many stages I'm working with in the short mode?

oskar

Sometimes the program is coming almost to an halt(it actually freeze up, I don't know if I can wait it out but 10minutes wouldn't do a difference) I'm on a 600MHz/256Meg ram computer. Are you using some sort of recursive algorithm?

Mark Hammer

First, my shame.  I have a Hyperflange board that I purchased in 1992 or so, fully populated, in a completely machined rack-size chassis, but I have never completely wired it up to hear how it sounds.  I have the CEM3340 and the SAD-1024.  This summer, I promise, guys...okay? :icon_redface:

Second, unless you can find a CEM3340 (much harder than scoring an SAD1024), the board and circuit will be useless to you...although the article is well worth reading for the technical info.

Third, the CEM3340 is not the only way to implement a hypertriangular LFO for controlling a high frequency VCO for flanging purposes. http://hammer.ampage.org/files/hypertriangleclock.gif  The basic audio portion of the Hyperflange can be adapted to a different control circuitry.  I'm not the one to do it, but it can be done.

earthtonesaudio

Well, I tried to run the flanger program but had no luck.  I guess I'll have to do it the old fashioned way (breadboard it).  I'm nowhere near the point of implementing an LFO yet, but when I do I'll probably try that hypertriangular shaper.

Thomeeque

Quote from: oskar on January 23, 2009, 01:30:06 PM
Quote
And, actually, it creates interesting flange effect even with 16 cell BBD!

How do I know how many stages I'm working with in the short mode?

"Short mode" is mayby too fancy name leading to confusion, "short" checkbox does nothing more than changing range of Wet Delay time fader (from original 1-100ms to 10us-1ms), everything else including stages count remains untouched.

All used parameters are visible in Processing Parameters frame, stages count is rendered in parentheses on Wet Delay line (e.g. BBD: 512).

To add e.g. 20 stages just click to the BBD length select box and type 20 inside manually.

Do you have a technical question? Please don't send private messages, use the FORUM!

Thomeeque

#18
Quote from: oskar on January 23, 2009, 01:33:41 PM
Sometimes the program is coming almost to an halt(it actually freeze up, I don't know if I can wait it out but 10minutes wouldn't do a difference) I'm on a 600MHz/256Meg ram computer. Are you using some sort of recursive algorithm?

OK, first I have to admit that it's far to be optimized program, it could be probably significantly faster if optimized, but it was testing lab for me, I didn't spent to much time on these things :(

Now bit about how it works and why it probably almost freezes. There is no recursion - what program does is "jumping" straight forward by time points of important events - there are only two types of events: 1st is output sampling event (typically each 1/48000 sec), where program counts actual output value and saves it to output file, and 2nd is what I call "BBD iteration" event, where is counted input value to be put into BBD input, LFO is fed be value from BBD output and BBD shifts by one cell - number of these events depends on actual BBD sampling frequency. What probably happened in your case was, that you have set very short delay time and left long BBD (like 512), which leads to very high sampling frequency (e.g. to go thru 512 cells in 50us means to sample 10240000 samples per second = 10240000 BBD iterations for one second of source WAV - it keeps CPU pretty busy ;)). Btw. as sampling rate is altered by LFO, speed of processing visibly changes with LFO signal :)

Of course, it could have normally crashed as well, but it never happened to me..
Do you have a technical question? Please don't send private messages, use the FORUM!

oskar

Yes, it works with shorter stages... thanks!... and I've seen how the processing speed changes with lfo setting. Pretty!    ;)