Analog Drift

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

A number of synths have an analog pitch drift simulation feature. Does anyone know of the actual behavior of analog oscillators with respect to pitch drift? What, for example, is the likely maximum drift range in cents. Do things drift in one direction or both directions from intended pitch? What's a reasonable figure for cents per time-unit drift rate?

In the absence of any hard figures, educated guesses would be much appreciated.

Post

Why not give options for drift amount and rate? Listening to the Behringer Deepmind drift - it seems to pick a random frequency around the actual pitch and moves slowly towards that random amount. The speed of movement and the amount of drift is selectable my the user. It's really quite simple, but effective.

Post

dmbaer wrote: Wed May 22, 2019 8:08 pm A number of synths have an analog pitch drift simulation feature. Does anyone know of the actual behavior of analog oscillators with respect to pitch drift? What, for example, is the likely maximum drift range in cents. Do things drift in one direction or both directions from intended pitch? What's a reasonable figure for cents per time-unit drift rate?
Assuming a typical saw-core, I guess most of it comes down to noise (likely a mix of pink and white) at CV input and uncertainty at the comparator thresholds used to trigger a reset (and noisy power supply would likely make this worse). The former tends to make the sound in general quite noisy pretty fast, where as the latter tends to be somewhat subtle, except lossy codecs like MP3 really don't like the cycle to cycle variation very much. Maybe there could be other sources of noise, but these come to mind right away.

There isn't really any upper bound on how much noise you can have, except at some point it'll start to sound really bad. Practical analog oscillators obviously stay below this level. The pink noise in particular is not stationary, so you could have pretty much arbitrary drift over the lifetime of the device.

Keep in mind that the spectrum of the noise does matter, especially with CV noise.

Post

quikquak wrote: Thu May 23, 2019 9:47 am Why not give options for drift amount and rate? Listening to the Behringer Deepmind drift - it seems to pick a random frequency around the actual pitch and moves slowly towards that random amount. The speed of movement and the amount of drift is selectable my the user. It's really quite simple, but effective.
Giving drift amount and rate options is, of course, a good plan. My question has to do with trying to determine a reasonable upper limit and a reasonable range of rates. mystran suggests the drift is a result of noise, but my thinking was that it's something that happens much more slowly than that (or maybe the noise is extremely low-frequency only). One of the reasons pipe organs sound so rich is that their pipes go out of tune and the natural beating produces the magnificent sound. I would have suspected that analog synth pitch drift happens much more slowly than noise (maybe due to circuitry temperature variations) but considerably faster than organ pipes becoming detuned. But I really don't know - thus the question.

As I said, some virtual synths have a Drift parameter, like Rob Papen Predator 2. Now, did Mr. Papen introduce the drift amount and rate based on some scientific measurements, or did he just make a reasonable guess. We could all make guesses, but few of us are in a position to get an accurate reading on what goes on in real-world analog synths. So, again - thus the question.

Post

Why not just try adding interpolated slow noise to the correct pitch. Which is what I was suggesting. And see if you like it.
What does Predator do? You should be able to tell just by listening to one oscillator.

Post

My 2 cts: a friend had a Prophet-600 with digitally controlled analog oiscillators. Honestly it's the only synth I've ever seen (which tbh is not all) that had a tune button which would go over all the 12 oscillators and recalibrate them. This function was to counter-act mainly thermal drift which is rather unpredictable. Just like a piano, when not tuned for some years it will become honky-tonk, this synth would have issues like within half an hour of power up.
It would be first noticable in certain patches where the cross-mod or sync feature was used, so exact frequencies mattered a lot. You'd get sounds with a timbre that was off, not really detuned.
In most of the patches it would not really make much dfifference.

So all in all, maybe the drift was like 10 cts in a timeframes of 30 minutes, and apparently could be different per oscillator.

I'm not sure you want to implement a "retune" function or instability such that patches are less reproducable.
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

dmbaer wrote: Thu May 23, 2019 6:55 pmmystran suggests the drift is a result of noise, but my thinking was that it's something that happens much more slowly than that (or maybe the noise is extremely low-frequency only). One of the reasons pipe organs sound so rich is that their pipes go out of tune and the natural beating produces the magnificent sound. I would have suspected that analog synth pitch drift happens much more slowly than noise (maybe due to circuitry temperature variations) but considerably faster than organ pipes becoming detuned. But I really don't know - thus the question.
Noise doesn't necessarily mean high frequencies. Noise can have energy at arbitrarily low frequencies. Pink (ie. 3dB/octave) noise in semi-conductors is known to appear pink all the way down to the life-time of the device, which means the largest amplitude variations (of this particular type of noise) happens on time-scales of decades or longer!

Post

I have made a few synths with Drift parameters, this is/was the largest:
http://www.vst4free.com/free_vst.php?pl ... 80&id=2765

Largely I think Devs take a best guess coupled with what they like approach. I won't pretend much otherwise but like you, I did not love immediately adding fastish random noise to OSC Pitch only so added slower movement based on Sine + Smooth Noise across several parameters like Pitch, Filter Env Attack, Decay, release, etc. This seems to create a less noticeable "organic" feel than some - at the expense of being less noticeable at lower depths.

