Arabic Maqām Network - TypeScript Library Documentation - v0.1.0
    Preparing search index...
    • Converts pitch class values between different representation formats.

      This is the core conversion function that enables the system to work with different pitch notations (fractions, cents, decimal ratios, string lengths). It converts any input format to all other formats, enabling seamless interoperability between different musical tuning systems.

      Parameters

      • inputValue: string

        The input value as a string

      • inputType: "fraction" | "decimalRatio" | "cents" | "stringLength"

        The format of the input value

      • stringLength: number

        Reference string length for string length calculations

      • referenceFrequency: number

        Reference frequency for frequency calculations

      Returns
          | null
          | {
              fraction: string;
              decimal: string;
              cents: string;
              stringLength: string;
              frequency: string;
          }

      Object with all converted formats, or null if conversion fails

      // Convert a fraction to all formats
      convertPitchClass("3/2", "fraction", 100, 440)
      // Returns: { fraction: "3/2", decimal: "1.5", cents: "701.955", ... }
      // Convert cents to all formats
      convertPitchClass("200", "cents", 100, 440)
      // Returns all equivalent representations of 200 cents