Skip to content

Main content

Scale Step Interval Cent Difference Tool

Interval cents with optional upward wrap into an explicit period ratio, which need not be an octave.

Loading tool…

Description

Return 1200×log2(second/first) and optionally wrap the logarithmic interval modulo log2(periodRatio).

Frequency ratios express pitch relationships, while cents express their logarithm relative to an octave. Playback speed and pitch-preserving time changes obey different models; the relevant reference and physical assumptions must be supplied.

Return 1200×log2(second/first) and optionally wrap the logarithmic interval modulo log2(periodRatio).

When to use this tool

Use Scale Step Interval Cent Difference when you need a stated pitch-ratio, reference or playback-speed term.

How to use the tool and how it works

  1. Enter firstRatio, secondRatio, periodRatio, wrap. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read rawCents, intervalCents. Use the output convention below.

Require positive first/second ratios and periodRatio above one. Return 1200×log2(second/first) and optionally wrap the logarithmic interval modulo log2(periodRatio).1

Input fieldMeaning and unitsAccepted input
firstRatioFirst RatioRequired. Finite number; strictly above 0.
secondRatioSecond RatioRequired. Finite number; strictly above 0.
periodRatioPeriod RatioRequired. Finite number; strictly above 1.
wrapWrapRequired. Boolean.
Output fieldInterpretationReturned shape
rawCentsRaw CentsRequired. Finite number.
intervalCentsWrapped or signed interval in octave-based cents, even when periodRatio is not two.Required. Finite number.
json
{
  "input": {
    "firstRatio": 1,
    "secondRatio": 1.5,
    "periodRatio": 2,
    "wrap": false
  },
  "output": {
    "rawCents": 701.9550008653874,
    "intervalCents": 701.9550008653874
  }
}

Limitations and assumptions

  • Cents use the octave reference of 1200 even for a non-octave wrapping period. The tool does not measure pitch or impose equal temperament.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use calibrated audio measurements and the appropriate processing method for actual recordings. Retain cultural tuning context and verify reference frequency, speed history and instrument assumptions separately.

References

  1. Calculation and input contract: ethnomusicology/scale-step-interval-cent-difference — tool.io

Similar or alternative tools