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.