As for Depth alone, that depends on the parameter but +/- 20 cents is a huge amount for Pitch. +/- 5 cents is commonly plenty for that beating effect you mention. But as people say (and I did too) give the option to dial to taste as different sounds react differently.

Post

To continue my previous post, there is always some thermal noise in any circuit, so there is some "corner frequency" above which the noise is (close to) white... this doesn't necessarily mean that such white noise is high frequency, but there certainly is some cycle-to-cycle variation in analog waveforms as well.

Now the precise nature of noise and drift depends on the exact circuit, the components used (including process variations), the power supply, the air conditioning in the room and so on. This makes it incredibly difficult to really give a meaningful answer to your question. On top of that, I don't think anyone has a REALLY good idea of how the different source of drift really interplay in practice. I've personally spent probably hundreds of hours on this over the past 10 or so years and I'm still not entirely convinced I'm even looking at the right things.

Typically the tuning of analog oscillators is sufficiently unstable over longer periods as to be mostly annoying. Better oscillators generally drift less. Some synthesisers even have "auto-tuning" circuits that might try to continuously measure the drift and compensate. The waveform can also be "noisy" in other ways, although if you put the thing through an oscilloscope, the actual ramp of a saw-wave tends to be quite clean.

Post

Thanks to all for the replies.

Regarding listening to a virtual synth with a drift feature - if you can hear it, then you'd be way overdoing it. The goal, to my way of thinking, is to introduce enough pitch "slop" to create some nice beating. Again, this is just like an organ with nicely out-of-tune pipes that together sound much richer than if they were perfectly in tune. I have a friend who's a consummate organist who told me once about playing a just-tuned pipe organ. He said "it almost sounded electronic", and in his mind "electronic" is far from a complementary term.

By the way, the tuning inaccuracies in a pipe organ follow the typical bell curve with a standard deviation (I am told by my organist friend) of no more than 5 cents. So, this would seem to be a great target for intentionally mis-tuned digital oscillators.

The more I think about it, maybe drifting pitch is a pointless approach. I'm guessing that in real life analog synths, pitch probably drifts so slowly that it changes *well* under one cent in the duration of most notes. Achieving the desired esthetic effect could probably be just as easily (actually more easily) accomplished by just applying a bell curve randomization to pitch at note-on.

Post

Old analog synths, mono and poly, that I had, I think temperature drift or other factors caused them to slowly fall out of tune over time and the early polys usually had the auto-tune buttons to re-calibrate.

From playing perspective, somewhat a matter of personal taste but more than a few cents drift too sour, too much.

Mono synths, the drift was usually so slow that if one played a melody line then all notes would be more-or-less equally out of tune over the length of a song. But often the old analog synths had both internal (1 volt per octave) circuit board tracking trimmers and separate high freq tracking trimmers. Which might have drifted out of calibration. Also, it wasn't uncommon for it to be impossible to find trimmer positions for all oscillators, so that for instance you could tune all the oscillators to a low note in perfect pitch according to a strobe-tuner, then get both trimmer resistors adjusted so that all the oscillators would also be perfectly in-tune according to the strobe-tuner, on high pitches several octaves higher.

In that case one would just calibrate the oscillators to track as good as they were able, and maybe if you are playing a low-pitched melody line you would tune the front panel controls for decent oscillator unison without wolf-howling beating. But if playing a mid-pitch or high-pitch melody line, because the oscillators don't all track the audible band equally perfect, one might have to re-adjust the front panel tuning controls to get the oscillators fairly close to unison for the pitch range of the track you might be working on.

So "imperfect pitch tracking" might be another kind of drift perhaps useful to emulate. Or not. Dunno. The kind of thing where if you tune several oscillators "near beatless" to a note in the middle of the keyboard, then the pitch spread gets wider when you play down low or when you play up high. To my recollection this was a very common occurence in the imperfect world of real electronic parts in the real world. :)

Post

On poly synths, personally the charm of "a little out of tune" playing a chord, would be that each note in the chord is beating a little different than its neighbors, and as you play thru a chord progression and different voices get switched in, maybe the voice playing a repeated C# in the chord progression changes, and each instance has a slightly different beat amount and different "beat pattern" because the oscillators are all unlocked from each other and free-running, all just a little bit out of tune.

Many poly synths would do mono lead lines with round-robin voice assignment, so that if it is an eight-voice instrument, then all voices get played in sequence as you play the mono lead, and so each note in the musical line gets a slightly different beat pattern and detune amount. Which IMO was a "richer" sound than doing a mono lead on a mono synth, but its all a matter of taste.

Software implementation, just wild guessing I've never written a softsynth-- If the design maintains a fixed-size pool of free-running oscillators that are always running regardless whether being played (direct equivalent to a hybrid poly analog synth) then I think one would want a very slow per-oscillator pitch drift. Maybe the drift would be so slow that it wouldn't matter if you just use sine or triangle wave modulation so long as the mod rate for each oscillator is a little different. Over a drift period of a few cents over at least several seconds, maybe the ear would never notice that the drift modulation has a regular period? Otherwise use some kind of chaotic or pseudo-random very slow drift modulation, different for every oscillator.

