Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Suppose we start with 12-TET and ask what simple integer ratios each note is close to. To do that we need some notion of what it means for a simple integer ratio to be a good approximation to some arbitrary given number.

Consider trying to approximate some number x with an integer ratio n/m. For a given m all we can guarantee is that we can find some m so to |x-n/m| <= 1/2m. One way to define good approximation is if for a given m, we can get a lot closer than 1/2m to x then that is close.

For example if we want to approximate pi with m = 6, 7, or 8, the closest we can get is 19/6, 22/7, and 25/8. The absolute errors are about 1/40, 1/790, and 1/60, respectively. They are all doing better than 1/2m, but 6 and 7 are only about 3.5 times better 1/2m, but 7 is 56 times better than 1/2m. So we say that 22/7 is a good approximation to Pi. That doesn't mean it is particular close--just that it is way closer than other approximations with similar sized denominators.

For a given number x there is a way to find such good approximations. You figure out the continued fraction for x. For Pi that is 3 + 1/(7 + 1/(15 + 1/(1 + 1/(292 + 1/(1 + ..., then even though that goes on forever you type ")))))" so that the unbalanced parens don't drive you crazy, and take the sequence you get by taking finite sections from the left side of that continued fraction. So for Pi we get 3, 1 + 1/7, 3 + 1/(7 + 1/15), ..., which when simplified give 3, 22/7, 333/106, 355/113, 103993/33102, .... Note that 22/7 is in there, which is the good approximation from early.

All of those numbers from taking the left parts of the continued fraction, which are called convergents of the continued fraction, are good approximation in the sense above: they are way closer to Pi than anything else with similar denominators.

What we can do then to find good integer ratios that are close to the notes of 12-TET is for each 12-TET note, take its frequency divided by C's frequency, compute the continued fraction of that, and compute the first few convergents. Here are the results. I've omitted convergents with a denominator of 1 or with a denominator > 500.

  C#/Db: {17/16, 18/17, 89/84, 196/185}
  D:     { 9/8,  55/49}
  D#/Eb: { 6/5,  19/16, 25/21,  44/37}
  E:     { 4/3,   5/4,  29/23   34/27,  63/50, 286/227, 349/277}
  F:     { 3/2,   4/3, 295/221}
  F#/Gb: { 3/2,   7/5,  17/12,  41/29,  99/70, 239/169, 577/408}
  G:     { 3/2, 442/295}
  G#/Ab: { 3/2,   8/5,  19/12,  27/17, 100/63, 227/143, 781/492}
  A:     { 5/3,  37/22}
  A#/Bb: { 7/4,   9/5,  16/9,   41/23,  57/32,  98/55}
  B:     {15/8,  17/9, 168/89, 185/98}


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: