Calculate mod stats

Most endpoints in the API return a beatmap’s difficulty properties with no mod’s applied to them. You can use the calcModStat constant and its methods to convert values such as circle size and approach rate from NoMod to a specified mod.

Every method has a single value as an input of type number and the output will have the same type.

Example

import { calcModStat } from 'osu-web.js';

let dtAR = calcModStat.dt.ar(9); // Output: 10.3
let ezCS = calcModStat.ez.cs(4); // Output: 2

Methods

import { calcModStat } from 'osu-web.js';

const { hr, dt, ez, ht } = calcModStat;
const input: number;

// Convert NM values to HR
hr.cs(input);
hr.od(input);
hr.ar(input);
hr.hp(input);

// Convert NM values to DT
dt.od(input);
dt.bpm(input);
dt.ar(input);
dt.length(input);

// Convert NM values to EZ
ez.cs(input);
ez.od(input);
ez.ar(input);
ez.hp(input);

// Convert NM values to HT
ht.od(input);
ht.bpm(input);
ht.ar(input);
ht.length(input);

Reference

In case you’re unfamiliar with some of these acronyms, here’s what they mean:

AcronymFor
HRHard Rock
DTDouble Time
EZEasy
HTHalf Time
CSCircle size
ODOverall difficulty
ARApproach rate
HPHealth points

Notice that something is missing? Found a typo? Think something's incomplete? Or think that something can be explained better? Feel free to open a pull request or submit an issue on the library's Github repository .