Author Topic: Syncing Synth VCOs  (Read 2812 times)

0 Members and 1 Guest are viewing this topic.

Offline FlyingHackerTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: us
  • You're Doing it Wrong
Syncing Synth VCOs
« on: August 21, 2017, 12:44:59 am »
I am working on a "harmonizer" that is basically a VCO that takes one input voltage but produces three output waveforms at different frequencies in harmony (like thirds, fifths, or octaves, etc.).

I have been playing around with using three independent VCOs using the VCO portion of CD4046 chips. This works well if I tune it myself with voltage dividers or pots, but they are not linear enough to stay in tune as I change the master frequency from say 50Hz-10kHz. Any thoughts on how to keep these in better sync, while still maintaining the slightly out of sync sound that you get from independent VCOs?

I was going to try the PLLs as actual PLLs and try locking them that way. I am not sure how tightly this locks, having never tried them for audio. It sure looks like PLLs lock very tightly when viewed on a scope when I have done other projects with PLLs.

Another option is a higher master clock and logic counter chips to divide by N and derive the various frequencies that way from a single CD4046 VCO. I worry these may be too perfect. I guess I could then try some capacitors to slightly phase shift the different sounds.

I have not found much good info on this particular topic online. Most articles talk about using PLLs or whatnot, but I guess I have to try it and see how it sounds. There is something very nice about the slightly drifting, slightly off frequency multiple VCOs beating against each other.

Any thoughts?  Thanks.
--73
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12805
Re: Syncing Synth VCOs
« Reply #1 on: August 21, 2017, 03:26:13 am »
Once locked, a PLL holds a fixed frequency ratio to the reference signal with phase jitter dependant on the loop's design parameters, and any disturbances present.

If you want to retain the independent VCO approach you'd do better to trim them digitally using a MCU.   The  master control voltage would be digitised and used by the MCU to index into a table that holds the required trim offset for that frequency for each slave VCO.  The trim offsets would be converted to trim voltages and summed with the master control voltage to generate separate trimmed control voltages for each slave. The MCU would also sequentially digitally compare the slave output frequencies with the master to determine if the trim has drifted and the trim entry in the table for that slave and control voltage needs tweaking.
 

Offline FlyingHackerTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: us
  • You're Doing it Wrong
Re: Syncing Synth VCOs
« Reply #2 on: August 21, 2017, 03:44:26 am »
Thanks for the reply. This would be easy with a uC and a look up table.

I am trying to do this as analog as possible, not out of some audiophoolery, but rather as a learning experience, and an interest in analog circuits.

I do like your idea of using the uC to drive modify the voltages to drive the VCOs, rather than using an UC to generate the frequencies themselves. I was wondering about doing something similar in an analog circuit, like a comparator or something, but that seems like it would have jumps in voltage, rather than gradients.
--73
 

Offline DaJMasta

  • Super Contributor
  • ***
  • Posts: 2289
  • Country: us
    • medpants.com
Re: Syncing Synth VCOs
« Reply #3 on: August 21, 2017, 03:46:50 am »
If you want to attempt the analog route: you can start with a fast frequency and the divide down, and you could also filter/add nonlinearity to the base signal to get higher harmonic content in the tone your system is putting out (though without selective amplification, the harmonics will only get so loud), but the biggest problem may be in the nature of the tuning systems.

It's relatively easy to generate harmonic multiples of the fundamental - 100, 200, 300, 400, 500 etc., but these frequencies don't line up equal temperament or just tuning systems exactly, and this is just the nature of the harmonic series vs. the twelve tone systems we've come to adopt.  Against equal temperament, the second harmonic will be exactly an octave, the third harmonic will be a little sharp, the fifth harmonic will be a little flat, and there are little deviations for every tone that's not an even octave.  So if you generate harmonic multiples of the VCO frequency, you can harmonize, but you'll have a fairly limited range of intervals that will actually sound in tune, and since the second harmonic is at the octave, you won't be able to get a major third, for example, closer than three octaves above the starting tone, and the minor third is another octave beyond that.

So what may actually be a better solution would be to do some analog math on your input voltage and feed it into subsequent VCOs.  So you have your base VCO that produces the fundamental, then you have a second VCO that produces a fifth by using opamps to convert the input voltage into what the second amp needs to sound a fifth in the same octave - this will limit the input range in terms of what will be properly harmonized with the whole system because there will be some error and nonlinearity introduced by the voltage conversion circuits to feed the VCOs, but with sufficient tweaking and listening, you could probably make a fully analog harmonizer.

For octaves and close harmonic stuff, you could filter the signal to add in higher harmonic content or use a frequency multiplier or something to just get a tone an octave up.

