osu! difficulty and pp calculation for all modes

Overview

rosu-pp-js

Difficulty and performance calculation for all osu! modes.

This is a js binding to the Rust library rosu-pp which was bootstrapped through neon. Since all the heavy lifting is done by Rust, rosu-pp-js comes with a very fast performance. Check out rosu-pp's README for more info.

How to use rosu-pp-js

The library has a very simple interface, namely only one function: calculate. This function takes one argument which can have two forms:

  • calculate only one score on a map:
{
    path: "/path/to/file.osu", // the only mandatory field, everything else can be omitted
    mods: integer,             // bit value for mods, defaults to 0 (NM) see https://github.com/ppy/osu-api/wiki#mods
    acc: double,               // if neither acc nor hitresults are specified, acc defaults to 100.0
    n300: integer,             // defaults to value based on acc
    n100: integer,             // defaults to value based on acc
    n50: integer,              // defaults to value based on acc
    nMisses: integer,          // defaults to 0
    nKatu: integer,            // only relevant for osu!ctb
    combo: integer,            // defaults to full combo
    score: integer,            // only relevant for osu!mania
    passedObjects: integer,    // only consider this many hit objects; useful for failed scores; defaults to all objects
}
  • calculate multiple scores on a map:
{
    path: "/path/to/file.osu",
    params: [
        { // everything in here is optional
            mods: integer,
            acc: double,
            n300: integer,
            n100: integer,
            n50: integer,
            nMisses: integer,
            nKatu: integer,
            combo: integer,
            score: integer,
            passedObjects: integer,
        }, ...
    ]
}

Example

const rosu = require('rosu-pp')

let arg = {
    path: "./maps/1980365.osu",
    params: [
        {
            mods: 8 + 16, // HDHR
        }, // everything else is put on default i.e. the best possible score on HDHR
        {
            mods: 24,
            acc: 97.89,
            nMisses: 13,
            combo: 1388,
        }
    ]
}

let results = rosu.calculate(arg)

Return object structure

The calculate function will provide you a list of objects, one for each score you specified parameters for. The exact structure of the contained objects depends on the mode of the map.

In the following code block, fields will be denoted with O/T/C/M for osu!standard, taiko, catch the beat, and mania. If a field is denoted with a mode, that field is guaranteed to be included in the object for maps of that mode, otherwise it is omitted.

{
    mode: integer,            // O/T/C/M (0=O, 1=T, 2=C, 3=M)
    stars: double,            // O/T/C/M
    pp: double,               // O/T/C/M
    ppAcc: double,            // O/T/M
    ppAim: double,            // O
    ppFlashlight: double,     // O
    ppSpeed: double,          // O
    ppStrain: double,         // T/M
    nFruits: integer,         // C
    nDroplets: integer,       // C
    nTinyDroplets: integer,   // C
    aimStrain: double,        // O
    speedStrain: double,      // O
    flashlightRating: double, // O
    sliderFactor: double,     // O
    ar: double,               // O/T/C/M
    cs: double,               // O/T/C/M
    hp: double,               // O/T/C/M
    od: double,               // O/T/C/M
    bpm: double,              // O/T/C/M
    nCircles: integer,        // O/T/M
    nSliders: integer,        // O/T/M
    nSpinners: integer,       // O/T/C
    maxCombo: integer,        // O/T/C
}

Installing rosu-pp-js

Installing rosu-pp-js requires a supported version of Node and Rust.

Once node and Rust are ready to go, you can install the project with npm. In your project directory, run:

$ npm install rosu-pp

or

$ npm install https://github.com/MaxOhn/rosu-pp-js

This fully installs the project, including installing any dependencies and running the build.

Learn More

You might also like...
⚙️ A curated list of static analysis (SAST) tools for all programming languages, config files, build tools, and more.
⚙️ A curated list of static analysis (SAST) tools for all programming languages, config files, build tools, and more.

This repository lists static analysis tools for all programming languages, build tools, config files and more. The official website, analysis-tools.de

