simfile.notes.count =================== .. py:module:: simfile.notes.count Functions --------- .. autoapisummary:: simfile.notes.count.count_grouped_notes simfile.notes.count.count_steps simfile.notes.count.count_jumps simfile.notes.count.count_mines simfile.notes.count.count_hands simfile.notes.count.count_holds simfile.notes.count.count_rolls Module Contents --------------- .. py:function:: count_grouped_notes(grouped_notes_iterator: Iterable[simfile.notes.group.GroupedNotes], same_beat_minimum: int = 1) -> int Count a stream of :class:`.GroupedNotes`. To count only groups of N or more notes, use `same_beat_minimum`. .. py:function:: count_steps(notes: Iterable[simfile.notes.Note], *, include_note_types: FrozenSet[simfile.notes.NoteType] = DEFAULT_NOTE_TYPES, same_beat_notes: simfile.notes.group.SameBeatNotes = SameBeatNotes.JOIN_ALL, same_beat_minimum: int = 1) -> int Count the steps in a note stream. The definition of "step count" varies by application; the default configuration tries to match StepMania's definition as closely as possible: * Taps, holds, rolls, and lifts are eligible for counting. * Multiple inputs on the same beat are only counted once. These defaults can be changed using the keyword parameters. Refer to :class:`.SameBeatNotes` for alternative ways to count same-beat notes. .. py:function:: count_jumps(notes: Iterable[simfile.notes.Note], *, include_note_types: FrozenSet[simfile.notes.NoteType] = DEFAULT_NOTE_TYPES, same_beat_notes: simfile.notes.group.SameBeatNotes = SameBeatNotes.JOIN_ALL) -> int Count the jumps (2+ simultaneous notes) in a note stream. This implementation defers to :func:`count_steps` with the same default parameters, except only groups of 2 or more notes are counted (i.e. `same_beat_minimum` is set to 2). .. py:function:: count_mines(notes: Iterable[simfile.notes.Note]) -> int Count the mines in a note stream. .. py:function:: count_hands(notes: Iterable[simfile.notes.Note], *, include_note_types: FrozenSet[simfile.notes.NoteType] = DEFAULT_NOTE_TYPES, same_beat_notes: simfile.notes.group.SameBeatNotes = SameBeatNotes.JOIN_ALL, same_beat_minimum: int = 3) -> int Count the hands (3+ simultaneous notes) in a note stream. This implementation defers to :func:`count_steps` with the same default parameters, except only groups of 3 or more notes are counted (i.e. `same_beat_minimum` is set to 3). .. py:function:: count_holds(notes: Iterable[simfile.notes.Note], *, orphaned_head: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION, orphaned_tail: simfile.notes.group.OrphanedNotes = OrphanedNotes.DROP_ORPHAN) -> int Count the hold notes in a note stream. By default, this method validates that hold heads connect to their corresponding tails. This validation can be turned off by setting the `orphaned_head` and `orphaned_tail` arguments; see :class:`.OrphanedNotes` for more details. .. py:function:: count_rolls(notes: Iterable[simfile.notes.Note], *, orphaned_head: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION, orphaned_tail: simfile.notes.group.OrphanedNotes = OrphanedNotes.DROP_ORPHAN) -> int Count the roll notes in a note stream. By default, this method validates that roll heads connect to their corresponding tails. This validation can be turned off by setting the `orphaned_head` and `orphaned_tail` arguments; see :class:`.OrphanedNotes` for more details.