How to use the slider.Beatmap.from_path function in slider

To help you get started, we’ve selected a few slider examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github llllllllll / slider / tests / test_beatmap.py View on Github external
def test_beatmap_methods():
    # Difficulty calculations omitted
    beatmap = Beatmap.from_path(tatoe_path)

    # These functions take in mods
    assert beatmap.ar() == 9.5
    assert beatmap.bpm_min() == 180
    assert beatmap.bpm_max() == 195
    assert beatmap.cs() == 4
    assert beatmap.hp() == 6.5  # issue #57
    assert beatmap.od() == 9
github llllllllll / slider / tests / test_beatmap.py View on Github external
def test_beatmap_parameters():
    beatmap = Beatmap.from_path(tatoe_path)
    assert beatmap.format_version == 14
    assert beatmap.display_name == \
           "AKINO from bless4 & CHiCO with HoneyWorks - MIIRO " + \
           "vs. Ai no Scenario [Tatoe]"

    # [General]
    assert beatmap.audio_filename == "tatoe.mp3"
    assert beatmap.audio_lead_in == timedelta()
    assert beatmap.preview_time == timedelta(milliseconds=6538)
    assert beatmap.countdown == False
    assert beatmap.sample_set == "Normal"
    assert beatmap.stack_leniency == 0.7
    assert beatmap.mode == 0
    assert beatmap.letterbox_in_breaks == False
    assert beatmap.widescreen_storyboard == False
github llllllllll / slider / slider / example_data / beatmaps / __init__.py View on Github external
def example_beatmap(name):
    """Load one of the example beatmaps.

    Parameters
    ----------
    name : str
        The name of the example file to open.
    """
    return Beatmap.from_path(
        resource_filename(
            __name__,
            name,
        ),
github circleguard / circleguard / circleguard / visualizer / visualizer.py View on Github external
self.setMinimumSize(GAMEPLAY_WIDTH + GAMEPLAY_PADDING_WIDTH*2, GAMEPLAY_HEIGHT + GAMEPLAY_PADDING_HEIGHT*2)

        # list of timestamps to highlight the frames of in a different color
        self.events = events

        self.painter = QPainter()
        self.scale = 1
        self.x_offset = 0
        self.y_offset = 0

        # beatmap init stuff
        self.hitobjs = []


        if beatmap_info.path:
            self.beatmap = Beatmap.from_path(beatmap_info.path)
            self.playback_len = self.get_hit_endtime(self.beatmap.hit_objects[-1])
        elif beatmap_info.map_id:
            self.beatmap = Library(get_setting("cache_dir")).lookup_by_id(beatmap_info.map_id, download=True, save=True)
            self.playback_len = self.get_hit_endtime(self.beatmap.hit_objects[-1])
        else:
            self.playback_len = 0

        self.has_beatmap = beatmap_info.available()
        # TODO inelegant way to handle this, maybe rename some variables at the least
        if not get_setting("render_beatmap"):
            self.has_beatmap = False

        # beatmap stuff
        if self.has_beatmap:
            # values taken from https://github.com/ppy/osu-wiki/blob/master/meta/unused/difficulty-settings.md
            # but it was taken from the osu! wiki since then so this might be a bit incorrect.