Operations on intervals: Difference between revisions

From Xenharmonic Reference
Line 80: Line 80:
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.
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 ===
=== For JI ratios ===
Example {{adv|(the path to 11/8 in the Stern-Brocot tree)}}:
Example:
# <math>\frac{1}{1} \ \mathrm{med} \ \frac{1}{0} = \frac{1+1}{1+0} = \frac{2}{1}</math>
# <math>\frac{1}{1} \ \mathrm{med} \ \frac{1}{0} = \frac{1+1}{1+0} = \frac{2}{1}</math>
# <math>\frac{1}{1} \ \mathrm{med} \ \frac{2}{1} = \frac{1+2}{1+1} = \frac{3}{2}</math>
# <math>\frac{1}{1} \ \mathrm{med} \ \frac{2}{1} = \frac{1+2}{1+1} = \frac{3}{2}</math>

Revision as of 02:02, 23 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.

Conversion between frequency ratios and cent values

To convert a ratio r to a cent value c:

c=1200log2r=1200logrlog2

To convert a cent value c to a frequency ratio r:

r=2c/1200

Stacking

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

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, or "unstacking":

1200log2a1200log2b=1200log2(a/b).

This also means that going up (positive cents value) corresponds to a ratio greater than 1, and going down (negative cents value) corresponds to a ratio less than 1.

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 an interval into n perceptually equal parts:

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

or for scaling the perceptual interval by a factor of any real number α:

α(1200log2r)=1200log2(rα).

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(3/1)=1200log2(31/13)
  4. 1200log2(81/64)1200log2(9/8)=log9/8(81/64)=2

Reduction

Reduction is the modulo operation in pitch space. Reduction is a fundamentally pitch-space operation, so mathematically we just denote it using mod or % and working with cent values.

The most common reduction operation is octave reduction, or the operation xx % 1200c. You can visualize octave reduction as wrapping pitch space into a circle of octave-equivalent pitch classes.

One way to compute the octave reduction of an interval x by hand 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). For example, the mediant of 4/3 and 5/4 is 9/7. The mediant operation is common in xenharmonic theory, as the mediant of two unequal ratios is always strictly between the two ratios, e.g. 3/5 < 7/12 < 4/7.

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:

  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

Linear stretching

For a frequency ratio f1/f2 and a (valid) real number α>0 we call (f1α)/(f2α) a linear stretching and (f1+α)/(f2+α) a linear compression.

Examples:

  • 23:29:35 = (4-1/6):(5-1/6):(6-1/6) is a linear stretching of 4:5:6 (approximately 0-5-9\15)
  • 13:16:19 = (4+1/3):(5+1/3):(6+1/3) is a linear compression of 4:5:6 (approximately 0-6-11\20)

Linearly stretching a chord preserves the delta signature, unlike logarithmic stretching, which preserves the logarithmic ratios between intervals (ratios between cent values) in a chord. Note that all the chords in the examples above are isodifferential (+1+1).

A small logarithmic stretch nevertheless approximates a small linear stretch. This can be useful when hunting for approximate DR chords in equal divisions: for example, the 19edo major triad 0-6-11\19 can be logarithmically stretched to 0-6-11\18 and logarithmically compressed to 0-6-11\20. All of these chords are roughly +1+1.