Combined LFO/BBD Clock chip for Chorus/Flanger

Started by ElectricDruid, January 15, 2014, 01:14:42 PM

Previous topic - Next topic

ElectricDruid

Hi All,

I've been working on a new chip. It's a replacement for the MN3102 BBD clock chip done with a PIC. The benefit of this is that I can include the LFO on the chip as well, and can add a load of extra features that you don't usually get. So far I've got:

1) 25KHz to 500KHz clock output
2) LFO with eight waveforms - triangle, sine, hypertriangle, random (S&H), sine+octave, up/down stair steps, manual (see below) - I'm missing one
3) Manual mode - uses the Rate knob to set the delay time (good for static flanger effects)
4) CV control of LFO Rate, LFO depth, and LFO waveform
5) Top-down or Bottom-up selection for how the depth affects the clock rate

I've got a few more things I'd like to include, like:

6) Tap tempo
7) Clock Range selection to make it easier to set up for Chorus vs Flanger

But I'm posting this because I'd like to hear your ideas too. I need one more waveform, for starters. What should it be? What other options would you like to see?

I've got the prototype working on my breadboard with an MN3209 256-stage BBD, which makes for an excellent flanger, with a range from 0.25msecs out to 5msecs (20:1 range). The whole thing is three chips: the LFO/Clock, the BBD, and a quad op-amp (two mixers, two 12dB filters). I tried to make it simpler, but I can't!

I've also tried it with a MN3207 1024-stage BBD, and that works fine too - that'd be the chip I'd use for chorus. Presumably there's some limit to how many stages it'll drive (due to the BBD's clock input capacitance) but I haven't found it yet. I should give it a go with MN3205 4096-stage and see what happens.

Incidentally, at some point after I started work on this, I was reading some posts on here trying to find details of the Electric Mistress' filtering, and discovered that other people have had the same idea - do an LFO+Clock on a uC. So respect due to Eduard SolderingIronHands and others who discussed the idea long before it had occurred to me!

http://www.diystompboxes.com/smfforum/index.php?topic=91981.msg798163#msg798163

Thanks,
Tom



midwayfair

This sounds awesome! And if it works with an 05 chip, that will be even more awesome.

For the missing waveform: I really like the "dips" from the TAPFLO. It's subtle in a way that turning down the depth didn't accomplish. It might not be the most exciting thing to add by any means, though.
My band, Midway Fair: www.midwayfair.org. Myself's music and things I make: www.jonpattonmusic.com. DIY pedal demos: www.youtube.com/jonspatton. PCBs of my Bearhug Compressor and Cardinal Harmonic Tremolo are available from http://www.1776effects.com!

Govmnt_Lacky

#2
Sounds like a GREAT idea! Definitely gonna follow this.

Will this LFO/Clock chip be available in DIP format or are we talking SMT only?

Also, you might want to expand the range of the clock. Probably downward to ~25KHz and upward to at least 1MHz. This would cover the spectrum for a lot of chorus/flanger territory.

For reference, the MXR Flanger gets up to ~950KHz. The EHX flangers can go down around 30-40KHz.
Good Luck  ;)
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

Mark Hammer

I think a lot of folks would love to be able to hit a momentary switch and have a sweep start at the top or at the bottom, and proceed in ramp-like fashion, as sort of a one-shot.  Now, whether that is best accomplished with a linear ramp or sawtooth, or some sort of exponential one, is another matter.   :icon_wink:

I'm not so sure about the up/down stair step.  Most of what people might want a stepped change for is to be found in the S&H/random mode.  Stepped is also the sort of thing that really only works well if the speed and steps occur fast enough.  I imagine it would be rather tricky to program, but a random S&H mode that had glissando, rather than a hard step, would be appealing.  Alternatively, since one would have little control over the virtual noise-source that dictates the random steps, maybe you want a "more" and "less" random version of random.

But this is a brilliant and highly commendable effort on your part.  I have a couple of MN3209's sitting at home, waiting for their call.  Maybe this can finally send them into active duty.

Govmnt_Lacky

Quote from: Mark Hammer on January 15, 2014, 01:27:20 PM
I have a couple of MN3209's sitting at home, waiting for their call.  Maybe this can finally send them into active duty.

Right there with you Mark!

I have a case full of Reticon R510X series BBDs that are dying to be used. This might be the ticket  ;)
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

midwayfair

Quote from: Mark Hammer on January 15, 2014, 01:27:20 PM
I think a lot of folks would love to be able to hit a momentary switch and have a sweep start at the top or at the bottom, and proceed in ramp-like fashion, as sort of a one-shot.  Now, whether that is best accomplished with a linear ramp or sawtooth, or some sort of exponential one, is another matter.

