Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I've been messing around with formulas for musical notes (trying not to read anything that would help me unless I get stuck) and currently I'm at a point where I'm trying to get a function that describes each note's frequency in terms of it's surrounding notes and specifically to find if their respective frequencies are close to a whole number ratio.

I can use a computer to calculate a table of every whole number ratio that I expect to see but I'm wondering if there is any other approach to this?

share|improve this question
3  
Continued fractions might be a good start? en.wikipedia.org/wiki/Continued_fraction –  copper.hat May 22 '12 at 15:57
add comment

2 Answers 2

A standard way of getting approximations that involve "small" numbers is to use the continued fraction expansion.

Since you expressed a desire to work things out for yourself, I will leave it at that for now. If calculations lead to a particular problem, please ping for elaboration.

share|improve this answer
add comment

In general there is no closest whole number ratio. For example, the ratio between C and the next lower F♯ is exactly $\sqrt 2$. (In an equal-tempered 12-tone system.) As was known to the Greeks, there are no integers $a$ and $b$ with $\frac ab = \sqrt 2$. But there are arbitrarily good approximations: $\frac 32$, $\frac75$, $\frac{17}{12}$, … . The sequence continues with each fraction $\frac ab$ followed by $\frac{a+2b}{a+b}$, and each one is closer than the ones before.

The general rule is that every irrational number $\alpha$ has a unique continued fraction representation, and that if one truncates this continued fraction at some point, one obtains a good rational approximation to $\alpha$ with relatively small numerator and denominator. The further along one truncates the continued fraction, the better the approximation, but the larger its numerator and denominator will be. One can show that these so-called "convergents" of the continued fraction are among the very best rational approximations to $\alpha$ that exist, in the sense that any closer rational approximation must have a larger denominator.

share|improve this answer
1  
convergents… are among the very best rational approximations…: to complete this, we have the two facts (which you surely know): (1) if you define the badness of a rational approximation $p/q$ as the value $|q\alpha-p|$, then all the best rational approximations (better than any with a smaller denominator) are precisely the convergents, (2) if you define the badness as $|x-p/q|$, then the best are precisely all convergents plus the semiconvergents $(p_k+np_{k+1})/(q_k+nq_{k+1})$ for $n$ from either $a_{k+2}/2$ or $a_{k+2}/2+1$ to $a_{k+2}$. shreevatsa.wordpress.com/2011/01/10/not –  ShreevatsaR May 31 '12 at 10:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.