♪

Tuning

Equal Temperament

Pythagorean


Math

Each successive octave is twice the frequency of it's predecessor. Inside each octave we have twelve notes and there are different conventions to distribute the notes within the octave.

With equal temperament the notes distributed equally so there is predictable gap between each note. The pitch of each note is calculated using:

pitch(i) = {{A4FREQUENCY}}Hz × 2i/12

With pythagorean tuning the notes are distributed according to the ratio of 3:2, the perfect fifth, ...

pitch = {{D4FREQUENCY}}Hz × 3a2b where a,b ∈ ...,-2,-1,0,1,2,...

{{A4FREQUENCY}}Hz is frequency of middle A under the concert tuning convention, {{D4FREQUENCY}}Hz is frequency of middle D ...

Show extra octaves ...

Play text
Chord table

Printable chord table

About

I came to music late in life after a colleague offered to give me piano lessons. Every Tuesday night for three monthes we had five hours of piano and lager. It was great! Of course, being of technical mindset, I immediately started looking into the math and music theory.

Trying to make sense of piano chords, I was surprised that by using list comprehensions I could generate a table of chords in very compact Python (chords.py). This page uses a mix of Vue.js and Javascript, it's pretty simple but not a elegant as the Python solution.

The chord app, above, is a compact way to compare how chords sound without learning them all off by heart. The sound implementation is very basic and I am reading up on the Audio API to improve it.

The tuning app, above, came about after reading the history of how people have been very upset about the "correct" way to tune instruments (Temperament: How Music Became a Battleground for the Great Minds of Western Civilization). To make this more useful, I plan to add more octaves and various other tunings and show up the pythagorean comma.

I would propose the the piano keyboard as a most successful user interface, having worked unchanged for centuaries. However, it does not fit into the tiny screen of a mobile phone, so I have not tried to reproduce one here.