Arabic Maqām Network - TypeScript Library Documentation - v0.1.0
    Preparing search index...
    • Computes the interval between two fractions and returns the result as a simplified fraction.

      This function calculates the ratio between two fractions, which is essential for determining musical intervals in just intonation and other tuning systems. The result is automatically simplified using the Greatest Common Divisor.

      Mathematical formula: (c/d) / (a/b) = (c * b) / (d * a)

      Parameters

      • firstFraction: string

        The first fraction in "numerator/denominator" format (e.g., "3/2")

      • secondFraction: string

        The second fraction in "numerator/denominator" format (e.g., "4/3")

      Returns string

      The interval as a simplified fraction string

      // Calculate interval from 3/2 to 4/3
      computeFractionInterval("3/2", "4/3")
      // Returns "8/9" (the simplified result of (4*2)/(3*3))
      // Calculate interval from 5/4 to 6/5
      computeFractionInterval("5/4", "6/5")
      // Returns "24/25"