@libraz/libcantus - v1.1.0
    Preparing search index...

    Function centsFromNearestStep

    • How far a frequency sits from its nearest step, in cents.

      Positive means sharp of the step, negative flat.

      Parameters

      • freq: number

        Frequency in Hz.

      • tuning: TuningTable = TWELVE_TET

        The tuning (default 12-TET).

      Returns number

      The signed deviation in cents.

      import { centsFromNearestStep } from '@libraz/libcantus';
      Math.round(centsFromNearestStep(442)); // 8