BBD based harmonizer. Results, measurements and comments.

Started by Dirk_Hendrik, July 21, 2005, 06:37:58 AM

Previous topic - Next topic

Dirk_Hendrik

A few months ago I ran into the schematic for an Analog Harmonizer on Mark Hammer's page : http://ampage.org/hammer/files/AnalogHarmonizer.ZIP

As Mr. Hammer states already it looks at least like a serious draw. As the idea of doing pitch changes using BBD's has been offered here multiplle times I decides to give the design a test to find out the pro's and cons of the idea.

First, in short, the principle of the design;
The input signal is sampled by 2 BBD's connected with their inputs in parallel. However the clock used for these 2 BBD's will change periodically from "normal" to double speed. When one is clocked normally the other one is at double. By changing the clock to double speed samples taken at normal rate will be played at double speed and therefore sound an octave higher. When all samples are played the clock will go back to the normal speed and the other BBD will be clocked at double speed.
The problem is that if, let's say 10milliseconds of recorded samples are played at double rate they'll be all played in 5 milliseconds. Since the desire is to have a continuous pitch changed note the trick in the design is that while the samples are played a double rate this stream of samples is clocked into a third BBD at the same speed. At the moment all original samples were played the first samples arrive at the output of the 3rd BBD and are played back.

Which comes back in hardware looking like this:

Controlpanel and clockgeneration.


The BBD's filtering and multiplexing


So,

Having built that, does it work?
Well, the first thing I did was converting the original design from MN3007 to MN3207 BBD's from a cost perspective. Those output resistors should also  go to ground....(fool)....easily fixed.
The design provides proper bias trimming for the BBD's so distortion was trimmed out easy as well.  With the "noise cancel" trimmers the DC levels in can be trimmed to be all equal for the output signals of the 3 BBD's. Important since the rate at which the output signals are switched to be audio out is in the audible range. Noise level can be trimmed but a LF noise remains available.

Which left me with a couple of questions.
The octave down circuitry seemed to work but the "up" did not and was a constantly shifting mix between octave and input frequency. Scoping showed that the output signal of the 3rd delayline came too late. At the moment one of the 2 input delaylines was capable of presenting it's octave up signal to the output the 3rd delayline offered it's output signal as well which means it was 1024 clockcycles late. Based on the clock pesented form the master clock it should be in time..... except for error 1: A MN3201 BBD driver divides the clock rate by 2.

So, on the master clock circuit all clock signals were changes to have an extra division by 2, extremely degrading sampling rate but ok for testing purposes and yes.... the circuit worked.....

....let alone for a still annoying LF hum from the BBD's outputs beiing switched (at some 40 Hz rate).  This more or less was related to what I consider error number 2.  It's assumed that the output level for all 3 BBD's is exactly the same. This was not the case:

C1: Input, C3: Output
It's clear the amplitude changes periodically between 2 levels

By changing the output resistors of the BBD's (the 56K ones) to a trimmer the levels could be adjusted making the whole quiet.

So, does it work now?
Yes and no. The whole setup sounds great for some notes but out of tune and frequencydistorted for most. At first I did not understand how something that is not input frequency dependent and has a pretty stable clock can sound out of tune when played back at double speed.
First a picture of a good sounding note. It can be seen that C3 (output) is a proper octave of C1 (Input).


Testing this was easy. Conect the generator and listen to the output signal.  The example above sounded "good". By adjusting the frequency on the generator a bad or out of tune note could be found which looked like this:


What happens is that the periods of the input sine don't fit the sampled length. When a the sample is replayed it starts at the wrong position causing a) a glitch and b) frequency shifts which give the out tune effect.
I've placed 2 zoom channels on the C3 signal which show that at the glitch point the sine wave would continue perfectly if it wasn't broken off and replayed.

So,
Wrapping up, Is a BBD based pitch shifter/harmonizer possible?
In my opinion, no. There's no way in which to avoid glitches in the signal or the out of tune effect. Apart from that it requires a lot of controlpoints to get the thing kind of silent.
More stuff, less fear, less  hassle and less censoring? How 'bout it??. To discuss what YOU want to discuss instead of what others decide for you. It's possible...

But not at diystompboxes.com...... regrettably

puretube


Andi

First off, great build - that's a complex looking bit of kit.

Quote from: Dirk_HendrikThere's no way in which to avoid glitches in the signal or the out of tune effect.

I'm wondering if that'd be a selling point to some people though - plenty of lovers of "nasty" sounding boxes out there.

StephenGiles

