simfile.timing.displaybpm
Function & cla
Module Contents
Classes
A single BPM value. |
|
A range of BPM values. |
|
Used by StepMania to obfuscate the displayed BPM with random numbers. |
Functions
|
Get the display BPM from a simfile and optionally an SSC chart. |
Attributes
Type union of |
-
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
-
property
-
simfile.timing.displaybpm.
DisplayBPM
Type union of
StaticDisplayBPM
,RangeDisplayBPM
, andRandomDisplayBPM
.
-
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:
One number maps to
StaticDisplayBPM
Two “:”-separated numbers maps to
RangeDisplayBPM
A literal “*” maps to
RandomDisplayBPM
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 toRangeDisplayBPM
.If both an
SSCSimfile
(version 0.7 or higher) and anSSCChart
are provided, and if the chart contains any timing fields, the chart will be used as the source of timing.