I think a tap tempo single-tap reset like in the TAPLFO would do this --- it would start at the "top of the measure" so to speak (I believe the TAPLFO resets to the "fully on" half of the cycle). If it's hard resetting from any particular place in the LFO sweep, it'll make a little noise in the delay signal and then go back to sweeping at whatever rate it's set at.

One problem I can see with this is that resetting with the tap tempo means that you can't do that sort of effect more than once every few seconds, or you'd set a new rate.
My band, Midway Fair: www.midwayfair.org. Myself's music and things I make: www.jonpattonmusic.com. DIY pedal demos: www.youtube.com/jonspatton. PCBs of my Bearhug Compressor and Cardinal Harmonic Tremolo are available from http://www.1776effects.com!

ElectricDruid

Quote from: Govmnt_Lacky on January 15, 2014, 01:27:04 PM
Will this LFO/Clock chip be available in DIP format or are we talking SMT only?

No, the chip is available as a DIP. I've been using the 16F1503, which is a 14-pin DIP, but you can buy it in SOIC or TSSOP too if you *wanted* it tiny. I'll put code up on my website like I did before, and I'll probably sell programmed chips to people who don't want to mess around with programming PICs (that's the bit where I become unbelievably rich and move to a yacht in the Carribean ;).

Quote
Also, you might want to expand the range of the clock. Probably downward to ~25KHz and upward to at least 1MHz. This would cover the spectrum for a lot of chorus/flanger territory.

Sorry, that can't be done. 500KHz is as fast as the PIC can go. MN3209 is only specified for clocks to 100KHz, and MN3207 is only supposed to go up to 200KHz anyway, so I'm guessing that the MXR uses an unobtainium SAD-something. In practice, the MN32xx's will go up to 450KHz perfectly, but above that, the output signal level starts to drop off alarmingly, so 500KHz is about as far as the BBDs will go.

Quote from: midwayfair on January 15, 2014, 01:36:27 PM
I think a tap tempo single-tap reset like in the TAPLFO would do this --- it would start at the "top of the measure" so to speak (I believe the TAPLFO resets to the "fully on" half of the cycle). If it's hard resetting from any particular place in the LFO sweep, it'll make a little noise in the delay signal and then go back to sweeping at whatever rate it's set at.

One problem I can see with this is that resetting with the tap tempo means that you can't do that sort of effect more than once every few seconds, or you'd set a new rate.

I might be able to put it on a different pin. I've still got one or two free. You're right about a single tap resetting to the 'top' of the waveform though. The TapLFO waveforms were arranged so that the 'start' point wasn't necessarily 0 degrees (e.g. sine wave starts at 90 degrees, etc) and I could do similar here.

T.

Govmnt_Lacky

I see where you went there Druid! Good show!  ;D  ;) It is the SAD1024 that could go up to 1.2MHz.

What about TZF considerations. Could this be a possible solution? (Sorry but I am not well versed in TZF... just thought I would throw it out there  ;D)
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

Mark Hammer

Quote from: ElectricDruid on January 15, 2014, 01:43:48 PM
Sorry, that can't be done. 500KHz is as fast as the PIC can go. MN3209 is only specified for clocks to 100KHz, and MN3207 is only supposed to go up to 200KHz anyway, so I'm guessing that the MXR uses an unobtainium SAD-something. In practice, the MN32xx's will go up to 450KHz perfectly, but above that, the output signal level starts to drop off alarmingly, so 500KHz is about as far as the BBDs will go.

The datasheet specs for the MN3xxx chips are predicated on them being clocked in unaided fashion by an MN3101/3102.  The current drive of those Panasonic chips is insufficient to overcome the input capacitance of the clock pins on the BBD, and results in a less than square clock pulse when you start to go too high.

If suitably buffered, however, a mundane MN3007 or MN3207 can be comfortably clocked up in the 1Mhz range.  I've witnessed it in person.  The thing with the Reticon "unobtainiums" is that their clock pin input capacitance is low enough that they can manage those ultra-high clock frequencies without needing much help.  Provide the help, and the MN3xxx chips can do the same tricks.

As you note, however, the clock-rate limitation is not found in the BBD here, but in the PIC itself.  Still, if another 40-cent CMOS chip allows for the full clock-range potential of the PIC to be exploitable, why not?

ElectricDruid

Quote from: Mark Hammer on January 15, 2014, 01:54:16 PM
The datasheet specs for the MN3xxx chips are predicated on them being clocked in unaided fashion by an MN3101/3102.  The current drive of those Panasonic chips is insufficient to overcome the input capacitance of the clock pins on the BBD, and results in a less than square clock pulse when you start to go too high.

