Operations on intervals: Difference between revisions

From Xenharmonic Reference
m The linear-domain operations should go in the DR article
Line 75: Line 75:
# <math>\frac{4}{3} \ \mathrm{med} \ \frac{3}{2} = \frac{4+3}{3+2} = \frac{7}{5}</math>
# <math>\frac{4}{3} \ \mathrm{med} \ \frac{3}{2} = \frac{4+3}{3+2} = \frac{7}{5}</math>
# <math>\frac{4}{3} \ \mathrm{med} \ \frac{7}{5} = \frac{4+7}{3+5} = \frac{11}{8}</math>
# <math>\frac{4}{3} \ \mathrm{med} \ \frac{7}{5} = \frac{4+7}{3+5} = \frac{11}{8}</math>
== Linear multiplication and division ==
== Linear stretching ==
[[Category:Core knowledge]]
[[Category:Core knowledge]]

Revision as of 02:03, 19 December 2025

The following are common arithmetic operations on musical intervals. If you're unfamiliar with the operations, you're encouraged to verify the examples for interval operation rules with a calculator.

Stacking and unstacking

Stacking two intervals feels perceptually like we are adding two distances, but it corresponds to multiplying two frequency ratios. The logarithm function is the bridge between frequency space and pitch space:

log2a+log2b=log2(ab)

for any two frequency ratios a and b. The above equation tells us that the sum of the size (in octaves) of a and the size (in octaves) of b is equal to the size in octaves of the product of two frequency ratios, ab. Hence, stacking corresponds to multiplying frequency ratios in linear (frequency) space, and adding cent values in logarithmic (pitch) space.

To convert octaves to cents, we simply multiply both sides by 1200:

1200log2a+1200log2b=1200log2(ab).

As a consequence, since the inverse operation of multiplication is division, dividing frequency ratios corresponds to subtracting their perceptual sizes:

1200log2a1200log2b=1200log2(a/b).

Examples

  1. 1200log2(3/2)1200log2(5/4)=1200log2(6/5)
  2. 1200log2(3/2)+1200log2(3/2)=1200log2(9/4)
  3. 1200log2(16/9)1200log2(3/2)=1200log2(32/27)

Logarithmic multiplication and division

From the log rule

nlog2r=log2(rn)

we see that stacking n copies of the ratio r corresponds to taking the nth power of r:

n(1200log2r)=1200log2(rn).

The analogous holds for dividing a ratio into n equal parts:

1n(1200log2r)=1200log2(r1/n).

There is another operation that can be called "logarithmic division", which is finding the perceptual ratio of two intervals. This is given by the base change operation:

1200log2r1200log2s=logsr.

Division by 0 is not allowed, so you can't take log1/1.

Examples

  1. 21200log2(4/3)=1200log2((4/3)2)=1200log2(16/9)
  2. 21200log2(9/8)=1200log2((9/8)2)=1200log2(81/64)
  3. 1131200log2(2/1)=1200log2(21/13)
  4. 1200log2(81/64)1200log2(9/8)=log9/8(81/64)=2

Reduction

Reduction is the pitch equivalent of modular arithmetic ("clock arithmetic"). Reduction is more of a fundamentally pitch-space operation, so mathematically we can just denote it using mod or %.

The most common reduction operation is octave reduction, or the operation xx % 1200c, so let's talk about that first. You can visualize octave reduction as wrapping pitch space into a circle of octave-equivalent "pitch classes".

The way to compute the octave reduction of an interval x is:

  1. If x > 0 cents, keep (logarithmically) subtracting 1200c from the cents value of x until x is greater than or equal to 0 cents and (strictly) less than 1200 cents.
  2. If x < 0 cents, keep (logarithmically) adding 1200c from the cents value of x until the value of x is greater than or equal to 0 cents and (strictly) less than 1200 cents.

For reduction by any other interval, just substitute 1200c with the cents value of whatever interval you wish to reduce by.

Examples

  1. 1350c % 1200c=150c
  2. 7500c % 1200c=300c
  3. 450c % 1200c=750c

Mediant

The mediant between two ratios a/b and c/d is the freshman sum (a+b)/(c+d). The mediant operation is ubiquitous in xenharmonic theory, as:

  1. the mediant of two unequal ratios is always strictly between the two ratios
  2. the mediant is the simplest ratio between two ratios adjacent in the Stern-Brocot tree
  3. the continued fraction for any irrational value is a result of taking mediants "infinitely many times" between adjacent ratios in the Stern-Brocot tree, the resulting value approaching that irrational value at the limit

For intervals in equal divisions

Mediants can be used to obtain generators of MOS scales in edos (the procedure for any other equal division, given the equave, is the same), For example, if a\m and b\n are both diatonic fifths (including equalized and collapsed diatonic tunings), then (a+b)\(m+n) is also a diatonic fifth; for example, we obtain 10\17 by taking the mediant of 7\12 and 3\5, thus sharpening 7\12 into 10\17. On the other hand, we can flatten fifth generators by taking the mediant of the diatonic generator with the equalized diatonic generator 4\7: 7\12 med 4\7 = 11\19.

For JI ratios

Example (the path to 11/8 in the Stern-Brocot tree):

  1. 11 med 10=1+11+0=21
  2. 11 med 21=1+21+1=32
  3. 11 med 32=1+31+2=43
  4. 43 med 32=4+33+2=75
  5. 43 med 75=4+73+5=118