It's probably going to be finicky if you try to go fully analog, but it sounds interesting.  It simplifies things a lot to use a micro to do the voltage trimming for the VCOs - much less hardware tweaking and less chance of the input being out of harmonization range, and if you went the fast clock divided fully-digital approach to generating the tones, you just need a fast enough base clock so that when you divide down you can divide smaller than what sounds out of tune to most ears - if the steps are too coarse, you won't be able to hit notes exactly where you want them, depending on the division ratio.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Syncing Synth VCOs
« Reply #4 on: August 21, 2017, 01:58:47 pm »

Just a quick read
Some answers are trying to set VCO input voltage by remembered value.
Some are trying to digital divide output.
You state you want analog.

You need feedback to get more linear control of VCO. If you trigger a one shot on a change of VCO output, you have variable frequency PWM. Using a filter, you get a  Frequency to Voltage converter..
This output could become part of your VCO voltage control.

To get harmonics, some analog math with voltages.
 

 
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16544
  • Country: us
  • DavidH
Re: Syncing Synth VCOs
« Reply #5 on: August 21, 2017, 02:17:55 pm »
I might enclose each VCO within a control loop starting with a frequency to voltage converter.  This was commonly done to get a very linear VCO.
 

Offline bd139

  • Super Contributor
  • ***
  • Posts: 23017
  • Country: gb
Re: Syncing Synth VCOs
« Reply #6 on: August 21, 2017, 03:01:43 pm »
Doubt a PLL would lock quick enough for musical purposes.

Back when I was playing around with analogue synthesizers in the early 00s, I came to the conclusion the only way to do this was a digital VCO. It's really hard producing anything with stable tuning at multiple frequencies. Everything drifts with temperature even if you do manage to get it right. There is a video of Jarre playing when his kit goes tits up and off tune which always reminds me of this. My approach was to use a 20MHz PIC with three LUTs for analogue functions (sine, sawtooth, square) which took a MIDI note on/note off and allowed you to play four notes polyphony at a time. This also did the ADSR function. After that, everything was analogue. It didn't sound *that* bad even though my frequency and sample rate calculations were crap.

Unfortunately I don't have the source code for it any more and it sucked so badly I would be embarrassed to post it even if I did have it :)

Then I bought a Korg Triton and scrapped it.

Edit: there's someone who did something similar here: http://picsynth.000space.com/?i=1
« Last Edit: August 21, 2017, 03:03:50 pm by bd139 »
 

Offline FlyingHackerTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: us
  • You're Doing it Wrong
Re: Syncing Synth VCOs
« Reply #7 on: August 21, 2017, 03:14:06 pm »

For octaves and close harmonic stuff, you could filter the signal to add in higher harmonic content or use a frequency multiplier or something to just get a tone an octave up.


Luckily, for octaves I can start with the highest frequency note, and then just voltage divide the input in half twice to get the two lower octave notes. In other words, I am starting with an arbitrary frequency, not necessarily needing notes above and below my input note. They could all be below.

Interesting thoughts here. Adding more harmonics to begin with is interesting as well. If I had an in phase sine wave (I am mainly dealing with square waves here, but would like to add some various shapes) could I not also use it to subtract the fundamental from a square wave, thus leaving harmonics I could mix in?

Another point is that my input is continuously variable, but still on and off, rather than being a keyboard with distinct notes.
--73
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Syncing Synth VCOs
« Reply #8 on: August 21, 2017, 05:49:39 pm »
One problem with VCO's is the frequency range..

One way to fix this is to go higher in frequency. Often though of is then dividing the frequency, But there is a second way.

If you use a reference frequency, You can Feed this reference and VCO output to an RF type mixer and subtract reference from VCO.
Audio range = reference frequency - VCO frequency

A 20k frequency change then covers 0-20K in audio.

You might also want to look at a comb filter.


 

Offline floobydust

  • Super Contributor
  • ***
  • Posts: 6923
  • Country: ca
Re: Syncing Synth VCOs
« Reply #9 on: August 21, 2017, 06:21:33 pm »
Number one for synths is that they are in tune; CD4046 VCO section will drift all over the place unless used in closed-loop (PLL mode) and even then there is noticeable lag due to lock-time. The VCO drift is both offset and span which is gross to adjust.

Without a keyboard, you are making a Theremin/Martenot and musicians like the pitch "slide" but want it to end up on a proper note. So things (control voltage) still needs to get quantized at the end to a note.

As far the "analog sound"- sine, sawtooth, variable PW square-wave have been the staple synth waveforms because of their harmonic structure.
If OP wants more harmonics, just divide/2 with a flip-flop, or multiply. But square waves are kinda harsh to listen to and drown out the rest of the band.

It is difficult how to keep the analog character of a synth, compared to using modern tech like MCU with DDS.

I design in the CEM3340 VCO IC, it's back in production... you can spend more time playing instead of trimpots from hell on a drifty VCO. I think for the hardware outlay, adding oscillators for polyphony pays off better than adding harmonics, in terms of "fatness" of sound.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16544
  • Country: us
  • DavidH
