analysis.osu.mania package

Submodules

analysis.osu.mania.map_data module

class analysis.osu.mania.map_data.ManiaMapData

Bases: object

END_TIME = 1
START_TIME = 0
static all_times(flat=True)
static end_times(hitobject_data, column=None)
static get_hitobject_data(hitobjects)
[
[ [ time_start, time_end ], [ time_start, time_end ], … N notes in col ], [ [ time_start, time_end ], [ time_start, time_end ], … N notes in col ], … N col

]

static get_idx_end_time(hitobject_data, column, time)
static get_idx_start_time(hitobject_data, column, time)
static start_end_times(hitobject_data, column)
static start_times(hitobject_data, column=None)

analysis.osu.mania.map_metrics module

class analysis.osu.mania.map_metrics.ManiaMapMetrics

Bases: object

Raw metrics

static calc_avg_nps(hitobject_data, time, ms_window)

Gets average notes with window of ms_window for all columns at time time

Parameters:
  • hitobject_data (numpy.array) – Hitobject data from ManiaMapData.get_hitobject_data
  • time (int) – Time to calculate notes per second for
  • ms_window (int) – Milliseconds back in time to take account
Returns:

Average notes per second

Return type:

float

static calc_avg_nps_col(hitobject_data, time, ms_window, column)

Gets average notes with window of ms_window for the specified column at time time

Parameters:
  • hitobject_data (numpy.array) – Hitobject data from ManiaMapData.get_hitobject_data
  • time (int) – Time to calculate notes per second for
  • ms_window (int) – Milliseconds back in time to take account
  • column (int) – Which column number to get average note rate for
Returns:

Average notes per second for specified column

Return type:

float

static calc_max_press_rate_per_col(action_data, window_ms=1000)

Takes which column has max presses per second within indicated window_ms of time

Parameters:
  • action_data (numpy.array) – Action data from ManiaMapData.get_action_data
  • window_ms (int) – Duration in milliseconds for which actions are counted up
Returns:

  • (numpy.array, numpy.array)
  • Tuple of (times, max_aps_per_col). times are timings corresponding to recorded actions per second. – max_aps_per_col are max actions per second at indicated time.

static calc_note_intervals(action_data, col)

Gets the duration (time interval) between each note in the specified col

Parameters:
  • action_data (numpy.array) – Action data from ManiaActionData.get_action_data
  • col (int) – Which column number to get note intervals for
Returns:

Tuple of (start_times, intervals). start_times are timings corresponding to start of notes. intervals are the timings difference between current and previous notes’ starting times. Resultant array size is len(hitobject_data) - 1.

Return type:

(numpy.array, numpy.array)

static calc_notes_per_sec(hitobject_data, column=None)

Gets average note rate with window of 1 second throughout the beatmap in the specified column

Parameters:
  • hitobject_data (numpy.array) – Hitobject data from ManiaMapData.get_hitobject_data
  • column (int) – Which column number to get average note rate for. If left blank, interprets all columns as one.
Returns:

Tuple of (start_times, notes_per_sec). start_times are timings corresponding to start of notes. notes_per_sec are average note rates at start_times point in time. Resultant array size is len(hitobject_data) - 1.

Return type:

(numpy.array, numpy.array)

static calc_press_rate(action_data, col=None, window_ms=1000)

Calculates presses per second across all columns within indicated window_ms of time. Has a moving that shifts to next note occuring on new timing

Parameters:
  • action_data (numpy.array) – Action data from ManiaMapData.get_action_data
  • col (int) – Column to calculated presses per second for
  • window_ms (int) – Duration in milliseconds for which actions are counted up
Returns:

  • (numpy.array, numpy.array)
  • Tuple of (times, aps). times are timings corresponding to recorded actions per second. – aps are actions per second at indicated time.

static data_to_anti_press_durations(action_data)

Takes action_data, and reduces them to durations of anti-presses. Anti-presses are associated with points in LN type patterns where there is a spot between two holdnotes where the finger is released. For example,

[138317.,      1.,      0.],
[138567.,      3.,      0.],
[138651.,      1.,      1.],
[138901.,      2.,      2.],
[138984.,      2.,      2.],
[139234.,      3.,      3.],

becomes

[138317.,      0.,      0.  ],
[138567.,      84.,     0.  ],
[138651.,      0.,      0.  ],
[138901.,      0.,      0.  ],
[138984.,      0.,      0.  ],
[139234.,      0.,      0.  ],

Note

This does not filter out single notes and

will show process single note press/release times as well

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data with hold note durations
static data_to_hold_durations(action_data)

Takes action_data, filters out non hold notes, and reduces them to durations they last for. For example,

[138317.,      1.,      0.],
[138567.,      3.,      0.],
[138651.,      1.,      1.],
[138901.,      2.,      2.],
[138984.,      2.,      2.],
[139234.,      3.,      3.],

becomes

[138317.,      250.,    0.  ],
[138567.,      0.,      0.  ],
[138651.,      583.,    583.],
[138901.,      0.,      0.  ],
[138984.,      0.,      0.  ],
[139234.,      0.,      0.  ],

Note

This does not filter out single notes and

will show process single note press/release times as well

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data with hold note durations
static data_to_press_durations(action_data)

Takes action_data, and turns it into time intervals since last press. For example,

[138317.,      1.,      0.],
[138567.,      3.,      0.],
[138651.,      1.,      1.],
[138901.,      2.,      2.],
[138984.,      2.,      2.],
[139234.,      3.,      3.],

becomes

[138317.,      0.,      0.  ],
[138567.,      0.,      0.  ],
[138651.,      334.,    0.  ],
[138901.,      0.,      0.  ],
[138984.,      0.,      0.  ],
[139234.,      0.,      0.  ],
Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data with intervals between presses
static detect_chords(action_data)

Masks note that are detected as chords

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data mask of actions detected that correspond to chord patterns. 1 if chord pattern 0 otherwise
static detect_hold_notes(action_data)

Masks hold notes; removes single notes from data.

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data mask of actions detected
static detect_holds_during_release(action_data)

Masks holds that occur when there is at least one release in one of the columns

This is useful for determining which holds are harder due to finger independence. Releases have a tendency to make affected fingers release prematurely.

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data mask of actions detected
static detect_inverse(action_data)

Masks notes that are detected as inverses

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data mask of actions detected
static detect_jacks(action_data)

Masks note that are detected as jacks

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data mask of actions detected that correspond to jack patterns. 1 if jack pattern 0 otherwise
static detect_presses_during_holds(action_data)

Masks presses that occur when there is at least one hold in one of the columns

This is useful for determining which presses are harder due to finger independence. Holds have a tendency to make affected fingers slower or less accurate to press.

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • action_data mask of actions detected
static filter_single_note_releases(action_data)

Removes releases associated with single notes by setting them to FREE

Parameters:action_data (numpy.array) – Action data from ManiaActionData.get_action_data
Returns:
  • numpy.array
  • filtered action_data
static hand_hold(hitobject_data, min_release=150)

Dermines on a scale from 0.0 to 1.0 how likely a player can’t raise their hand Returns two values, for left and right hand

time: time to calculate notes per second for ms_window: how many ms back in time to take account

static hand_hold_ratio(hitobject_data, min_release=150)
static to_binary_signal(hitobject_data, tap_duration=25)

Returns a binary signal indicating press or release for the specified column at the ms resolution specified

tap_duration: Length of a single tap

analysis.osu.mania.replay_data module

analysis.osu.mania.score_data module

class analysis.osu.mania.score_data.ManiaScoreData

Bases: object

DATA_MAP_IDX = 2
DATA_OFFSET = 0
DATA_TYPE = 1
IDX_MAP_IDX = 3
IDX_MAP_T = 1
IDX_REPLAY_T = 0
IDX_TYPE = 2
TYPE_EMPTY = 3
TYPE_HITP = 0
TYPE_HITR = 1
TYPE_MISS = 2
blank_miss = False
dynamic_window = False
static filter_by_hit_type(score_data, hit_types, invert=False)
static get_score_data(map_data, replay_data)
[
[
[ offset, type, action_idx ], [ offset, type, action_idx ], … N events in col

], [

[ offset, type, action_idx ], [ offset, type, action_idx ], … N events in col

], … N cols

]

lazy_sliders = True
static model_ideal_acc(mean, stdev, num_notes, score_point_judgements=None)

Set for OD8

static model_ideal_acc_data(score_data, score_point_judgements=None)

Set for OD8

static model_num_hits(mean, stdev, num_notes)
static model_offset_prob(mean, stdev, offset)
neg_hit_miss_range = 200
neg_hit_range = 100
neg_rel_miss_range = 500
neg_rel_range = 300
notelock = True
static odds_acc(score_data, target_acc)
static odds_all_tap_within(score_data, offset)

Creates a gaussian distribution model using avg and var of tap offsets and calculates the odds that all hits are within the specified offset

Returns: probability all random values [X] are between -offset <= X <= offset
TL;DR: look at all the hits for scores; What are the odds all of them are between -offset and offset?
static odds_all_tap_within_trials(score_data, offset, trials)

Creates a gaussian distribution model using avg and var of tap offsets and calculates the odds that all hits are within the specified offset after the specified number of trials

Returns: probability all random values [X] are between -offset <= X <= offset after trial N
TL;DR: look at all the hits for scores; What are the odds all of them are between -offset and offset during any of the number
of attempts specified?
static odds_some_tap_within(score_data, offset)

Creates a gaussian distribution model using avg and var of tap offsets and calculates the odds that some hit is within the specified offset

Returns: probability one random value [X] is between -offset <= X <= offset
TL;DR: look at all the hits for scores; What are the odds of you picking
a random hit that is between -offset and offset?
overlap_hit_handling = False
overlap_miss_handling = False
pos_hit_miss_range = 200
pos_hit_range = 100
pos_rel_miss_range = 500
pos_rel_range = 300
static press_interval_mean(score_data)
static tap_offset_mean(score_data)
static tap_offset_stdev(score_data)
static tap_offset_var(score_data)
class analysis.osu.mania.score_data.ManiaScoreDataEnums

Bases: enum.Enum

An enumeration.

COLUMN = 1
HITOBJECT_IDX = 4
HIT_OFFSET = 2
TIME = 0

Module contents