Tuesday, November 5, 2024

Interval Reduction

This page is dedicated to the interval reduction operation, a foundational concept in music theory that I’ve explained briefly in other articles where it often plays a key role. Interval reduction is a universal yet frequently misunderstood process, with "octave reduction" as one specific example. Here, I offer a formal definition and consistent mathematical notation for interval reduction, aligning it with the notation developed for the interval matrix. This approach provides a basis for broader generalization in music analysis and tuning theory.

Note on Ratio Notation: In music theory literature, ratios and fractions are often used interchangeably, particularly when discussing relationships like string length, frequencies, harmonics, or subharmonics. This overlap can lead to ambiguity, especially when referring to intervals without specifying direction. For instance, while octave equivalence remains clear across notations (1:2, 2:1, 1/2, 2/1), we may lose the specific octave reference—whether above or below—if this is not explicitly noted. Even worse with 2:3, 3:2, 2/3, 3/2, without specifying we can't be sure if it's a fifth or a fourth.

To address this, we follow the convention that treats ratios like 4:5:6 as indicative of pitch relationships, where each number represents a multiple of a fundamental (1). For example, in this format, 4:5:6 represents a major chord as the intervals 1/1, 5/4 and 6/4=3/2.

Examples:
- Octave (second harmonic): Ratio 1:2, Fraction 2/1, Decimal 2
- Second Subharmonic: Ratio 2:1, Fraction 1/2, Decimal 0.5
- Fifth: Ratio 2:3, Fraction 3/2, Decimal 1.5
- Fourth (below unison): Ratio 3:2, Fraction 2/3, Decimal 0.666...

This notation standard helps clarify both direction and pitch relationships, reducing ambiguity when discussing intervals and chords across different contexts.

Interval Definition:
To avoid ambiguity, interval here refers specifically to a musical interval, where values represent multiples of a fundamental frequency, typically normalized to a unison. When referring to a mathematical range, such as \((1,2]\), we will use the term space.
This distinction helps clarify references to musical intervals, such as the octave (a frequency multiplier with a value of 2), as distinct from the octave space, defined as any interval \((a,2a]\) for \(a \in \mathbb{R^+}\).

Interval Reduction

Definition:
Interval Reduction is a scaling transformation that maps a positive real number \(x\) within the bounds of a specified space, denoted \((1,b]\), by repeatedly multiplying or dividing \(x\) by \(b\), until \(x\) falls within \((1,b]\). Here, \(b,x \in \mathbb{R}^+ \) with \(x \notin (1,b]\).

Notation:
The interval reduction operation can be represented as a mapping into a modular "interval space." We use the following notation to generalize this process concisely:

Using the mod operator:
\[x \bmod 1:b = [x] \] where \([x]\) represents the equivalence class or representative of \(x\) within the \((1,b]\) space.

This notation mirrors modular arithmetic while specifying that it applies to interval reduction:
\[ x \equiv [x] \pmod {1:b} \] To capture all equivalence classes in a similar form:
\[ xb^n \equiv [x] \pmod {1:b},\, n \in \mathbb{Z} \] This expression shows that the fifth 2:3 is the class representative in octave space of the third harmonic (1:3), the sixth (1:6), twelfth (1:12), (1:24), (1:48), and so on, with respect to unison.

Example Application:

For \( x=48, b=2\):
\[48 \bmod 1:2 = 1.5 = 3/2 \text{ (Fifth)}\] Normalization for Other Ranges:

To perform interval reduction in ranges other than \((1,b]\), normalize the space as follows:

\(x \bmod a:b ⇒ x \bmod 1:b/a \)

For example, with \(x=7, a=4, b=5\):
\[7 \bmod 4:5 = 7 \bmod 1:5/4 = 1.174\ldots\]This approach is particularly clear for rational values in the space. We avoid directly writing \(7 \bmod 5/4\) to prevent confusion with traditional modular arithmetic; using ratio notation, \(7 \bmod 4:5\) explicitly denotes interval modularity, simplifying it as \(7 \bmod 1:5/4\). For spaces involving irrational values, we write the ratio starting from 1, such as \(5 \bmod 1:\sqrt{2}\), to maintain clarity.

The process can also be expressed explicitly using logarithms and the classic mod operator:
\[ x \bmod a:b = (b/a)^{log_{b/a}(x) \bmod 1} \] Example:
\[5 \bmod 1:2 = 2^{log_2(5) \bmod 1} = 5/4 = 1.25 \text{ (Major third)}\] In this case, we map the fractional part of the logarithm (base 2) of 5 into the octave cycle.

While interval reduction is not a strict mathematical function—relying on iterative scaling rather than a single closed-form—it can be expressed as a function, especially within octave space. This space is particularly relevant to music theory as it relates to chroma equivalence and pitch grouping in human perception. Here, the "octave reduction" is the chroma function:
\[\Xi(x) = x \bmod 1:2 = 2^{log_2(x) \bmod 1}\] This function is a special case of our interval reduction process, where b = 2. This "octave reduction" maps any positive number to its equivalent within the octave cycle, representing its chroma.
We can extend this idea to define a general chroma function \(\Xi_{1:b}(x)\), where 'b' defines the specific interval space: \[\Xi_{1:b}(x) = x \bmod 1:b\] Example, for \( x = 7, b = 5/4\): \[\Xi_{4:5}(7) = 1.17440512\] Therefore, \(\Xi_{1:b}(x)\) effectively represents interval reduction within a given space. The chroma function \(\Xi(x)\), previously used in my work, is a specific case of this more generalized interval reduction function that without parameters, defaults to octave space.

The choice of notation can depend on context. For example, if one simply needs to find the chroma of a pitch within a tuning system, the compact chroma function provides a straightforward approach. However, the modular notation for interval reduction clarifies the process when building tuning systems and can also be applied in other mathematical contexts. For instance, in \( x \bmod 1:b = [x]\), the modularity is evident by viewing the operation as \(x \bmod 1:b = x/b^n\) , where \(n\) is the integer that scales \(x\) into the space \((1,b]\). While our primary interest may be in the result, here [x], the value of \(n\) and the sequences it generates with various inputs form the basis of the logarithm algorithm I introduced in [link].

Coding:
Most programming languages support logarithmic functions, so the chroma function can be implemented concisely. For example, in Python:

import math

def chroma(x):
    return 2 ** (math.log2(x) % 1)

This implementation uses logarithmic reduction to map x to its equivalent within the octave space (1,2]. However, for a more generalized approach that applies to any interval space (1,b], here’s the Python code to perform interval reduction for x mod 1:b :

def interval_reduction(x, b):
    # Ensure inputs are positive real numbers and x is outside (1, b]
    if x <= 0 or b <= 1 or (1 < x <= b):
        raise ValueError("Ensure x > 0, b > 1, and x is not within (1, b].")

    # Apply interval reduction by scaling x within the (1, b] range
    while x > b:
        x /= b
    while x <= 1:
        x *= b
       
    return x

Interval Reduction

This page is dedicated to the interval reduction operation, a foundational concept in music theory that I’ve explained briefly in other arti...