I often have to do calculations that pertain to musical intervals, i.e. the ratios between two pitches. E.g., the interval that commonly we call a "major third" (
d-f# etc.) can be expressed as a 5/4 ratio (in so-called "just intonation").
Now consider such a ratio, such as 5/4.
Assume that, for our purposes, every ratio that, as a whole, is half as big, (or a quarter, or two times, four times...) is "as good as" that ratio. In other words, we consider 5/2, 5/8, 5/16 etc. equivalent to 5/4. Musically speaking, all those ratios express the same "pitch class". So if 1/1 were our
c and 5/4 our
e, then those "new" ratios we would call
e'' etc., but they're all
Now assume that whenever I'm working with a ratio, I always want to stay within one octave, i.e. between 1/1 and 2/1. Every ratio that is generated in the process needs to be (and here's where, as mathematical layman, I run into terminological problems) "folded back" into one octave, i.e. be constrained between 1/1 and 2/1.
Say I wanted to calculate the pitch that we arrive at after stacking a few such major thirds on top of each other:
5/4 * 5/4 * 5/4 * 5/4 ...which, to most people, would be 625/256. But to me, as described above, it's 625/512.
Doing my maths with pen, paper and my head most of the time, none of this is a problem. I simply halve, double, etc. the nominator or denominator, and that's it (here: double the denominator).
But how would we solve such a problem in an automated way? I admit to using Excel once in a while to work on my music theory stuff (besides a dedicated application called "Scala" which is of little help in this specific problem). Suppose you only had Excel available as a tool, how would you go about it? How would you constrain the result of a division between two poles? Any advice is appreciated!