Arabic Maqām Network - TypeScript Library Documentation - v0.1.0
    Preparing search index...
    • Shifts a pitch class by a specified number of octaves using array lookup.

      This is the preferred method for shifting pitch classes as it uses the pre-computed pitch class array for accuracy. It finds the target pitch class in a different octave by calculating the appropriate array index.

      Parameters

      • allPitchClasses: default[]

        Complete array of all available pitch classes

      • pitchClass: undefined | default

        The pitch class to shift (can be undefined)

      • octaveShift: number

        Number of octaves to shift (positive = up, negative = down)

      Returns default

      The shifted pitch class, or empty pitch class if operation fails

      // Shift a pitch class up one octave
      const shifted = shiftPitchClass(allPitches, originalPitch, 1);
      // Shift a pitch class down two octaves  
      const shifted = shiftPitchClass(allPitches, originalPitch, -2);