If suitably buffered, however, a mundane MN3007 or MN3207 can be comfortably clocked up in the 1Mhz range.  I've witnessed it in person.  The thing with the Reticon "unobtainiums" is that their clock pin input capacitance is low enough that they can manage those ultra-high clock frequencies without needing much help.  Provide the help, and the MN3xxx chips can do the same tricks.

Did you need to compensate for a level drop at those speeds, Mark, or was the level drop I saw because of the clock pulses starting to round off? (In which case, I assume it wouldn't appear with better buffering)

Quote
As you note, however, the clock-rate limitation is not found in the BBD here, but in the PIC itself.  Still, if another 40-cent CMOS chip allows for the full clock-range potential of the PIC to be exploitable, why not?

It's not that simple, unfortunately. It's not a question of buffering the PIC's output, but rather of the maximum rate that the NCO peripheral can be clocked on the PIC. I've been using the internal 16MHz clock, which gives a 500KHz max NCO output (at least after it's been separated into the two-phase clock that's needed for a BBD). If you were using an external clock, you could push it up to 20MHz, which would give you 625KHz, but it's not a big improvement, and it eats another pin.

Govmnt_Lacky

Quote from: ElectricDruid on January 15, 2014, 02:12:55 PM
It's not that simple, unfortunately. It's not a question of buffering the PIC's output, but rather of the maximum rate that the NCO peripheral can be clocked on the PIC. I've been using the internal 16MHz clock, which gives a 500KHz max NCO output (at least after it's been separated into the two-phase clock that's needed for a BBD). If you were using an external clock, you could push it up to 20MHz, which would give you 625KHz, but it's not a big improvement, and it eats another pin.

Probably just me but...

I would be interested in a version that has a single clock output. The Reticon R510X chips take a single clock input and internally generate the second clock.  :icon_lol:

But... like I said... thats just me and there wouldn't be a general need for that function as most BBDs out there need 2 clock inputs  :icon_cry:
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

Mark Hammer

Quote from: ElectricDruid on January 15, 2014, 02:12:55 PM
Quote from: Mark Hammer on January 15, 2014, 01:54:16 PM
The datasheet specs for the MN3xxx chips are predicated on them being clocked in unaided fashion by an MN3101/3102.  The current drive of those Panasonic chips is insufficient to overcome the input capacitance of the clock pins on the BBD, and results in a less than square clock pulse when you start to go too high.

If suitably buffered, however, a mundane MN3007 or MN3207 can be comfortably clocked up in the 1Mhz range.  I've witnessed it in person.  The thing with the Reticon "unobtainiums" is that their clock pin input capacitance is low enough that they can manage those ultra-high clock frequencies without needing much help.  Provide the help, and the MN3xxx chips can do the same tricks.

Did you need to compensate for a level drop at those speeds, Mark, or was the level drop I saw because of the clock pulses starting to round off? (In which case, I assume it wouldn't appear with better buffering)

Quote
As you note, however, the clock-rate limitation is not found in the BBD here, but in the PIC itself.  Still, if another 40-cent CMOS chip allows for the full clock-range potential of the PIC to be exploitable, why not?

It's not that simple, unfortunately. It's not a question of buffering the PIC's output, but rather of the maximum rate that the NCO peripheral can be clocked on the PIC. I've been using the internal 16MHz clock, which gives a 500KHz max NCO output (at least after it's been separated into the two-phase clock that's needed for a BBD). If you were using an external clock, you could push it up to 20MHz, which would give you 625KHz, but it's not a big improvement, and it eats another pin.
First, what I meant was that the perimeter of what you described the PIC as being able to do was beyond the perimeter of what the appnotes say the BBD is able to do.  Adding buffering would allow the "untinkered" PIC to do all of what it is able to do.  It may not be 1mhz clocking, but getting an MN3209 down to under a half or third millisecond is dramatic enough.

Second, what I witnessed was Mike Irwin's MN3007 adaptation of the A/DA flanger.  There was no discernible change in level as it swept to ever shorter delays.  Keep in mind that it is at the shortest delays that any flanger's worth is displayed.  If the BBD loses any substantial level at highest clock frequencies, then the intensity of the effect should suffer, as the dry/wet balance strays from a perfect 50/50 blend.  I didn't hear any of that.

ElectricDruid

Quote from: Mark Hammer on January 15, 2014, 03:07:39 PM
First, what I meant was that the perimeter of what you described the PIC as being able to do was beyond the perimeter of what the appnotes say the BBD is able to do.  Adding buffering would allow the "untinkered" PIC to do all of what it is able to do.  It may not be 1mhz clocking, but getting an MN3209 down to under a half or third millisecond is dramatic enough.

Second, what I witnessed was Mike Irwin's MN3007 adaptation of the A/DA flanger.  There was no discernible change in level as it swept to ever shorter delays.  Keep in mind that it is at the shortest delays that any flanger's worth is displayed.  If the BBD loses any substantial level at highest clock frequencies, then the intensity of the effect should suffer, as the dry/wet balance strays from a perfect 50/50 blend.  I didn't hear any of that.

I'd be interested to know how the MN3007 and MN3207 differ when pushed. I doubt they're identical. I've been using MN3207/9, because they'll run on the same +5V supply as the PIC, which means the PIC can drive the BBD directly. I've been running the PIC outputs straight into the BBD, with no buffering, and it's ok like that to 500KHz - e.g. even "untinkered" you can go to 500KHz. If you look at it on the oscilloscope, you can see that the BBD signal does start to drop off above 450KHz, but in dB terms it isn't that serious - a handful of dB, not as much as 6dB/x0.5. I can't hear it in the output.
To push it up further, you'd probably need buffering, but since the PIC won't go higher anyway, and since part of my aim was to make a full-featured flanger as simple as possible, I wanted to leave the buffers out. Also, I didn't think 0.25msecs was bad - that's 4KHz, which is pretty high for geetar. I was testing it with a two-ramp-oscillator sequencer loop from my Pro-One and it loves a rich signal like that.

Thanks,
Tom

Govmnt_Lacky

Could you use one of the unused PIC outputs to drive an alternating clock to a seperate BBD to achieve TZF?

Am I asking stupid questions about this?  :icon_redface:
A Veteran is someone who, at one point in his or her life, wrote a blank check made payable to The United States of America
for an amount of 'up to and including my life.'

Mark Hammer

Quote from: ElectricDruid on January 15, 2014, 03:30:43 PM
Quote from: Mark Hammer on January 15, 2014, 03:07:39 PM
First, what I meant was that the perimeter of what you described the PIC as being able to do was beyond the perimeter of what the appnotes say the BBD is able to do.  Adding buffering would allow the "untinkered" PIC to do all of what it is able to do.  It may not be 1mhz clocking, but getting an MN3209 down to under a half or third millisecond is dramatic enough.

Second, what I witnessed was Mike Irwin's MN3007 adaptation of the A/DA flanger.  There was no discernible change in level as it swept to ever shorter delays.  Keep in mind that it is at the shortest delays that any flanger's worth is displayed.  If the BBD loses any substantial level at highest clock frequencies, then the intensity of the effect should suffer, as the dry/wet balance strays from a perfect 50/50 blend.  I didn't hear any of that.

I'd be interested to know how the MN3007 and MN3207 differ when pushed. I doubt they're identical. I've been using MN3207/9, because they'll run on the same +5V supply as the PIC, which means the PIC can drive the BBD directly. I've been running the PIC outputs straight into the BBD, with no buffering, and it's ok like that to 500KHz - e.g. even "untinkered" you can go to 500KHz. If you look at it on the oscilloscope, you can see that the BBD signal does start to drop off above 450KHz, but in dB terms it isn't that serious - a handful of dB, not as much as 6dB/x0.5. I can't hear it in the output.
To push it up further, you'd probably need buffering, but since the PIC won't go higher anyway, and since part of my aim was to make a full-featured flanger as simple as possible, I wanted to leave the buffers out. Also, I didn't think 0.25msecs was bad - that's 4KHz, which is pretty high for geetar. I was testing it with a two-ramp-oscillator sequencer loop from my Pro-One and it loves a rich signal like that.

Thanks,
Tom

Well, in which case, I think you've pretty much hit asymptote.  A min delay of 250us is well beyond what the vast majority of MN3101/MN3007 or MN3102/MN3207-based flangers will do.  And it would seem that the current drive of the PIC exceeds what the MN310x chips deliver, so problem solved.  Now that I get that part, yeah, no need to tinker or assist the clock.  Job's done.  :icon_biggrin:

The Tone Core Liqui-Flange has some of the modulation waveforms you're implementing.  Its "step" mode is essentially S&H, and the "random" mode is a smoother S&H that  transitions smoothly from one random high or low point int he sweep cycle to another one.  The Saw up and Down are interesting as is the envelope and triggered waveform modes.  Unfortunately, the envelope and trigger modes require that a DSP or PIC keep tabs on the state of the input signal, where I gather your implementation treats the LFO and audio path as largely independent entities....which makes perfect sense given the limitations of the PIC itself.

armdnrdy

Quote from: ElectricDruid on January 15, 2014, 02:12:55 PM

It's not that simple, unfortunately. It's not a question of buffering the PIC's output, but rather of the maximum rate that the NCO peripheral can be clocked on the PIC. I've been using the internal 16MHz clock, which gives a 500KHz max NCO output (at least after it's been separated into the two-phase clock that's needed for a BBD).

What if you use the PICs internal clock and separate it into the two-phase clock externally.

The Mutron Flanger uses this arrangement with a 4046 for the clock and a 4011 to split and buffer.



Great work by the way!
I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

ElectricDruid

Quote from: armdnrdy on January 15, 2014, 04:17:33 PM
Quote from: ElectricDruid on January 15, 2014, 02:12:55 PM
It's not that simple, unfortunately. It's not a question of buffering the PIC's output, but rather of the maximum rate that the NCO peripheral can be clocked on the PIC. I've been using the internal 16MHz clock, which gives a 500KHz max NCO output (at least after it's been separated into the two-phase clock that's needed for a BBD).
What if you use the PICs internal clock and separate it into the two-phase clock externally.
The Mutron Flanger uses this arrangement with a 4046 for the clock and a 4011 to split and buffer.

This is possible, but it wouldn't gain you anything. The internal NCO has a "Fixed Duty Cycle" mode, which toggles the output at the NCO rate - e.g. it makes a square wave. This is exactly what you'd do externally, since if you wanted it faster, you'd be getting a narrow pulse, and have to feed it to a flip-flop to square it up. I've got this set up so it feeds the CWG "Complementary waveform generator" which generates a two-phase clock and adds the appropriate dead bands. The small amount of time when *both* clocks are off helps. It seems to give the switches in the BBD time to really go off, and lets you push the clock higher.
All in all, the internal peripherals are *too* perfect for this job *not* to use them, and I can't see how I'd get a better result using anything external.
Usual disclaimers apply, of course: Microchip's data sheets aren't exactly the most blindingly obvious texts I've ever seen, and my own ability to get the stick by the sticky end is not to be under-estimated, so there may be some way to improve this that I haven't seen, didn't understand, or simply missed on page four-hundred-and-twenty-whatever!

Quote
Great work by the way!
Thanks!

Tom


armdnrdy

Hey Tom,

The reason I'm inquiring about a higher clock rate is:

You are testing the MN3209 for a flanger effect and a MN3207 for a chorus effect.

There are designs which "overclock" and buffer a 1024 stage device to achieve a faster delay time better suited for flanging.

One reason this is done is because of the availability, or should I say the "non" availability of 256 stage and 512 stage BBDs in the market place.

There are a few companies that I am aware of that are producing BBDs which are made available to the DIY community.
These are Cool Audio, and Shanghai Belling. The BBD models are limited to equivalents of MN3205, MN3207, and MN3208.

Those three BBD models can be sourced from a small amount of reputable online merchants.

As far as the MN3209 goes....they are no longer in production, but "NOS" pieces can be sourced through sellers on ebay.
As we all know, purchasing BBDs from ebay can be a gamble as to whether or not you will be receiving the actual listed BBD or a relabeled, more commonly available model.

So you see the dilemma. A 500KHz clock can be limiting for certain designs.

I am a complete neophyte when it comes to PICs. Is it possible to manipulate the clock frequency with external components?

I just designed a new fuzz circuit! It almost sounds a little different than the last fifty fuzz circuits I designed! ;)

ElectricDruid

#18
One other significant feature that I've done that I forgot to mention:

The Clock modulation is exponential in character, based on octaves. This means that if you use a normal triangle wave for the LFO, you get the same smooth effect you get using a hypertriangle on a normal flanger. The whole point of the hypertriangle waveform is to compensate for the linear clock modulation by applying an exponential function to the triangle waveform. So if you don't use linear modulation, but rather use exponential "V/Oct" modulation, you don't need to bother with hypertriangles to get an even sweep.

The typical linear clock modulation is also the reason why chorus effects get "warbley" as the depth increases when the delay time gets longer. If the LFO modulates the clock by +/-25KHz around a 200KHz centre point, that's only 12% or so variation. If it does the same around a 50KHz clock (lower clock frequency equals longer delay, remember) then that +/-25KHz shifts the pitch by 50%. Keeping the modulation in the exponential world of octaves removes this problem - half an octave of mod depth is still half an octave whether it's from 50KHz or 200KHz.

Thanks,
Tom



Mark Hammer