# Wishful Coding

Didn't you ever wish your computer understood you?

## The relation between harmonics and parallel resistance

I’m building a simple synth on a breadboard, where the frequency is defined as $f=\frac{1}{RC}$, so by using different resistors with a row of buttons, different tones can be made. But what if you press two buttons simultaneously? You get 2 parallel resistors, giving:

I stumbled on this while playing with it, and the combined tones seem to be nice intervals sometimes. So I started to wonder if there was a connection.

In 12-tone equal temperament, the ratio of the frequency between two notes is $\sqrt[12]{2}$, so we could just plug it in and see what comes out. Take a series of notes:

And a series of a combined frequencies:

Plotting these in Matlab gives the following result

As can be seen, some combined tones are indeed quite close, but most not exactly. But then equal temperament does not have exact harmonics either. So we still do not know if we are generating actual harmonics, or just frequencies that happen to be close.

So what if instead of starting with $\sqrt[12]{2}$, we start with integer multiples of the base frequency and fold then back into one octave. This gives:

Plugging that into the parallel resistance equation, we can begin to search for exact harmonics giving exact harmonics.

 Combined Harmonic Name Button ratio Name 17 Minor second 9 Major second 9 Major second 5 Major third 19 Minor third 11 Tritone 5 Major third 3 Fifth 11 Tritone 7 Minor seventh 3 Fifth 2 Octave 2 Octave 1 Prime

And we can indeed verify that two resistors with a 2:1 ratio give a fifth (3:2):

Likewise a resistor ratio for a fifth gives a major third (5:3)

Math, music, physics. So beautiful.

Update:

As pointed out by Darius Bacon, this might not be a complete surprise, as there is a striking similarity between parallel resistance and the harmonic mean.

Wikipedia also has the following to say about the harmonic series:

Its name derives from the concept of overtones, or harmonics in music: the wavelengths of the overtones of a vibrating string are 1/2, 1/3, 1/4, etc., of the string’s fundamental wavelength. Every term of the series after the first is the harmonic mean of the neighbouring terms; the phrase harmonic mean likewise derives from music.