Absolutely fascinating, thanks for all that. About 25 years ago, ETI were dumb enough to pay me (not very much) for a rough design of a BBD Harmoniser in their Tech Tips section!
Stephen
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

Mark Hammer

I echo Ton's "WOW" and am absolutely, unreservedly, and completely humbled by your diligence here.  I'm just glad you're on our side.  Um, you ARE on our side, right? :shock:

If you haven't done so, read the review of the A/DA Harmonizer pedal that was published in DEVICE 26 years ago ( http://hammer.ampage.org  around page 10 or 11)

Dirk_Hendrik

Thanks for all the compliments :oops:
@ Mark,
Thanks for putting my thoughts in this direction by posting this obscure Japanese schematic. The corrections you made are correct.


@ more scopedumps, just for the fun:
Turning the frequency down to the point that 1 period takes longer than the BBD can store:


And a measurement taken on the output of BBD "A" (refer to the schematic). The response of the signal on the clock changes is very visible.
More stuff, less fear, less  hassle and less censoring? How 'bout it??. To discuss what YOU want to discuss instead of what others decide for you. It's possible...

But not at diystompboxes.com...... regrettably

sir_modulus

That's utterly amazing! You've sure done a lot of work for us! (I could barely even read the schemo  :oops: )

Cheers,

Nish

mojotron

Quote from: Mark HammerI echo Ton's "WOW" and am absolutely, unreservedly, and completely humbled by your diligence here.  I'm just glad you're on our side.  Um, you ARE on our side, right? :shock:

If you haven't done so, read the review of the A/DA Harmonizer pedal that was published in DEVICE 26 years ago ( http://hammer.ampage.org  around page 10 or 11)

Dirk - dude! That is cool!

I really like the integration of the pots and connectors onto the board too -excellent work in every detail. Thanks for sharing this - I'll have some questions in time, for now I just wanted to express how inspiring this is - Thanks!!!

Mark - I'm absolutely, unreservedly, and completely humbled by your site every time I visit - what a gold mine!! Thanks!!!

Vsat

Dirk,
Thanks for posting the analysis and photos! Built a simple harmonizer  once using a 12 MHz 8031 microcontroller plus 2716 + DAC08 + ADC0804 . It was also very glitchy due to samples not butting together properly. If the processor was faster could have tried a crossfade function to minimize the glitch, or to determine the period of the input signal and adjust the sample window duration to  match. The processor was running as fast as it could though, to add these functions would have required additional processors.  Microcontrollers/DSP much faster nowadays, could make a good project for someone who is interested in this topic. There are dozens of recent patents on this topic from companies such as IVL Technologies for glitch-free and intelligent pitch shifters.

BTW one possibility for a clean analog pitch shifter is to use a vocoder - patch each analysis channel to the corresponding synthesis channel one octave up, to get an octave-up pitch shift etc.
Cheers, Mike

puretube

for decades, there have been numerous attempts to get rid of "glitching"...

(until the "Event*ders" succeeded, obviously)

[edit]: oops - just missed that Vsat post  :lol:

analogmike

HI,

I think the early MXR rack mount units used BBDs for pitch shifting. Not very good though! MXT pitch transposer I think.

the MXR pitch shift doubler uses BBDs for sure but it's just a chorus unit.
DIY has unpleasant realities, such as that an operating soldering iron has two ends differing markedly in the degree of comfort with which they can be grasped. - J. Smith

mike  ~^v^~ aNaLoG.MaN ~^v^~   vintage guitar effects

http://www.analogman.com

Dirk_Hendrik

Quote from: VsatDirk,
Thanks for posting the analysis and photos! Built a simple harmonizer  once using a 12 MHz 8031 microcontroller plus 2716 + DAC08 + ADC0804 . It was also very glitchy due to samples not butting together properly. If the processor was faster could have tried a crossfade function to minimize the glitch, or to determine the period of the input signal and adjust the sample window duration to  match. The processor was running as fast as it could though, to add these functions would have required additional processors.  Microcontrollers/DSP much faster nowadays, could make a good project for someone who is interested in this topic. There are dozens of recent patents on this topic from companies such as IVL Technologies for glitch-free and intelligent pitch shifters.

BTW one possibility for a clean analog pitch shifter is to use a vocoder - patch each analysis channel to the corresponding synthesis channel one octave up, to get an octave-up pitch shift etc.
Cheers, Mike

