simfile.timing.displaybpm ========================= .. py:module:: simfile.timing.displaybpm .. autoapi-nested-parse:: Function & cla Attributes ---------- .. autoapisummary:: simfile.timing.displaybpm.DisplayBPM Classes ------- .. autoapisummary:: simfile.timing.displaybpm.StaticDisplayBPM simfile.timing.displaybpm.RangeDisplayBPM simfile.timing.displaybpm.RandomDisplayBPM Functions --------- .. autoapisummary:: simfile.timing.displaybpm.displaybpm Module Contents --------------- .. py:class:: StaticDisplayBPM Bases: :py:obj:`NamedTuple` A single BPM value. .. py:attribute:: value :type: decimal.Decimal The single BPM value. This property is None in the other DisplayBPM classes. .. py:property:: min :type: decimal.Decimal Returns the single BPM value. .. py:property:: max :type: decimal.Decimal Returns the single BPM value. .. py:property:: range :type: None .. py:class:: RangeDisplayBPM Bases: :py:obj:`NamedTuple` A range of BPM values. .. py:attribute:: min :type: decimal.Decimal .. py:attribute:: max :type: decimal.Decimal .. py:property:: value :type: None .. py:property:: range :type: Tuple[decimal.Decimal, decimal.Decimal] (min, max) tuple. This property is None in the other DisplayBPM classes. .. py:class:: RandomDisplayBPM Bases: :py:obj:`NamedTuple` Used by StepMania to obfuscate the displayed BPM with random numbers. .. py:property:: value :type: None .. py:property:: min :type: None .. py:property:: max :type: None .. py:property:: range :type: None .. py:data:: DisplayBPM Type union of :class:`StaticDisplayBPM`, :class:`RangeDisplayBPM`, and :class:`RandomDisplayBPM`. .. py:function:: displaybpm(source: Union[simfile.types.Simfile, simfile.types.AttachedChart], *, 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 :class:`StaticDisplayBPM` * Two ":"-separated numbers maps to :class:`RangeDisplayBPM` * A literal "*" maps to :class:`RandomDisplayBPM` Otherwise, the BPMS property will be used. A single BPM maps to :class:`StaticDisplayBPM`; if there are multiple, the minimum and maximum will be identified and passed to :class:`RangeDisplayBPM`. If an :class:`.AttachedChart` belonging to an :class:`.SSCSimfile` (version 0.7 or higher) is provided and contains timing fields, the the chart will be used as the source of timing.