simfile.timing
Timing data classes, plus submodules that operate on timing data.
Submodules
Package Contents
Classes
A fractional beat value, denoting vertical position in a simfile. |
|
An event that occurs on a particular beat, e.g. a BPM change or stop. |
|
A list of |
|
Timing data for a simfile, possibly enriched with SSC chart timing. |
- class simfile.timing.Beat
Bases:
fractions.FractionA fractional beat value, denoting vertical position in a simfile.
The constructor the same arguments as Python’s
Fraction:Takes a string like ‘3/2’ or ‘1.5’, another Rational instance, a numerator/denominator pair, or a float.
If the input is a float or string, the resulting fraction will be rounded to the nearest
tick().
- class simfile.timing.BeatValue
Bases:
NamedTupleAn event that occurs on a particular beat, e.g. a BPM change or stop.
The decimal value’s semantics vary based on the type of event:
BPMS: the new BPM value
STOPS, DELAYS: number of seconds to pause
WARPS: number of beats to skip
- value: decimal.Decimal
- class simfile.timing.BeatValues(initlist=None)
Bases:
simfile._private.generic.ListWithRepr[BeatValue]A list of
BeatValueinstances.- classmethod from_str(string: str | None) BeatValues
Parse the MSD value component of a timing data list.
Specifically, BPMS, STOPS, DELAYS, and WARPS are the timing data lists whose values can be parsed by this method.
- class simfile.timing.TimingData(simfile: simfile.types.Simfile, chart: simfile.types.Chart | None = None)
Timing data for a simfile, possibly enriched with SSC chart timing.
If both an
SSCSimfile(version 0.7 or higher) and anSSCChartare supplied to the constructor, and if the chart contains any timing fields, the chart will be used as the source of timing data.Per StepMania’s behavior, the offset defaults to zero if the simfile (and/or SSC chart) doesn’t specify one. (However, unlike StepMania, the BPM does not default to 60 when omitted; the default BPM doesn’t appear to be used deliberately in any existing simfiles, whereas the default offset does get used intentionally from time to time.)
- bpms: BeatValues
- stops: BeatValues
- delays: BeatValues
- warps: BeatValues
- offset: decimal.Decimal