Thanks Mike.
With last weekends experience on this project I am trying to gather courage and going this way. The last decent 8031 programming I did is some 5 years back. The thing I wanted to do different from your example (but thanks for letting me know you had encouraging results) was using a Dallas DZ87C520 of which I have some 30 laying in the drawer. These run at 33 Mhz and have an internal division of 4 instead of 12. I think this should give me the overhead to be able to detect 0 crossings. The next step is not to work with fixed framelengts (like the case in this topic where a frame is a fixed 1024 clocks long... the lenghth of the BBD line). The idea is to  determine how many samples can be stored in a max lenth RAM buffer and getting "out" (changeover to a next buffer) before the buffer is full. Basically this means a circular buffer with a start, an end and a read and a write pointer. This way it should be possible to "glue" the higher rate playback samples together only at 0 crossings. Unfortunately only crossing 0 and detecting that is not enough. The slope of the signal at such a point can be either going up or down. That means that another routine should determine this slope and only stop sampling when the slope of the signal equals that of the slope at the start.

Apart from that I'm also working my way through Eventide patent no 4.464.784 (use //www.pat2pdf.com for easy reading to see if I'm able to implement their correlation method.

Just checked my notes... the initial date I started working on this is november 2004... gimme some time.

@ all,
Thanks for all the inputs. I've got some more reading to do.
More stuff, less fear, less  hassle and less censoring? How 'bout it??. To discuss what YOU want to discuss instead of what others decide for you. It's possible...

But not at diystompboxes.com...... regrettably

DiyFreaque

Absolutely stunning work!

Thanks for publishing it here,
Scott

puretube

http://www.pat2pdf.org/patents/pat4464784.pdf
does this link work for you guys directly?

anyways, I prefer: http://www.pat2pdf.org/ (faster),
or the real thing:
http://ep.espacenet.com/search97cgi/s97_cgi.exe?Action=FormGen&Template=ep/en/advanced.hts

btw: there have been analogue solution attempts...

...and still are  :wink:

Vsat

Dirk,
I was using a 256-byte circular buffer with separate R/W pointers. Had up to three read pointers going at once so could turn a single note into a chord. A different version had a single shifted output but with an additional 32 Kbytes of RAM so could do the upshifted/downshifted repeats trick (like on the intro to Steve Miller "Fly Like an Eagle"). Worked, but the glitching was very objectionable. Tried a simple crossfade for 32 samples centered at the splice point, but it slowed down the processing so much there was no net benefit. Perhaps analog crossfade with two VCA's, and analog zero-crossing detection would help keep things fast, without very much additional circuitry.

Using the Dallas chips would be a big improvement. Also have some of the 33 MHz '420 microcontrollers here.  The more horsepower you have available, the better. A DSP evaluation board like the ones from Analog Devices have just about everything you need already on board.

Yamaha <might> have had  an early BBD-based shifter IIRC. It said in the ad that the technique they were using replaced the glitches with a gentle vibrato. Perhaps the error was being spread throughout the sample "frame" instead of localizing it at the splice point.
Regards, Mike

puretube


Dirk_Hendrik

Quote from: VsatHad up to three read pointers going at once so could turn a single note into a chord. A different version had a single shifted output but with an additional 32 Kbytes of RAM so could do the upshifted/downshifted repeats trick


:shock:  :shock:
Hadn't thought of those........
Wow! That's possible as well!!!
More stuff, less fear, less  hassle and less censoring? How 'bout it??. To discuss what YOU want to discuss instead of what others decide for you. It's possible...

But not at diystompboxes.com...... regrettably

Dirk_Hendrik

Quote from: puretubeUS 3846827;
US 3949174;
...

Thanks puretube.
More stuff to read.
More stuff, less fear, less  hassle and less censoring? How 'bout it??. To discuss what YOU want to discuss instead of what others decide for you. It's possible...

But not at diystompboxes.com...... regrettably

aankrom

Quote from: Dirk_HendrikA few months ago I ran into the schematic for an Analog Harmonizer on Mark Hammer's page : http://ampage.org/hammer/files/AnalogHarmonizer.ZIP


I ran into this schematic as well - and I did pretty much the same thing!
Except I used Radio Shack breadboards because I didn't even know if it would work. I had just gotten to the testing phase and asked anyone on the synth-diy list if they'd messed about with this and got steered here.

Very cool work (To parrot the other boids...)

This gives me things to try right away. Most helpful.

I thought about mounting all of the tweaking controls on the front. Maybe even go as far as using turns counting 10-turn pots. Well maybe not that far...

I thought about doing this using R5106's instead of the MN3007's that I used but I only have 2 of those...

gez

Quote from: Dirk_HendrikThe octave down circuitry seemed to work

How well did it work?
"They always say there's nothing new under the sun.  I think that that's a big copout..."  Wayne Shorter