simfile.notes.count

Module Contents

Functions

count_grouped_notes(grouped_notes_iterator: Iterable[simfile.notes.group.GroupedNotes], same_beat_minimum: int = 1) → int

Count a stream of GroupedNotes.

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.

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.

count_mines(notes: Iterable[simfile.notes.Note]) → int

Count the mines in a note stream.

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.

count_holds(notes: Iterable[simfile.notes.Note], *, orphaned_head: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION, orphaned_tail: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION) → int

Count the hold notes in a note stream.

count_rolls(notes: Iterable[simfile.notes.Note], *, orphaned_head: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION, orphaned_tail: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION) → int

Count the roll notes in a note stream.

simfile.notes.count.count_grouped_notes(grouped_notes_iterator: Iterable[simfile.notes.group.GroupedNotes], same_beat_minimum: int = 1) → int

Count a stream of GroupedNotes.

To count only groups of N or more notes, use same_beat_minimum.

simfile.notes.count.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 SameBeatNotes for alternative ways to count same-beat notes.

simfile.notes.count.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 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).

simfile.notes.count.count_mines(notes: Iterable[simfile.notes.Note]) → int

Count the mines in a note stream.

simfile.notes.count.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 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).

simfile.notes.count.count_holds(notes: Iterable[simfile.notes.Note], *, orphaned_head: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION, orphaned_tail: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION) → 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 to KEEP_ORPHAN or DROP_ORPHAN; see OrphanedNotes for more details.

simfile.notes.count.count_rolls(notes: Iterable[simfile.notes.Note], *, orphaned_head: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION, orphaned_tail: simfile.notes.group.OrphanedNotes = OrphanedNotes.RAISE_EXCEPTION) → 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 to KEEP_ORPHAN or DROP_ORPHAN; see OrphanedNotes for more details.