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
- Enter firstRatio, secondRatio, periodRatio, wrap. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- 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 field | Meaning and units | Accepted input |
|---|---|---|
| firstRatio | First Ratio | Required. Finite number; strictly above 0. |
| secondRatio | Second Ratio | Required. Finite number; strictly above 0. |
| periodRatio | Period Ratio | Required. Finite number; strictly above 1. |
| wrap | Wrap | Required. Boolean. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| rawCents | Raw Cents | Required. Finite number. |
| intervalCents | Wrapped or signed interval in octave-based cents, even when periodRatio is not two. | Required. Finite number. |
{
"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
Similar or alternative tools
- Source Tuning Step Ratio
Return periodRatio^(steps/stepsPerPeriod).
- Public Tuning Reference Pitch Shift
Scale by target/original and return factor, shifted frequency and 1200×log2 factor cents.