Re: Syncing Synth VCOs
« Reply #10 on: August 21, 2017, 06:55:14 pm »
Some audio suitable VCOs are designed from the start with linearity in mind and fast response.  Check out the design shown in figure 14 of Linear Technology application note 14.  It achieves 0.1% linearity,  150ppm/C gain, and a zero drift of 0.1Hz/C.  There are some old function generator designs which achieve similar performance.

Would you want a linear or logarithmic control voltage though?
 

Offline FlyingHackerTopic starter

  • Frequent Contributor
  • **
  • Posts: 807
  • Country: us
  • You're Doing it Wrong
Re: Syncing Synth VCOs
« Reply #11 on: August 21, 2017, 07:06:58 pm »
The LT AN14 is interesting, thanks for that.

How about the LM311 VCO? It is supposed to be pretty linear. I built up one of the simpler ones (they offer a more precise layout in the datasheet, but I went with the simple one). It was OK. If I recall it did not put out a 50% duty cycle, though.

I also picked up a few of these off eBay. I am eager to experiment with them as well. ICL8038 http://www.intersil.com/content/dam/Intersil/documents/icl8/icl8038.pdf

The idea is indeed more "fatness" of sound vs. any specific harmony. I may play with simple logic division for now and see how close I get with that. Maybe I can add some phase jitter or other imperfections and get something cool. Again, this is more of an analog electronics learning exercise than a desire to produce a fantastic "instrument."

--73
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16544
  • Country: us
  • DavidH
Re: Syncing Synth VCOs
« Reply #12 on: August 21, 2017, 08:30:23 pm »
How about the LM311 VCO? It is supposed to be pretty linear. I built up one of the simpler ones (they offer a more precise layout in the datasheet, but I went with the simple one). It was OK. If I recall it did not put out a 50% duty cycle, though.

The problem is that for audio applications, you probably want a sine wave output.  That immediately leads to using a function generator type of design where an integrator produces a precision triangle wave which is then converted into a sine wave via function fitting

That is what the ICL8038 and the various function generator examples do.

Quote
The idea is indeed more "fatness" of sound vs. any specific harmony. I may play with simple logic division for now and see how close I get with that. Maybe I can add some phase jitter or other imperfections and get something cool. Again, this is more of an analog electronics learning exercise than a desire to produce a fantastic "instrument."

Here is an idea.

Start with a clock which is 100 times the fundamental frequency, divide it by 100, and use a switched capacitor filter to produce the fundamental sine wave.  Now derive that 100x clock from a 200x clock and do the same thing.  Now you have a fundamental and second harmonic which you can mix at will.  Do the same thing for the 4th and maybe 6th harmonic or however many you want to include.

So now you need any simple voltage to frequency converter with a pulse output which may be optimized for drift, gain, linearity, and even made exponential which is useful for audio, (1) a divider chain, and a switched capacitor filter for the fundamental and each harmonic that you want.

(1) See figure 21 in Linear Technology application 14 for an e^x voltage to frequency converter.
 

Offline DaJMasta

  • Super Contributor
  • ***
  • Posts: 2289
  • Country: us
    • medpants.com
Re: Syncing Synth VCOs
« Reply #13 on: August 21, 2017, 08:59:20 pm »
The idea is indeed more "fatness" of sound vs. any specific harmony. I may play with simple logic division for now and see how close I get with that. Maybe I can add some phase jitter or other imperfections and get something cool. Again, this is more of an analog electronics learning exercise than a desire to produce a fantastic "instrument."

In that case, I'd definitely try filtering for different harmonic content.  I built a little circuit to take a 555's output in the audio band and really screw with the way the waveform looked for a demo/test of another thing I was working on, you can get a lot of stuff in higher harmonics with an inductor, a couple of caps, and a resistor.

I had a sticky note with the schematic on it, but can't find it... but on the 555's output, I had a 5k pot in parallel with a 0.1uF cap.  Then after they rejoin, there's a 220 ohm resistor in series, then a 1uF cap to ground and a big inductor (I think it was around 6 mH, just wound around a spare toroid core).  After the inductor there was a 10uF cap to ground and this node was the input to a power transistor that directly drove an 8 ohm speaker.  In adjusting the pot, you could get the waveform to change shape pretty substantially, and adjusting the values of the caps in particular could vary things a whole lot more.  Was reasonably responsive from the bottom end of the small speaker's response, but as you got above maybe 8 or 10kHz it started just becoming a sine.

With just a filter, you won't get exactly the same harmonization at different pitch levels and you won't get a totally flat output amplitude across the range, but if you design it well, you should be able to get a pretty substantially different waveform with about the right amplitude that's totally synced to the input frequency.  Plus it's fun to swap in parts and watch the waveform get weird.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf