simfile.timing.displaybpm

Function & cla

Module Contents

Classes

StaticDisplayBPM

A single BPM value.

RangeDisplayBPM

A range of BPM values.

RandomDisplayBPM

Used by StepMania to obfuscate the displayed BPM with random numbers.

Functions

displaybpm(simfile: simfile.types.Simfile, ssc_chart: simfile.ssc.SSCChart = SSCChart(), ignore_specified: Optional[bool] = False) → DisplayBPM

Get the display BPM from a simfile and optionally an SSC chart.

Attributes

DisplayBPM

Type union of StaticDisplayBPM, RangeDisplayBPM, and RandomDisplayBPM.

class simfile.timing.displaybpm.StaticDisplayBPM

Bases: NamedTuple

A single BPM value.

value :decimal.Decimal

The single BPM value. This property is None in the other DisplayBPM classes.

property min(self) → decimal.Decimal

Returns the single BPM value.

property max(self) → decimal.Decimal

Returns the single BPM value.

property range(self) → None
class simfile.timing.displaybpm.RangeDisplayBPM

Bases: NamedTuple

A range of BPM values.

min :decimal.Decimal
max :decimal.Decimal
property value(self) → None
property range(self) → Tuple[decimal.Decimal, decimal.Decimal]

(min, max) tuple. This property is None in the other DisplayBPM classes.

class simfile.timing.displaybpm.RandomDisplayBPM

Bases: NamedTuple

Used by StepMania to obfuscate the displayed BPM with random numbers.

property value(self) → None
property min(self) → None
property max(self) → None
property range(self) → None
simfile.timing.displaybpm.DisplayBPM

Type union of StaticDisplayBPM, RangeDisplayBPM, and RandomDisplayBPM.

simfile.timing.displaybpm.displaybpm(simfile: simfile.types.Simfile, ssc_chart: simfile.ssc.SSCChart = SSCChart(), ignore_specified: Optional[bool] = False)DisplayBPM

Get the display BPM from a simfile and optionally an SSC chart.

If a DISPLAYBPM property is present (and ignore_specified isn’t set to True), its value is used as follows:

Otherwise, the BPMS property will be used. A single BPM maps to StaticDisplayBPM; if there are multiple, the minimum and maximum will be identified and passed to RangeDisplayBPM.

If both an SSCSimfile (version 0.7 or higher) and an SSCChart are provided, and if the chart contains any timing fields, the chart will be used as the source of timing.