Write Cross-platform application with React-like decralative UI framework and scalable ECS architecture all in Rust.

bevy_dioxus Dioxus Plugin for Bevy Write Cross-platform application with React-like decralative UI framework and scalable ECS architecture all in Rust

A simple cli to clone projects and fetch all projects in a GitHub org..

stupid-git A simple cli to clone projects and update all projects. get all repository from GitHub clone all pull all with git stash Usage create sgit.

A bit like tee, a bit like script, but all with a fake tty. Lets you remote control and watch a process

teetty teetty is a wrapper binary to execute a command in a pty while providing remote control facilities. This allows logging the stdout of a process

Rust low-level minimalist APNG writer and PNG reader with just a few dependencies with all possible formats coverage (including HDR).

project Wiki https://github.com/js29a/micro_png/wiki at glance use micro_png::*; fn main() { // load an image let image = read_png("tmp/test.

A rust-cli to track and practise all your DSA links :)

Abhyas Abhyas is a Rust command-line application for managing and interacting with a database of links. Features Check Status: Get the total, complete

Alternative to *fetch, uwuifies all stats.
Alternative to *fetch, uwuifies all stats.

owofetch-rs Alternative to *fetch, uwuifies all stats. Installation: Arch: AUR Other Linux distros: Either compile the source with cargo build --relea

Benson, the light that warms all

benson Benson, the light that warms all Commands Command Info !benson status Checks benson bot status !benson join_vc id Joins a voice channel by ID

Cargo-about - 📜 Cargo plugin to generate list of all licenses for a crate 🦀

📜 cargo-about Cargo plugin for generating a license listing for all dependencies of a crate See the book 📕 for in-depth documentation. Please Note:

Owner
Max
Rust enthusiast
Max
Use the osu!direct button on the osu! website to download beatmaps directly to osu

osum!direct-web Use the osu!direct button on the osu! website to download beatmaps directly to osu! - without osu! supporter. Badges Usage Run the app

oSumAtrIX 1 Jan 21, 2022
Calculation of Wigner symbols and related constants

Calculation of Wigner symbols and related constants This crate computes Wigner 3j coefficients and Clebsch-Gordan coefficients in pure Rust. The calcu

Guillaume Fraux 3 Jan 19, 2022
PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining.

?? ⛓️ ?? Pyskani PyO3 bindings and Python interface to skani, a method for fast fast genomic identity calculation using sparse chaining. ??️ Overview

Martin Larralde 13 Mar 21, 2023
A fast, efficient emulator for the osu! Bancho protocol written in Rust

rosu. A fast, efficient emulator for the osu! Bancho protocol written in Rust. Setup Git clone rosu, setup your nginx (example config is in the ext fo

James 2 Sep 19, 2022
osu!Skills calculator rewritten in rust.

osu!Skills rs osu!Skills calculator rewritten in rust. Usage osu_skills_rs [OPTION]... Skill Calculator Mandatory: --in=FILE: Path to .osu file to pa

null 2 Dec 18, 2022
A fast, efficient osu! beatmap mirror written in asynchronous Rust

A fast, efficient osu! beatmap mirror written in asynchronous Rust. Supports cheesegull, aswell as osu!api v2 formats.

James 4 Oct 28, 2022
ddi is a wrapper for dd. It takes all the same arguments, and all it really does is call dd in the background

ddi A safer dd Introduction If you ever used dd, the GNU coreutil that lets you copy data from one file to another, then you may have encountered a ty

Tomás Ralph 80 Sep 8, 2022
Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size

Scan the symbols of all ELF binaries in all Arch Linux packages for usage of malloc_usable_size (-D_FORTIFY_SOURCE=3 compatibility)

null 3 Sep 9, 2023
fas stand for Find all stuff and it's a go app that simplify the find command and allow you to easily search everything you nedd

fas fas stands for Find all stuff and it's a rust app that simplify the find command and allow you to easily search everything you need. Note: current

M4jrT0m 1 Dec 24, 2021