# Orders of magnitude: use semitones, not decibels

I'm going to teach you a secret. It's a secret known to few, a secret way of using parts of your brain _not meant for mathematics_... for mathematics. It's part of how I (sort of) do logarithms in my head. This is a nearly purposeless skill.

What's the growth rate? What's the doubling time? How many orders of magnitude bigger is it? How many years at this rate until it's quintupled?

All questions of ratios and scale.

Scale... hmm.

![chromatic scale](https://assets.tonegym.co/posts/BB4YD2.png)

'Wait', you're thinking, 'let me check the date...'. Indeed. But please, stay with me for the logarithms.

## Musical intervals as ratios, and God's joke

If you're a music nerd like me, you'll know that an octave (abbreviated 8ve), the fundamental musical interval, represents a doubling of vibration frequency. So if [A440](https://en.wikipedia.org/wiki/A440_(pitch_standard)) is at 440Hz, then 220Hz and 880Hz are also 'A'. Our ears tend to hear this as 'the same note, only higher'.

That means the 'same' interval, an octave, corresponds to successively greater gaps in frequency. First a doubling, then a quadrupling, an octupling, and so on. Our perception, and musical notation, maps the space of frequencies logarithmically.

You'll also know that a '[perfect fifth](https://en.wikipedia.org/wiki/Perfect_fifth)' is a ratio of $3:2$. A to the E above it, C# to the G# above it, etc. Consonance is _all about nice ratios_! (Ask [Pythagoras](https://en.wikipedia.org/wiki/Pythagorean_tuning).)

At least, the really sweet, in tune fifths are this ratio. Because God is an absolute wheeze, you can keep moving in fifths ($3:2$) and octaves and get 'new notes' eleven times. That's where we get our Western scale from, originally (except it's _originally_ originally Mesopotamian probably). The twelfth time ($(3:2)^{12}$) gets you to a ratio of roughly $129.7:1$. That's _almost exactly_ seven doublings, seven octaves (7 * 8ve)! That'd be $128:1$. God's joke is in [that roughly 1% margin](https://youtu.be/1DUZsQ2by2s?si=4fGwAq6dub-eyV2T&t=96), and musicians have been arguing about what to do about it for centuries. [It's a whole thing](https://en.wikipedia.org/wiki/Musical_temperament).[^equal]

[^equal]: [Usually nowadays](https://en.wikipedia.org/wiki/Equal_temperament) we squish all the fifths a tiny bit so that when stacked up they get to that delicious 128:1.

Cutting a long story short, that leaves us with twelve different notes dividing up the octave. They 'repeat', with 'the same' note again and again at either higher or lower octaves (a full doubling of frequency).

![chromatic scale](https://musiccrashcourses.com/scores/ChromScale.png)

In between octaves, those twelve divisions need to 'add up to' a doubling. For reasons, two steps (a sixth of the overall scale) is referred to as a 'tone', and a single step (a twelfth of the scale) is thus a 'semitone'. That means each semitone corresponds to a ratio of ${\sqrt[12] 2}$, the twelfth root of two. (It's about 1.06, i.e. a ratio increase of about 6%.) The full scale as shown above is called 'chromatic' (because it has every 'colour'...).

This means that **neat fractional powers of two map cleanly onto musical intervals**. God was generous in giving twelve many factors, so we have musical intervals for the square, cube, fourth, sixth, and twelfth roots of two which come for free.

So far, no logarithms. But we have _musical powers_ of two: give me a fraction and I can tell you the musical interval. That means we also have _musical logarithm_: give me a musical interval and I can tell you the power of two! e.g. C to G# is eight semitones. So $\log_2\left({\mathrm{C:G\#}}\right) = \frac 8 {12} = \frac 2 3$.

Musical logarithms? What is he talking about? Surely this is pointless. Yes, it is! Hold on!

## Harmonic series

If you're a _brass music_ nerd like me, you'll know that the 'overtones' of most natural vibrations correspond to the 'harmonic series' (no, not [_that_ harmonic series](https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)), the [_actually harmonic_ harmonic series](https://en.wikipedia.org/wiki/Harmonic_series_(music))), which are the different pitches you can get a big metal tube to vibrate at if you give it [the right encouragement](https://www.youtube.com/watch?v=wM1vOAz0_Gc). Incidentally this is [how brass players get](https://en.wikipedia.org/wiki/Overblowing) dozens of different notes out of an instrument having (usually) only three valves[^valves].

[^valves]: Three valves independently up or down is a total of eight configurations. Because the third valve is usually set to be redundant with the combination of the first two (which aids fluent finger movement), there are usually only _seven_ practically-distinguishable combinations.

This harmonic series is generated by lovely integer ratios! Why? The physics of oscillators. Integer multiples are the only frequencies which can support a standing wave on the same vibrating object (air column, string, membrane).

![String harmonics](https://upload.wikimedia.org/wikipedia/commons/2/2f/Moodswingerscale.svg)

Brass players spend hours and hours sliding and jumping between these harmonics as a matter of sheer necessity. Only three valves![^wind] So we know them by heart, by fingers, and by ears.

[^wind]: Other wind players, who have the benefit of many more, but not infinitely many keys and buttons, often encounter one or two of these harmonics.

## Combining the harmonic series with the chromatic scale: magic

So we have _integer multiples_, the harmonic series, laid over a fundamentally _logarithmic scale_, the chromatic scale consisting of twelve semitones.

![harmonic series](https://upload.wikimedia.org/wikipedia/commons/e/e6/Harmonic_Series.png)

_Numbers above the notes correspond to small adjustments vs the equally-spaced semitones which are usually used today to deal with God's joke. Ignore them if you don't care about small percentage errors. This is the harmonic series on C; you can have a series on any starting note with the same intervals._

Here's the magic trick. Now we can go from arbitrary ratios to musical intervals!

Start with an easy one, 1.25. That's a ratio $5:4$. Fifth harmonic is E (+ 2 8ve). Fourth is C (+2 8ve). The octaves cancel. That's an interval $E:C$, or four semitones. So 1.25 _is four semitones_. We already know the 'musical logarithm' of four semitones, it's $\frac 4 {12} = \frac 1 3$. Check on a calculator: $\log_2(1.25) = 0.32193...$. I promised close, not perfect!

A slightly trickier one, 1.8. That's a ratio of $9:5$. The ninth harmonic is D (+3 8ve), and the fifth is E (+2 8ve). The octaves partly cancel (leaving a single octave). The interval $D:E$ is _minus two semitones_. Taken off the residual octave, that leaves ten semitones. So $\log_2(1.8) \simeq \frac {10} {12} = \frac 5 6$. Calculator check: $\log_2(1.8) = 0.848...$. Not bad!

It turns out that the musical harmonic series is secretly a mini table of base 2 logarithms.

## Base 10, if we really have to

The unit that mainstream sheeple often use for fractional logarithms is the [decibel](https://en.wikipedia.org/wiki/Decibel). A decibel divides a _base ten_ order of magnitude in ten. So ten decibels is a dectupling, twenty is a hundredfold, and so on.

Stated similarly, a semitone divides a _base two_ order of magnitude in twelve.

In another cosmic whimsy, $2^{10} = 1024 \simeq 1000 = 10^3$. So 120 semitones are essentially equal to 30 decibels, for an easy exchange rate of four semitones per decibel.

## What

Well, look. It's fun, and it gets me logarithms to pretty good approximation. It's good enough for ~~jazz~~ Fermi estimation, as they say. Who is this even good for? I maintain that the intersection between music and mathematics nerds is surprisingly well populated. If that's you, you're welcome. If not, I'm pretty unsure how easy it is to get the harmonic series installed in your brain. Maybe it's only available to the warped few who train in childhood.

There are some other fun tricks with powers and logarithms of two. For example, if you know your [binary place values](https://en.wikipedia.org/wiki/Binary_number), you can figure out logarithms of very big numbers (and the $1000 \simeq 1024$ trick comes in handy here too).

There's also a '[rule of 72](https://en.wikipedia.org/wiki/Rule_of_72)' which helps when dealing with small percentage growth rates and doubling times.

I aesthetically like this neat division of doublings into twelve parts, and it's fun to invoke musical intuitions that really have no right to help with mathematics.

You might complain that twelfths are faffy. Who uses twelfths anyway? Everyone everywhere has used decimal for goodness' sake! Well, I have [something](https://en.wikipedia.org/wiki/Sexagesimal) [else](https://www.scientificamerican.com/blog/roots-of-unity/the-joy-of-sexagesimal-floating-point-arithmetic/) to share with you...