If you instantiate oscillators as needed per-note, rather than maintaining a big bank of free-running oscillators, then to emulate a free-running sound I suppose you would want to select oscillator starting phase randomly for each oscillator, so they wouldn't all start out every note phase-locked the same?

Instantiating voices per-note, you could just pseudo-random pick detune of each oscillator when you start it up, within a range up to a few cents detune. If osc phase and detune is different every new note you start, it should be similar to playing a round-robin voice-assigned hybrid poly analog with slight oscillator drift?

Maybe you could select the detune amount with a gaussian random selection, so that most detune amounts are small near the true center pitch, and occasional outlying oscillators get started up farther out of tune, farther out on the skirts of the bell curve?

IIRC, if you add two uncorrelated white random noise sources you get triangular probability noise, and if you add more than two white sources then the distribution converges closer to gaussian? Maybe just triangular probability would be good enough so far as that goes.

So with something like that, if you set the max detune cents to maybe +/- 5 cents, then only very rare oscillators would get detuned approaching the limit, and most of the oscillator assignment detunes would cluster much closer within a standard deviation both sides of the zero detune point?

Osc1Detune = (Rand1() + Rand2() + Rand3()) * MaxDetuneAmount;
Osc2Detune = (Rand1() + Rand2() + Rand3()) * MaxDetuneAmount;
//etc

Post

JCJR wrote: Sat May 25, 2019 6:05 pm Maybe you could select the detune amount with a gaussian random selection, so that most detune amounts are small near the true center pitch, and occasional outlying oscillators get started up farther out of tune, farther out on the skirts of the bell curve?

IIRC, if you add two uncorrelated white random noise sources you get triangular probability noise, and if you add more than two white sources then the distribution converges closer to gaussian? Maybe just triangular probability would be good enough so far as that goes.

So with something like that, if you set the max detune cents to maybe +/- 5 cents, then only very rare oscillators would get detuned approaching the limit, and most of the oscillator assignment detunes would cluster much closer within a standard deviation both sides of the zero detune point?

Osc1Detune = (Rand1() + Rand2() + Rand3()) * MaxDetuneAmount;
Osc2Detune = (Rand1() + Rand2() + Rand3()) * MaxDetuneAmount;
//etc
My interest in this is for introducing some tuning inaccuracies for a virtual-synth-type instrument built using the in-beta MSoundFactory from MeldaProduction. I am not thinking of creating a whole synth from the ground-up (as if the world needs yet another virtual synth from a newbie!). So, my choices are limited. I cannot, for example, have a pool of free-running oscillators, all tuned very slightly differently, that I assign incoming notes to in a round-robin fashion.

But the bell curve random detuning assigned at note-on is quite doable. So, what I have settled upon as a good approach, using random assignment at note-on instead of a very slow random LFO-type modulation, is close to the above. I suspect the end result of those two approaches would be indistinguishable to all but the most expert listener.

Post

JCJR wrote: Sat May 25, 2019 6:05 pm IIRC, if you add two uncorrelated white random noise sources you get triangular probability noise, and if you add more than two white sources then the distribution converges closer to gaussian?
When you draw samples from two (or more) uncorrelated sources, the combined distribution is the convolution of the individual distributions. Since uniform white noise has a rectangular distribution, the sum of N+1 uniform white noise samples has a distribution shaped like a uniform B-spline [basis function] of order N, which converge to Gaussian in the limit of N approaching infinity.

Unfortunately though, this is pretty inefficient as you need a lot of random numbers and even more importantly the requirement for the samples to be uncorrelated to a high dimension means the PRNG has to be good (ie. not some cheap linear conguential generator) to actually maintain the desired distribution.

There's some easier ways though. Probably the easiest is to pick a target distribution such that you can invert it and then use the inverse as a "waveshaper" for uniform random variables (so you need just one per output sample). For true gaussian, my math handbook doesn't know of a closed form formula so I'd guess there probably isn't one... but there is a closed form formula (the Box-Müller method) to generate two independent gaussian samples (x1,x2) from two independent uniform (u1,u2 in [0,1]) samples:

x1 = sqrt(-2*ln(u2))*cos(2*pi*u1)
x2 = sqrt(-2*ln(u2))*sin(2*pi*u1)

This is truly a normal distribution [zero mean, unit variance], with limits at infinities and all. In practice I'd probably use something finite and cheap, even x=(2*u-1)^3 might be "gaussian" enough and even if you use something a bit better than that, it's typically still faster and less demanding on the quality of the PRGN than a sum of multiple independent samples.

edit: just for clarity I want to add that all usage of the word "sample" in this post refers to "individual random trials sampled from some distribution" (ie. the numbers you get out of a PRNG) and should not be confused with audio samples.

Post

Thanks as always, mystran for the expert ideas.

Post Reply

Return to “DSP and Plugin Development”