Exemple #1
0
def f024(m: OsuMap):
    events = [*[SvOsuMeasureLineEvent(
              firstOffset=i, lastOffset=9337,
              startX=1, endX=0,
              startY=-1, endY=0,
              funcs=[
                  lambda x, j=j: -x + j for j in np.linspace(0, 1, 15)
              ]) for i in np.linspace(8857, 9337, 8)],

              *[SvOsuMeasureLineEvent(
              firstOffset=9337, lastOffset=11017,
              startX=i, endX=i + 1,
              startY=-1, endY=1,
              funcs=[
                  lambda x: -x + 2
              ]) for i in np.linspace(0, 1, 50)],

              *[SvOsuMeasureLineEvent(
              firstOffset=9337, lastOffset=11017,
              startX=i, endX=i + 1,
              startY=-1, endY=1,
              funcs=[
                  lambda x: x - 2
              ]) for i in np.linspace(0, 1, 50)],
              ]
    f = svOsuMeasureLineMD(events,
                           scalingFactor=SCALE,
                           firstOffset=8857,
                           lastOffset=11017,
                           paddingSize=PADDING,
                           endBpm=250)

    m.svs.extend(f[0])
    m.bpms.extend(f[1])
Exemple #2
0
def f950(m: OsuMap):
    FIRST = 375444
    LAST = 383124

    events = [
        *[SvOsuMeasureLineEvent(
        firstOffset=o, lastOffset=LAST,
        startX=0, endX=1,
        startY=-1, endY=1,
        funcs=[
            lambda x: np.cos(x * pi / 2) ** COS_POWER
        ]) for o in np.linspace(FIRST, LAST, 75)],

        *   [SvOsuMeasureLineEvent(
        firstOffset=o, lastOffset=LAST,
        startX=0, endX=1,
        startY=-1, endY=1,
        funcs=[
            lambda x: -np.cos(x * pi / 2) ** COS_POWER
        ]) for o in np.linspace(FIRST, LAST, 75)]
    ]

    for e, (first, last) in enumerate(zip(np.linspace(FIRST, LAST, 10)[:-1], np.linspace(FIRST, LAST, 10)[1:])):
        svs, bpms = svOsuMeasureLineMD(events=events,
                                       scalingFactor=SCALE,
                                       firstOffset=first,
                                       lastOffset=last,
                                       paddingSize=PADDING * e,
                                       endBpm=MIN_BPM)
        m.svs.extend(svs)
        m.bpms.extend(bpms[:-1])

    m.bpms.append(OsuBpm(LAST, 250))
Exemple #3
0
def f018(m: OsuMap):
    events = [*[SvOsuMeasureLineEvent(
              firstOffset=7297 + i, lastOffset=7297 + 500 + i,
              startX=0.01, endX=40,
              startY=-10, endY=10,
              funcs=[
                  lambda x: np.log(x)
              ]) for i in np.linspace(0, 500, 5)],
              *[SvOsuMeasureLineEvent(
              firstOffset=7417 + i, lastOffset=7417 + 500 + i,
              startX=0.01, endX=40,
              startY=-10, endY=10,
              funcs=[
                  lambda x: np.log(x)
              ]) for i in np.linspace(0, 500, 5)],
              *[SvOsuMeasureLineEvent(
              firstOffset=7447, lastOffset=7657,
              startX=0, endX=1,
              startY=0, endY=1,
              funcs=[
                  lambda x, i=i: i * x for i in np.linspace(0, 1, 100)
              ])]
              ]

    f = svOsuMeasureLineMD(events,
                           scalingFactor=SCALE,
                           firstOffset=7297,
                           lastOffset=7657,
                           paddingSize=PADDING,
                           endBpm=250)

    m.svs.extend(f[0])
    m.bpms.extend(f[1])
Exemple #4
0
def f028(m: OsuMap):
    events = [
        SvOsuMeasureLineEvent(firstOffset=11017,
                              lastOffset=12937,
                              startX=0,
                              endX=1,
                              startY=0,
                              endY=1,
                              funcs=[lambda x: 0.5]),
        SvOsuMeasureLineEvent(firstOffset=12667,
                              lastOffset=12757,
                              startX=0,
                              endX=pi,
                              startY=0,
                              endY=1,
                              funcs=[lambda x: np.abs(np.sin(x)) / 4 + 0.5]),
        SvOsuMeasureLineEvent(firstOffset=12757,
                              lastOffset=12887,
                              startX=0,
                              endX=pi,
                              startY=0,
                              endY=1,
                              funcs=[lambda x: -np.abs(np.sin(x)) / 4 + 0.5]),
        *[
            SvOsuMeasureLineEvent(firstOffset=12757 + i,
                                  lastOffset=15337,
                                  startX=-5,
                                  endX=0.5,
                                  startY=0,
                                  endY=1,
                                  funcs=[lambda x: np.e**x + 0.5])
            for i in np.linspace(0, 15337 - 12757, 50)
        ], *[
            SvOsuMeasureLineEvent(firstOffset=12757 + i,
                                  lastOffset=15337,
                                  startX=-5,
                                  endX=0.5,
                                  startY=0,
                                  endY=1,
                                  funcs=[lambda x: -np.e**x + 0.5])
            for i in np.linspace(0, 15337 - 12757, 50)
        ]
    ]
    f = svOsuMeasureLineMD(events,
                           scalingFactor=SCALE,
                           firstOffset=11017,
                           lastOffset=15337,
                           paddingSize=PADDING,
                           endBpm=250)

    m.svs.extend(f[0])
    m.bpms.extend(f[1])
Exemple #5
0
def f053(m: OsuMap):
    events = [
        SvOsuMeasureLineEvent(firstOffset=20857,
                              lastOffset=21097,
                              startX=0,
                              endX=pi,
                              startY=0,
                              endY=2,
                              funcs=[lambda x: np.sin(x)])
    ]
    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=20857,
                                   lastOffset=21097,
                                   paddingSize=PADDING,
                                   endBpm=MAX_BPM)
    bpms.extend([
        OsuBpm(21337, 0.001),
        OsuBpm(21576, 54750),
        OsuBpm(21577, 250, metronome=999)
    ])
    svs.extend([
        OsuSv(17737, multiplier=0.6),
        OsuSv(18457, multiplier=0.6),
        OsuSv(21577, multiplier=0.6)
    ])

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #6
0
def f513(m: OsuMap):

    events = [
        # P: Position
        # P_: Individual line position
        # OD: Offset with delay
        *[
            SvOsuMeasureLineEvent(
                firstOffset=o,
                lastOffset=205182,
                startX=0,
                endX=1,
                startY=0,
                endY=1,
                funcs=[
                    lambda x, p_=p_: np.sin(x * pi / 2)**SIN_CURVE * p_
                    for p_ in np.linspace(p, p + THICKNESS, RAND_SIZE // 3)
                ]) for o, p in zip(offsets, positions)
        ],
        *[
            SvOsuMeasureLineEvent(
                firstOffset=205182,
                lastOffset=205662,
                startX=0,
                endX=1,
                startY=0,
                endY=1,
                funcs=[
                    lambda x, p_=p_:
                    (-np.sin(x * pi / 2)**
                     (SIN_CURVE * 3) + 1) * p_ + 0.5 * np.sin(x * pi / 2)**
                    (SIN_CURVE * 3
                     )  # This offsets the close to 0.5 with sin easing
                    for p_ in np.linspace(p, p + THICKNESS, RAND_SIZE // 3)
                ]) for o, p in zip(offsets, positions)
        ]
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=202782,
                                   lastOffset=205662,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #7
0
def EVENT(funcs, startX, endX, startY, endY, offsetsFrom, offsetsTo):
    events = [(SvOsuMeasureLineEvent(firstOffset=r0,
                                     lastOffset=r1,
                                     startX=startX,
                                     endX=endX,
                                     startY=startY,
                                     endY=endY,
                                     funcs=funcs),
               SvOsuMeasureLineEvent(firstOffset=o0,
                                     lastOffset=o1,
                                     startX=startX,
                                     endX=endX,
                                     startY=startY,
                                     endY=endY,
                                     funcs=funcs))
              for o0, o1 in zip(offsetsFrom, offsetsTo) for r0, r1 in zip(
                  np.arange(o0, o1, DELAY)[:-1],
                  np.arange(o0, o1, DELAY)[1:])]
    return [i for j in events for i in j]
Exemple #8
0
def f019(m: OsuMap):
    events = [
        *[
            SvOsuMeasureLineEvent(firstOffset=7657,
                                  lastOffset=8317,
                                  startX=1 + i,
                                  endX=0 + i,
                                  startY=-1,
                                  endY=0,
                                  funcs=[lambda x: -x])
            for i in np.linspace(0, 1, 100)
        ], *[
            SvOsuMeasureLineEvent(firstOffset=8317,
                                  lastOffset=8407,
                                  startX=1 + i,
                                  endX=0 + i,
                                  startY=-1,
                                  endY=0,
                                  funcs=[lambda x: -x])
            for i in np.linspace(0, 1, 100)
        ], *[
            SvOsuMeasureLineEvent(firstOffset=8407,
                                  lastOffset=8557,
                                  startX=1 + i,
                                  endX=0 + i,
                                  startY=-1,
                                  endY=0,
                                  funcs=[lambda x: -x])
            for i in np.linspace(0, 1, 100)
        ]
    ]

    f = svOsuMeasureLineMD(events,
                           scalingFactor=SCALE,
                           firstOffset=7657,
                           lastOffset=8557,
                           paddingSize=PADDING,
                           endBpm=250)

    m.svs.extend(f[0])
    m.bpms.extend(f[1])
Exemple #9
0
def STILL(from_, to_, CURR_POS, CURR_SCALE):
    return SvOsuMeasureLineEvent(firstOffset=from_,
                                 lastOffset=to_,
                                 startX=0,
                                 endX=0,
                                 startY=START_Y,
                                 endY=END_Y,
                                 funcs=[
                                     lambda x, i=i, pos=CURR_POS[0], scale=
                                     CURR_SCALE[0]: i * pos * scale
                                     for i in range(0, 3)
                                 ])
Exemple #10
0
def f442(m: OsuMap):

    # noinspection PyTypeChecker
    events = [[
        SvOsuMeasureLineEvent(
            firstOffset=174702,
            lastOffset=175362,
            startX=0,
            endX=1,
            startY=-1,
            endY=1,
            funcs=[lambda x, r=r: r * np.sin(x * pi / 2)**SIN_CURVE]),
        SvOsuMeasureLineEvent(
            firstOffset=175362,
            lastOffset=176142,
            startX=0,
            endX=1,
            startY=-1,
            endY=1,
            funcs=[lambda x, r=r: r * np.cos(x**POW_CURVE * pi)]),
        SvOsuMeasureLineEvent(
            firstOffset=176142,
            lastOffset=176382,
            startX=0,
            endX=1,
            startY=-1,
            endY=1,
            funcs=[lambda x, r=r: -r * (1 - np.sin(x * pi / 2)**SIN_CURVE)])
    ] for r in rand]

    svs, bpms = svOsuMeasureLineMD([i for j in events for i in j],
                                   scalingFactor=SCALE,
                                   firstOffset=174702,
                                   lastOffset=176382,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #11
0
    def testMD(self):
        # Grabbed from Cross Shutter.

        events = [
            SvOsuMeasureLineEvent(
                10000,
                20000, [lambda x, i=i, z=z: (z + (x + i / 5000)) % 1],
                startX=0,
                endX=1,
                startY=0,
                endY=1) for i in range(0, 10000, 250)
            for z in np.linspace(0, 0.03, 5)
        ]

        svs, bpms = svOsuMeasureLineMD(events,
                                       firstOffset=10000,
                                       lastOffset=20000,
                                       endBpm=200,
                                       scalingFactor=1.55,
                                       paddingSize=10)

        events = [
            SvOsuMeasureLineEvent(firstOffset=10000,
                                  lastOffset=20000,
                                  funcs=[lambda x, i=i: x + i],
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=1) for i in range(0, 10000, 250)
        ]

        svs, bpms = svOsuMeasureLineMD(events,
                                       firstOffset=10000,
                                       lastOffset=20000,
                                       endBpm=200,
                                       scalingFactor=1.55,
                                       paddingSize=10)
Exemple #12
0
def f319(m: OsuMap):

    events = [*[SvOsuMeasureLineEvent(
              firstOffset=125993, lastOffset=128093,
              startX=-10, endX=0,
              startY=-1, endY=1,
              funcs=[
                  lambda x, a=a, c=c:  a * (-1 / (x + 3 * c) + 1 / c + 1) * (-1 / (x + 11) + 1),
                  lambda x, a=a, c=c: -a * (-1 / (x + 3 * c) + 1 / c + 1) * (-1 / (x + 11) + 1)
              ]) for a, c in zip(amps, curves)],
              *[SvOsuMeasureLineEvent(
                  firstOffset=128093, lastOffset=128243,
                  startX=0, endX=2,
                  startY=-1, endY=1,
                  funcs=[
                      lambda x, a=a, c=c:  a / np.power(x + 1, 4),
                      lambda x, a=a, c=c: -a / np.power(x + 1, 4)
              ]) for a, c in zip(amps, curves)],
              SvOsuMeasureLineEvent(
              firstOffset=128243, lastOffset=128393,
              startX=0, endX=1,
              startY=0, endY=1,
              funcs=[
                  lambda x: 0.5
              ]),
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=125993,
                                   lastOffset=128393,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #13
0
def f598(m: OsuMap):
    events = [
        *[
            SvOsuMeasureLineEvent(
                firstOffset=o0,
                lastOffset=o1,
                startX=-1,
                endX=1,
                startY=-1,
                endY=1,
                funcs=[
                    lambda x, r=r, s=s: s * r * np.cos(x * pi / 2)**COS_CURVE,
                ]) for r, o0, o1 in zip(rands, offsets0[:-1], offsets1[:-1])
            for s in np.linspace(0.8, 1, RAND_SIZE // 4)
        ],
        SvOsuMeasureLineEvent(firstOffset=236382,
                              lastOffset=240222,
                              startX=-1,
                              endX=1,
                              startY=-1,
                              endY=1,
                              funcs=[
                                  lambda x, n=n: n * np.cos(x * pi / 2)**0.45
                                  for n in np.linspace(0, 0.8, 50)
                              ])
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=offsets0[0],
                                   lastOffset=offsets1[-1],
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #14
0
def SWAP(from_, to_, CURR_POS, CURR_SCALE):
    # this will swap it from 1 to -1, to 1, ...
    CURR_POS[0] *= -1
    CURR_SCALE[0] *= 1.035

    return SvOsuMeasureLineEvent(
        firstOffset=from_,
        lastOffset=to_,
        startX=0,
        endX=1,
        startY=START_Y,
        endY=END_Y,
        funcs=[
            lambda x, i=i, pos=CURR_POS[0], scale=CURR_SCALE[0]: i * pos *
            scale * np.sin(x * pi / 2) for i in range(0, 3)
        ])
Exemple #15
0
def NOTES(notes, notBefore, CURR_POS, CURR_SCALE):
    return [
        SvOsuMeasureLineEvent(
            firstOffset=max(notBefore, n.offset - 1000),
            lastOffset=n.offset,
            startX=1 if notBefore < n.offset - 1000 else 1 +
            (n.offset - 1000 - notBefore) / 1000,
            endX=0,
            startY=START_Y,
            endY=END_Y,
            funcs=[
                lambda x, n=n, pos=CURR_POS[0], scale=CURR_SCALE[0]:
                (x * scale + (n.column // 3 -
                              (1 if n.column < 1 else 0)) * scale) * pos *
                (-1 if n.column < 1 else 1)
            ]) for n in notes
    ]
Exemple #16
0
def f247(m: OsuMap):

    notes = sorted([n for n in m.notes.hits() if 97742 < n.offset <= 125993])

    BASE_SHAKE_AMP = 0.010
    INC_SHAKE_AMP = 0.0010
    SHAKE_WINDOW = 250
    NOTE_DURATION = 2000
    # noinspection PyTypeChecker
    events = [
        *[
            SvOsuMeasureLineEvent(
                firstOffset=n.offset - NOTE_DURATION - t,
                lastOffset=n.offset - t,
                startX=n.offset - NOTE_DURATION - t,
                endX=n.offset - t,
                startY=-1 + en / 500,
                endY=1 - en / 500,
                funcs=[
                    lambda x, n=n, t=t:
                    # This flips the board if it's < 2
                    (-1 if n.column < 2 else 1) *
                    (np.piecewise(x, [(i <= x) & (
                        x < i + SHAKE_WINDOW) for i in SHAKES], [
                            *[
                                lambda x, i=i, es=es:
                                (BASE_SHAKE_AMP + es * INC_SHAKE_AMP) * np.sin(
                                    (x - i) * pi / (SHAKE_WINDOW - es * 3))
                                for es, i in enumerate(SHAKES)
                            ], lambda x: 0
                        ]) + (x - (n.offset - t)) / NOTE_DURATION)
                ]) for en, n in enumerate(notes)
            for t in np.linspace(0, 24, NOTE_THICKNESS)
        ]
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=97742,
                                   lastOffset=125993,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #17
0
def f017(m: OsuMap):
    events = [SvOsuMeasureLineEvent(
              firstOffset=6697, lastOffset=7177,
              startX=5, endX=60,
              startY=-25, endY=25,
              funcs=[
                  *[lambda x, i=i: np.sin(5 * (x + i)) * (x + i) ** 2 / 100 for i in np.linspace(0, 20, 10)]
              ])]

    f = svOsuMeasureLineMD(events,
                           scalingFactor=SCALE,
                           firstOffset=6697,
                           lastOffset=7177,
                           paddingSize=PADDING,
                           endBpm=250)

    m.svs.extend(f[0])
    m.bpms.extend(f[1])
Exemple #18
0
def f002(m: OsuMap):
    events = [
        SvOsuMeasureLineEvent(firstOffset=937 + i,
                              lastOffset=6637 + i,
                              startX=2.5,
                              endX=35,
                              startY=-0.5,
                              endY=0.5,
                              funcs=[
                                  lambda x: 1 / np.log(x**2) - .13,
                                  lambda x: -1 / np.log(x**2) + .13
                              ]) for i in np.linspace(0, 6637 - 937, 10)
    ]

    f = svOsuMeasureLineMD(events,
                           scalingFactor=SCALE,
                           firstOffset=937,
                           lastOffset=6637,
                           paddingSize=PADDING,
                           endBpm=250)

    m.svs.extend(f[0])
    m.bpms.extend(f[1])
Exemple #19
0
def f430(m: OsuMap):

    # noinspection PyTypeChecker
    events = [
        *[
            SvOsuMeasureLineEvent(
                firstOffset=d,
                lastOffset=172302 - RETRACT_DURATION,
                startX=-10,
                endX=0,
                startY=-1,
                endY=1,
                funcs=[
                    lambda x, a=a, c=c, i=i: i + a *
                    (-1 / (x + 3 * c) + 1 / c + 1) *
                    (-1 / (x + 11) + 1), lambda x, a=a, c=c, i=i: i + -a *
                    (-1 / (x + 3 * c) + 1 / c + 1) * (-1 / (x + 11) + 1)
                ]) for a, c, d in zip(
                    amps, curves,
                    np.random.randint(169902, 172302 - 1250, len(BEATS)))
            for i in randAdd
        ], *[
            SvOsuMeasureLineEvent(
                firstOffset=172302 - RETRACT_DURATION,
                lastOffset=b - RETRACT_DURATION,
                startX=0,
                endX=0,
                startY=-1,
                endY=1,
                funcs=[
                    lambda x, a=a, c=c, i=i: i + a *
                    (-1 / (x + 3 * c) + 1 / c + 1) *
                    (-1 / (x + 11) + 1), lambda x, a=a, c=c, i=i: i + -a *
                    (-1 / (x + 3 * c) + 1 / c + 1) * (-1 / (x + 11) + 1)
                ]) for a, c, b in zip(amps, curves, BEATS) for i in randAdd
        ], *[
            SvOsuMeasureLineEvent(
                firstOffset=b - RETRACT_DURATION,
                lastOffset=b,
                startX=0,
                endX=-10,
                startY=-1,
                endY=1,
                funcs=[
                    lambda x, a=a, c=c, i=i: i + a *
                    (-1 / (x + 3 * c) + 1 / c + 1) *
                    (-1 / (x + 11) + 1), lambda x, a=a, c=c, i=i: i + -a *
                    (-1 / (x + 3 * c) + 1 / c + 1) * (-1 / (x + 11) + 1)
                ]) for a, c, b in zip(amps, curves, BEATS) for i in randAdd
        ]
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=169902,
                                   lastOffset=174802,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #20
0
def f510(m: OsuMap):

    events = [
        SvOsuMeasureLineEvent(
            firstOffset=201582, lastOffset=202342,
            startX=0, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r:
                (SHAKE_AMP * np.sin(SHAKES * x * pi) + r) / (x + 1)
                * np.cos(x * pi / 2) ** COS_CURVE
                for r in np.linspace(-1, 1, RAND_SIZE)
            ]
        ),
        # 03:22:342 (202342|2,202382|2,202422|2,202542|2) -

        SvOsuMeasureLineEvent(
            firstOffset=202342, lastOffset=202382,
            startX=0, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r:
                r * np.sin(x * pi / 2) ** 0.5
                for r in np.linspace(-1, 1, 4)
            ]
        ),
        SvOsuMeasureLineEvent(
            firstOffset=202382, lastOffset=202422,
            startX=0, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r:
                -x * r
                for r in np.linspace(0, 1, RAND_SIZE)
            ]
        ),
        SvOsuMeasureLineEvent(
            firstOffset=202422, lastOffset=202542,
            startX=0, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r:
                -x * r
                for r in np.linspace(0, 1, RAND_SIZE)
            ]
        ),
        SvOsuMeasureLineEvent(
            firstOffset=202542, lastOffset=202782,
            startX=0, endX=1,
            startY=-3, endY=3,
            funcs=[
                lambda x: 1 - x,
                lambda x: x - 1
            ]
        ),

    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=201582,
                                   lastOffset=202542,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #21
0
def f325(m: OsuMap):

    # Need to split in 2 because the 1/4 in the mids will be too hard to memorise
    notes = sorted([n for n in m.notes.hits() if 128393 < n.offset <= 138837])
    notes2 = sorted([n for n in m.notes.hits() if 138837 < n.offset <= 167558])

    BASE_SHAKE_AMP = 0.05
    INC_SHAKE_AMP = 0
    SHAKE_WINDOW = 250
    NOTE_DURATION = 2000
    # noinspection PyTypeChecker
    events = [
        *[SvOsuMeasureLineEvent(
            firstOffset=n.offset - NOTE_DURATION - t, lastOffset=n.offset - t,
            startX=n.offset - NOTE_DURATION - t, endX=n.offset - t,
            startY=-0.5 - en / 500 , endY=0.5 + en / 500,
            funcs=[
                lambda x, n=n, t=t:
                # This flips the board if it's < 2
                (-1 if n.column < 2 else 1) *
                (
                    np.piecewise(x,
                                 [(i <= x) & (x < i + SHAKE_WINDOW) for i in SHAKES],
                                 [*[lambda x, i=i, es=es:
                                    (BASE_SHAKE_AMP + es * INC_SHAKE_AMP)
                                    * np.sin((x - i) * pi / (SHAKE_WINDOW - es * 3))
                                    for es, i in enumerate(SHAKES)],
                                  lambda x: 0])
                    + (x - (n.offset - t)) / NOTE_DURATION
                )
            ]) for en, n in enumerate(notes) for t in np.linspace(0, 24, NOTE_THICKNESS)],
        *[SvOsuMeasureLineEvent(
            firstOffset=n.offset - NOTE_DURATION - t, lastOffset=n.offset - t,
            startX=n.offset - NOTE_DURATION - t, endX=n.offset - t,
            startY=-1 - en / 250 , endY=1 + en / 250,
            funcs=[
                lambda x, n=n, t=t:
                # This flips the board if it's < 2
                (-1 if n.column < 2 else 1) *
                (
                    np.piecewise(x,
                                 [(i <= x) & (x < i + SHAKE_WINDOW) for i in SHAKES],
                                 [*[lambda x, i=i, es=es:
                                    (BASE_SHAKE_AMP + es * INC_SHAKE_AMP)
                                    * np.sin((x - i) * pi / (SHAKE_WINDOW - es * 3))
                                    for es, i in enumerate(SHAKES)],
                                  lambda x: 0])
                    + (x - (n.offset - t)) / NOTE_DURATION
                )
            ]) for en, n in enumerate(notes2) if n.column == 0 or n.column == 3
               for t in np.linspace(0, 24, NOTE_THICKNESS)],
        *[SvOsuMeasureLineEvent(
            firstOffset=n.offset - NOTE_DURATION - t, lastOffset=n.offset - t,
            startX=n.offset - NOTE_DURATION - t, endX=n.offset - t,
            startY=-1 - en / 250 , endY=1 + en / 250,
            funcs=[
                lambda x, n=n, t=t:
                # This flips the board if it's < 2
                (-1 if n.column < 2 else 1) *
                (
                    np.piecewise(x,
                                 [(i <= x) & (x < i + SHAKE_WINDOW) for i in SHAKES],
                                 [*[lambda x, i=i, es=es:
                                    (BASE_SHAKE_AMP + es * INC_SHAKE_AMP)
                                    * np.sin((x - i) * pi / (SHAKE_WINDOW - es * 3))
                                    for es, i in enumerate(SHAKES)],
                                  lambda x: 0])
                    - (x - (n.offset + t) + NOTE_DURATION) / NOTE_DURATION
                )
            ]) for en, n in enumerate(notes2) if n.column == 1 or n.column == 2
               for t in np.linspace(0, 24, NOTE_THICKNESS)],
        SvOsuMeasureLineEvent(
            firstOffset=128393, lastOffset=167558,
            startX=0, endX=1,
            startY=0, endY=1,
            funcs=[
                lambda x: 0.5,
            ]),
        *[SvOsuMeasureLineEvent(
            firstOffset=j, lastOffset=169902 - (j - 167558) % 500,
            startX=0.01, endX=20,
            startY=-3, endY=3,
            funcs=[
                *[lambda x, i=i: i / 100 / (x ** 1.7) for i in np.random.randint(-100, 100, RAND_SIZE // 10)],
            ]) for j in np.random.randint(167558, 169902 - 100, RAND_SIZE * 2)],
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=128393,
                                   lastOffset=169902,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #22
0
def f083(m: OsuMap):
    notes = [h for h in m.notes.hits() if 33000 < h.offset < 55200]
    notes2 = [h for h in m.notes.hits() if 55900 < h.offset < 63900]
    sweeps = OsuHitList.readEditorString(
        "00:36:457 (36457|3,40297|3,44137|3,47977|3,51817|3,59497|3)").offsets(
        )

    events = [
        SvOsuMeasureLineEvent(firstOffset=32857,
                              lastOffset=55177,
                              startX=0,
                              endX=1,
                              startY=0,
                              endY=1,
                              funcs=[
                                  lambda x: 0.25,
                                  lambda x: 0.50,
                                  lambda x: 0.75,
                                  lambda x: 1,
                              ]),
        *[
            SvOsuMeasureLineEvent(
                firstOffset=n.offset - 500,
                lastOffset=n.offset,
                startX=1,
                endX=0,
                startY=0,
                endY=4,
                funcs=[
                    lambda x, n=n, t=t: x - t + n.column
                    for t in np.linspace(0, 0.05, NOTE_THICKNESS)
                ]) for n in notes
        ],
        *[
            SvOsuMeasureLineEvent(
                firstOffset=55177,
                lastOffset=55777,
                startX=0,
                endX=1,
                startY=0,
                endY=1,
                funcs=[
                    lambda x, i=i: 0 + x + np.random.rand() % 0.2,
                    lambda x, i=i: 0.25 + x + np.random.rand() % 0.2,
                    lambda x, i=i: 0.50 + x + np.random.rand() % 0.2,
                    lambda x, i=i: 0.75 + x + np.random.rand() % 0.2,
                    lambda x, i=i: 0 - x + np.random.rand() % 0.2,
                    lambda x, i=i: 0.25 - x + np.random.rand() % 0.2,
                    lambda x, i=i: 0.50 - x + np.random.rand() % 0.2,
                    lambda x, i=i: 0.75 - x + np.random.rand() % 0.2,
                ]) for i in range(0, RAND_SIZE // 3)
        ],
        SvOsuMeasureLineEvent(firstOffset=55777,
                              lastOffset=63817,
                              startX=0,
                              endX=8,
                              startY=0,
                              endY=1,
                              funcs=[
                                  lambda x: 0.25,
                                  lambda x: 0.50,
                                  lambda x: 0.75,
                                  lambda x: 1,
                              ]),
        *[
            SvOsuMeasureLineEvent(
                firstOffset=n.offset - 500,
                lastOffset=n.offset,
                startX=0,
                endX=1,
                startY=0,
                endY=4,
                funcs=[
                    lambda x, n=n, t=t: x - t + n.column
                    for t in np.linspace(0, 0.05, NOTE_THICKNESS)
                ]) for n in notes2
        ],
        # These are the sweeps
        *[
            SvOsuMeasureLineEvent(
                firstOffset=s - 240,
                lastOffset=s + 240,
                startX=-1,
                endX=1,
                startY=0,
                endY=1,
                funcs=[
                    lambda x, t=t:
                    (1 / np.random.rand()**2 * np.abs(np.sin((x - t) * pi)) +
                     (x - t)**2) % 1
                    for t in np.linspace(0, 0.25, RAND_SIZE // 2)
                ]) for s in sweeps
        ]
    ]
    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=32857,
                                   lastOffset=63817,
                                   paddingSize=PADDING,
                                   endBpm=250,
                                   metronome=999)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #23
0
def f486(m: OsuMap):
    notes = sorted([
        *[h for h in m.notes.hits() if 191982 <= h.offset <= 198462],
        *[h for h in m.notes.holds() if 191982 <= h.offset <= 198462]
    ],
                   key=lambda x: x.offset)

    # These are the offsets that trigger a move
    offsets = [n.offset for n in notes] + [201582] * WHEEL_SLOTS * 2

    # These are the wheel columns
    cols = [n.column + 1 for n in notes] + [0] * WHEEL_SLOTS * 2

    events = [
        # We'll set up the wheel here
        # Depending on the column, we need to adjust it accordingly.

        # The method is to look at WHEEL items at once, then show a slowed image or move

        # MOVE
        *[
            SvOsuMeasureLineEvent(
                firstOffset=o,
                lastOffset=offsets[i + 1],
                startX=0,
                endX=1,
                startY=0.2,
                endY=WHEEL_SLOTS - 1,
                funcs=[
                    *[
                        lambda x, i=i, c=c, cp=cp, cv=cv, t=t: c /
                        (cv + 1)  # The relative spot to the cv
                        + cp + 1  # Correct placement of wheel slot
                        + (np.cos(x * pi / 2)**COS_POWER - 1)  # Cosine easing
                        - t  # Add thickness
                        + 1 / (cv + 1)  # Make all in center
                        # For each i, we get the col value
                        for cp, cv in enumerate(cols[i + 1:i + WHEEL_SLOTS])
                        # For each col value, we loop through it to make each column line
                        for c in range(cv)
                        # For each col line, we make it thicker by repeating
                        for t in np.linspace(-0.025, 0.025,
                                             int(NOTE_THICKNESS * 1.5))
                    ],

                    # Add note hit positions
                    *[
                        lambda x, w=w: 1 +
                        (np.cos(x * pi / 2)**COS_POWER - 1) + w
                        for w in range(WHEEL_SLOTS)
                    ]
                ]) for i, o in enumerate(offsets[:-WHEEL_SLOTS])
        ]
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=191982,
                                   lastOffset=201582,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #24
0
def f233(m: OsuMap):

    events = [
        SvOsuMeasureLineEvent(
            firstOffset=92102,
            lastOffset=92822,
            startX=-2,
            endX=2,
            startY=-6,
            endY=6,
            funcs=[
                lambda x, i=i: np.abs(x) + np.sin(5 * x) * x**2 * i
                for i in range(-5, 6)
            ]),
        SvOsuMeasureLineEvent(
            firstOffset=92822,
            lastOffset=92822 + 10,
            startX=0,
            endX=1,
            startY=0.2,
            endY=0.8,
            funcs=[
                *[lambda x, i=i: i for i in np.linspace(0, 1, RAND_SIZE * 2)],
            ]),
        SvOsuMeasureLineEvent(firstOffset=92822 + 10,
                              lastOffset=92882,
                              startX=0,
                              endX=0.2,
                              startY=0.2,
                              endY=0.8,
                              funcs=[]),
        SvOsuMeasureLineEvent(
            firstOffset=92882,
            lastOffset=92882 + 10,
            startX=0.01,
            endX=0.05,
            startY=0.2,
            endY=0.8,
            funcs=[
                *[lambda x, i=i: i for i in np.linspace(0, 1, RAND_SIZE // 3)],
            ]),
        SvOsuMeasureLineEvent(firstOffset=92882 + 10,
                              lastOffset=92942,
                              startX=0,
                              endX=0.2,
                              startY=0.2,
                              endY=0.8,
                              funcs=[]),
        SvOsuMeasureLineEvent(
            firstOffset=92942,
            lastOffset=93062,
            startX=0,
            endX=0.05,
            startY=0.2,
            endY=0.8,
            funcs=[
                *[
                    lambda x, i=i: i + x
                    for i in np.linspace(0, 1, RAND_SIZE // 2)
                ],
            ]),
        SvOsuMeasureLineEvent(
            firstOffset=93062,
            lastOffset=93302,
            startX=0,
            endX=0.05,
            startY=0.2,
            endY=0.8,
            funcs=[
                *[lambda x, i=i: i - x for i in np.linspace(0, 1, RAND_SIZE)],
            ]),
        SvOsuMeasureLineEvent(firstOffset=93302,
                              lastOffset=93482,
                              startX=0,
                              endX=0.05,
                              startY=0,
                              endY=1,
                              funcs=[]),
        SvOsuMeasureLineEvent(
            firstOffset=93482,
            lastOffset=93902,
            startX=0,
            endX=0.2,
            startY=0.2,
            endY=0.8,
            funcs=[
                *[
                    lambda x, i=i: i - x
                    for i in np.linspace(0, 1, RAND_SIZE // 3)
                ],
                *[
                    lambda x, i=i: i + x
                    for i in np.linspace(0, 1, RAND_SIZE // 2)
                ],
            ]),
        *[
            SvOsuMeasureLineEvent(
                firstOffset=j,
                lastOffset=97442 - (j - 93902) % 500,
                startX=0.01,
                endX=20,
                startY=-3,
                endY=3,
                funcs=[
                    *[
                        lambda x, i=i: i / 100 / (x**1.7)
                        for i in np.random.randint(-100, 100, RAND_SIZE // 10)
                    ],
                ])
            for j in np.random.randint(93902, 97442 - 100, RAND_SIZE * 2)
        ],
        SvOsuMeasureLineEvent(firstOffset=97502,
                              lastOffset=97742,
                              startX=0,
                              endX=1,
                              startY=0,
                              endY=1,
                              funcs=[lambda x: 0.5]),
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=92102,
                                   lastOffset=97742,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #25
0
def f162(m: OsuMap):
    hits0 = [h for h in m.notes.hits() if 63817 <= h.offset < 70674]
    hits1 = [h for h in m.notes.hits() if 70674 <= h.offset < 77531]
    holds2 = [h for h in m.notes.holds() if 77531 <= h.offset < 84388]
    holds3 = [h for h in m.notes.holds() if 84388 <= h.offset < 90388]
    hits4 = [h for h in m.notes.hits() if 90388 <= h.offset <= 91245]

    events = [SvOsuMeasureLineEvent(
              firstOffset=63817, lastOffset=70674,
              startX=0, endX=1,
              startY=0, endY=1,
              funcs=[
                  lambda x: 0    + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.25 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.50 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.75 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 1    + SWAY_MAG * np.sin(x * pi * 4),
              ]),
             *[SvOsuMeasureLineEvent(
              firstOffset=h.offset - WAIT, lastOffset=h.offset,
              startX=1, endX=0,
              startY=0, endY=1,
              funcs=[
                  lambda x, h=h, i=i:
                        x * 0.25 + i + h.column * 0.25
                        + SWAY_MAG * np.sin((h.offset - 63817) / (70674 - 63817) * pi * 4)
                        for i in np.linspace(0, 0.02, int(1 + e / 2))
              ]) for e, h in enumerate(hits0)],


              SvOsuMeasureLineEvent(
              firstOffset=70674, lastOffset=77531,
              startX=0, endX=1,
              startY=0, endY=1,
              funcs=[
                  lambda x: 0    + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.25 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.50 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.75 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 1    + SWAY_MAG * np.sin(x * pi * 4),
              ]),
             *[SvOsuMeasureLineEvent(
              firstOffset=h.offset - WAIT, lastOffset=h.offset,
              startX=0, endX=1,
              startY=0, endY=1,
              funcs=[
                  lambda x, h=h, i=i:
                        x * 0.25 - i + h.column * 0.25
                        + SWAY_MAG * np.sin((h.offset - 70674) / (77531 - 70674) * pi * 4)
                        for i in np.linspace(0, 0.02, max(1, int(10 - e / 2)))
              ]) for e, h in enumerate(hits1)],


              SvOsuMeasureLineEvent(
              firstOffset=77531, lastOffset=84388,
              startX=0, endX=1,
              startY=0, endY=1,
              funcs=[
                  lambda x: 0    + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.25 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.50 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 0.75 + SWAY_MAG * np.sin(x * pi * 4),
                  lambda x: 1    + SWAY_MAG * np.sin(x * pi * 4)
              ]),
             *[SvOsuMeasureLineEvent(
              firstOffset=h.offset - WAIT + i, lastOffset=h.offset + i,
              startX=1, endX=0,
              startY=0, endY=1,
              funcs=[
                  lambda x, h=h:
                        x * 0.25 + h.column * 0.25
                        + SWAY_MAG * np.sin((h.offset - 77531) / (84388 - 77531) * pi * 4)
              ]) for h in holds2 for i in np.linspace(0, h.length, NOTE_THICKNESS)],


              SvOsuMeasureLineEvent(
              firstOffset=84388, lastOffset=90388,
              startX=0, endX=1,
              startY=0, endY=1,
              funcs=[
                  lambda x: 0    + SWAY_MAG * np.sin(x * pi * 3.5),
                  lambda x: 0.25 + SWAY_MAG * np.sin(x * pi * 3.5),
                  lambda x: 0.50 + SWAY_MAG * np.sin(x * pi * 3.5),
                  lambda x: 0.75 + SWAY_MAG * np.sin(x * pi * 3.5),
                  lambda x: 1    + SWAY_MAG * np.sin(x * pi * 3.5),
              ]),
             *[SvOsuMeasureLineEvent(
              firstOffset=h.offset - WAIT + i, lastOffset=h.offset + i,
              startX=0, endX=1,
              startY=0, endY=1,
              funcs=[
                  lambda x, h=h:
                        x * 0.25 + h.column * 0.25
                        + SWAY_MAG * np.sin((h.offset - 84388) / (91245 - 84388) * pi * 4)
              ]) for h in holds3 for i in np.linspace(0, h.length, NOTE_THICKNESS)],

            SvOsuMeasureLineEvent(
                firstOffset=90388, lastOffset=91245,
                startX=0, endX=1,
                startY=0, endY=1,
                funcs=[
                    lambda x: 0    ,
                    lambda x: 0.25 ,
                    lambda x: 0.50 ,
                    lambda x: 0.75 ,
                    lambda x: 1 ,
                ]),
            *[SvOsuMeasureLineEvent(
                firstOffset=h.offset - WAIT / 2, lastOffset=h.offset,
                startX=1, endX=0,
                startY=0, endY=1,
                funcs=[
                    lambda x, h=h, i=i:
                    x * 0.25 - i + h.column * 0.25
                    for i in np.linspace(0, 0.02, NOTE_THICKNESS)
                ]) for h in hits4],

    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=63817,
                                   lastOffset=91245,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #26
0
def f072(m: OsuMap):
    events = [
        SvOsuMeasureLineEvent(firstOffset=28537,
                              lastOffset=28777,
                              startX=0.001,
                              endX=4,
                              startY=0,
                              endY=4,
                              funcs=[lambda x: np.sqrt(x)]),
        *[
            SvOsuMeasureLineEvent(firstOffset=28777,
                                  lastOffset=29017,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=1,
                                  funcs=[lambda x, i=i: i + x / 100])
            for i in np.linspace(0, 1, 50)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=29017,
                                  lastOffset=29257,
                                  startX=0,
                                  endX=1,
                                  startY=-5,
                                  endY=5,
                                  funcs=[lambda x, i=i: 1 / (x + 1)])
            for i in np.linspace(0, 1, 15)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=29017,
                                  lastOffset=29257,
                                  startX=0,
                                  endX=1,
                                  startY=-5,
                                  endY=5,
                                  funcs=[lambda x, i=i: -1 / (x + 1)])
            for i in np.linspace(0, 1, 15)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=29257 + i * SHUTTER_WAIT,
                                  lastOffset=31177 -
                                  (1 - i) * SHUTTER_WAIT * 8,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=4,
                                  funcs=[lambda x, i=i: 1 - i])
            for i in np.linspace(0, 1, 15)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=29497 + i * SHUTTER_WAIT,
                                  lastOffset=31177 -
                                  (1 - i) * SHUTTER_WAIT * 6,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=4,
                                  funcs=[lambda x, i=i: 1 - i + 1])
            for i in np.linspace(0, 1, 15)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=29737 + i * SHUTTER_WAIT,
                                  lastOffset=31177 -
                                  (1 - i) * SHUTTER_WAIT * 4,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=4,
                                  funcs=[lambda x, i=i: 1 - i + 2])
            for i in np.linspace(0, 1, 15)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=29977 + i * SHUTTER_WAIT,
                                  lastOffset=31177 -
                                  (1 - i) * SHUTTER_WAIT * 2,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=4,
                                  funcs=[lambda x, i=i: 1 - i + 3])
            for i in np.linspace(0, 1, 15)
        ],

        # 00:31:177 (31177|0,31417|1,31657|2,31897|3,32137|3) -
        *[
            SvOsuMeasureLineEvent(firstOffset=31177 + i * SHUTTER_WAIT,
                                  lastOffset=32857 -
                                  (1 - i) * SHUTTER_WAIT * 4,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=4,
                                  funcs=[lambda x, i=i: 1 - i])
            for i in np.linspace(0, 1, 15)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=31417 + i * SHUTTER_WAIT * 2,
                                  lastOffset=32857 -
                                  (1 - i) * SHUTTER_WAIT * 3,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=4,
                                  funcs=[lambda x, i=i: 1 - i + 1])
            for i in np.linspace(0, 1, 20)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=31657 + i * SHUTTER_WAIT * 3,
                                  lastOffset=32857 -
                                  (1 - i) * SHUTTER_WAIT * 2,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=4,
                                  funcs=[lambda x, i=i: 1 - i + 2])
            for i in np.linspace(0, 1, 35)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=31897 + i * (32857 - 31897),
                                  lastOffset=32857 -
                                  (1 - i) * SHUTTER_WAIT * 2,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=4,
                                  funcs=[lambda x, i=i: 1 - i + 3])
            for i in np.linspace(0, 1, 50)
        ]
    ]
    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=28537,
                                   lastOffset=33097,
                                   paddingSize=PADDING,
                                   endBpm=250)

    m.svs.extend(svs)
    m.bpms.extend(bpms)
Exemple #27
0
def f039(m: OsuMap):
    events = [
        *[
            SvOsuMeasureLineEvent(firstOffset=15337 + i * (17737 - 15337),
                                  lastOffset=17737,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=1,
                                  funcs=[lambda x, i=i: i * 0.20])
            for i in np.linspace(0, 1, 30)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=15817 + i * (17737 - 15817),
                                  lastOffset=17737,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=1,
                                  funcs=[lambda x, i=i: i * 0.20 + 0.20])
            for i in np.linspace(0, 1, 25)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=16297 + i * (17737 - 16297),
                                  lastOffset=17737,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=1,
                                  funcs=[lambda x, i=i: i * 0.20 + 0.40])
            for i in np.linspace(0, 1, 20)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=16777 + i * (17737 - 16777),
                                  lastOffset=17737,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=1,
                                  funcs=[lambda x, i=i: i * 0.20 + 0.60])
            for i in np.linspace(0, 1, 15)
        ],
        *[
            SvOsuMeasureLineEvent(firstOffset=17257 + i * (17737 - 17257),
                                  lastOffset=17737,
                                  startX=0,
                                  endX=1,
                                  startY=0,
                                  endY=1,
                                  funcs=[lambda x, i=i: i * 0.20 + 0.80])
            for i in np.linspace(0, 1, 10)
        ],
    ]
    f = svOsuMeasureLineMD(events,
                           scalingFactor=SCALE,
                           firstOffset=15337,
                           lastOffset=17737,
                           paddingSize=PADDING,
                           endBpm=250,
                           metronome=999)

    m.svs.extend(f[0])
    m.bpms.extend(f[1])
Exemple #28
0
def f608(m: OsuMap):
    events = [

        # [0]------------------

        *[SvOsuMeasureLineEvent(
            firstOffset=offsets0[0], lastOffset=o,
            startX=-1, endX=0,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r, t=t:
                    (
                        r * (np.cos(x * pi / 2) ** COS_CURVE *
                             np.sin(x * pi / 2)) +
                        r * (x + 1)
                    ) *
                    (
                        - np.sin(x * pi) + DAMP
                    ) + t
                for t in np.linspace(-0.01, 0.01, int(NOTE_THICKNESS * 2.5))
            ]
        ) for r, o in zip(rands[0], offsets0[1:-1])],
        *[SvOsuMeasureLineEvent(
            firstOffset=o, lastOffset=o + 1000,
            startX=0, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r, exp=exp: r * DAMP + exp * np.sin(x * pi) ** SIN_CURVE
                for exp in np.linspace(-EXPLOSION_RANGE, EXPLOSION_RANGE, EXPLOSION_LINES)
            ]
        ) for r, o in zip(rands[0], offsets0[1:-1])],

        # [1]------------------

        SvOsuMeasureLineEvent(
            firstOffset=offsets0[-3], lastOffset=offsets0[-1],
            startX=-1, endX=1,
            startY=1, endY=-1,
            funcs=[
                lambda x, n=n:
                n * np.cos(x * pi / 2) ** 0.45
                for n in np.linspace(0, 0.8, 50)
            ]
        ),

        *[SvOsuMeasureLineEvent(
            firstOffset=offsets1[0], lastOffset=o,
            startX=-1, endX=0,
            startY=1, endY=-1,
            funcs=[
                lambda x, r=r, t=t:
                    (
                        r * (np.cos(x * pi / 2) ** COS_CURVE *
                             np.sin(x * pi / 2)) +
                        r * (x + 1)
                    ) *
                    (
                        - np.sin(x * pi) + DAMP
                    ) + t
                for t in np.linspace(-0.01, 0.01, int(NOTE_THICKNESS * 2.5))
            ]
        ) for r, o in zip(rands[1], offsets1[1:-1])],
        *[SvOsuMeasureLineEvent(
            firstOffset=o, lastOffset=o + 1000,
            startX=0, endX=1,
            startY=1, endY=-1,
            funcs=[
                lambda x, r=r, exp=exp: r * DAMP + exp * np.sin(x * pi) ** SIN_CURVE
                for exp in np.linspace(-EXPLOSION_RANGE, EXPLOSION_RANGE, EXPLOSION_LINES)
            ]
        ) for r, o in zip(rands[1], offsets1[1:-1])],

        # [2]------------------

        SvOsuMeasureLineEvent(
            firstOffset=offsets1[-3], lastOffset=offsets1[-1],
            startX=-1, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, n=n:
                n * np.cos(x * pi / 2) ** 0.45
                for n in np.linspace(0, 0.8, 50)
            ]
        ),

        *[SvOsuMeasureLineEvent(
            firstOffset=offsets2[0], lastOffset=o,
            startX=-1, endX=0,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r, t=t:
                    (
                        r * (np.cos(x * pi / 2) ** COS_CURVE *
                             np.sin(x * pi / 2)) +
                        r * (x + 1)
                    ) *
                    (
                        - np.sin(x * pi) + DAMP
                    ) + t
                for t in np.linspace(-0.01, 0.01, int(NOTE_THICKNESS * 2.5))
            ]
        ) for r, o in zip(rands[2], offsets2[1:-1])],
        *[SvOsuMeasureLineEvent(
            firstOffset=o, lastOffset=o + 1000,
            startX=0, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r, exp=exp: r * DAMP + exp * np.sin(x * pi) ** SIN_CURVE
                for exp in np.linspace(-EXPLOSION_RANGE, EXPLOSION_RANGE, EXPLOSION_LINES)
            ]
        ) for r, o in zip(rands[2], offsets2[1:-1])],

        # [3]------------------

        SvOsuMeasureLineEvent(
            firstOffset=offsets2[-3], lastOffset=offsets2[-1],
            startX=-1, endX=1,
            startY=1, endY=-1,
            funcs=[
                lambda x, n=n:
                n * np.cos(x * pi / 2) ** 0.45
                for n in np.linspace(0, 0.8, 50)
            ]
        ),

        *[SvOsuMeasureLineEvent(
            firstOffset=offsets3[0], lastOffset=o,
            startX=-1, endX=0,
            startY=1, endY=-1,
            funcs=[
                lambda x, r=r, t=t:
                    (
                        r * (np.cos(x * pi / 2) ** COS_CURVE *
                             np.sin(x * pi / 2)) +
                        r * (x + 1)
                    ) *
                    (
                        - np.sin(x * pi) + DAMP
                    ) + t
                for t in np.linspace(-0.01, 0.01, int(NOTE_THICKNESS * 2.5))
            ]
        ) for r, o in zip(rands[3], offsets3[1:-1])],
        *[SvOsuMeasureLineEvent(
            firstOffset=o, lastOffset=o + 1000,
            startX=0, endX=1,
            startY=1, endY=-1,
            funcs=[
                lambda x, r=r, exp=exp: r * DAMP + exp * np.sin(x * pi) ** SIN_CURVE
                for exp in np.linspace(-EXPLOSION_RANGE, EXPLOSION_RANGE, EXPLOSION_LINES)
            ]
        ) for r, o in zip(rands[3], offsets3[1:-1])],

        # [4]------------------

        SvOsuMeasureLineEvent(
            firstOffset=offsets3[-3], lastOffset=offsets3[-1],
            startX=-1, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, n=n:
                n * np.cos(x * pi / 2) ** 0.45
                for n in np.linspace(0, 0.8, 50)
            ]
        ),

        *[SvOsuMeasureLineEvent(
            firstOffset=offsets4[0], lastOffset=o,
            startX=-1, endX=0,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r, t=t:
                    (
                        r * (np.cos(x * pi / 2) ** COS_CURVE *
                             np.sin(x * pi / 2)) +
                        r * (x + 1)
                    ) *
                    (
                        - np.sin(x * pi) + DAMP
                    ) + t
                for t in np.linspace(-0.01, 0.01, int(NOTE_THICKNESS * 2.5))
            ]
        ) for r, o in zip(rands[4], offsets4[1:-1])],
        *[SvOsuMeasureLineEvent(
            firstOffset=o, lastOffset=o + 1000,
            startX=0, endX=1,
            startY=-1, endY=1,
            funcs=[
                lambda x, r=r, exp=exp: r * DAMP + exp * np.sin(x * pi) ** SIN_CURVE
                for exp in np.linspace(-EXPLOSION_RANGE, EXPLOSION_RANGE, EXPLOSION_LINES)
            ]
        ) for r, o in zip(rands[4], offsets4[1:-1])],

        # [5]------------------

        SvOsuMeasureLineEvent(
            firstOffset=offsets4[-3], lastOffset=offsets4[-1],
            startX=-1, endX=1,
            startY=1, endY=-1,
            funcs=[
                lambda x, n=n:
                n * np.cos(x * pi / 2) ** 0.45
                for n in np.linspace(0, 0.8, 50)
            ]
        ),

        *[SvOsuMeasureLineEvent(
            firstOffset=offsets5[0], lastOffset=o,
            startX=-1, endX=0,
            startY=1, endY=-1,
            funcs=[
                lambda x, r=r, t=t:
                    (
                        r * (np.cos(x * pi / 2) ** COS_CURVE *
                             np.sin(x * pi / 2)) +
                        r * (x + 1)
                    ) *
                    (
                        - np.sin(x * pi) + DAMP
                    ) + t
                for t in np.linspace(-0.01, 0.01, int(NOTE_THICKNESS * 2.5))
            ]
        ) for r, o in zip(rands[5], offsets5[1:-1])],
        *[SvOsuMeasureLineEvent(
            firstOffset=o, lastOffset=o + 1000,
            startX=0, endX=1,
            startY=1, endY=-1,
            funcs=[
                lambda x, r=r, exp=exp: r * DAMP + exp * np.sin(x * pi) ** SIN_CURVE
                for exp in np.linspace(-EXPLOSION_RANGE, EXPLOSION_RANGE, EXPLOSION_LINES)
            ]
        ) for r, o in zip(rands[5], offsets5[1:-1])],

        # [PIANO] ----------

        *[SvOsuMeasureLineEvent(
            firstOffset=o, lastOffset=o + 500,
            startX=0, endX=1,
            startY=-1, endY=1,
            funcs=[
                *[lambda x, r=r, exp=exp: + r + exp * np.sin(x * pi) ** SIN_CURVE
                for exp in np.linspace(-EXPLOSION_RANGE / 7, EXPLOSION_RANGE / 7, EXPLOSION_LINES // 2)],
                *[lambda x, r=r, exp=exp: - r + exp * np.sin(x * pi) ** SIN_CURVE
                for exp in np.linspace(-EXPLOSION_RANGE / 7, EXPLOSION_RANGE / 7, EXPLOSION_LINES // 2)]
            ]
        ) for r, o in zip(pianoRands, piano)]
    ]

    svs, bpms = svOsuMeasureLineMD(events,
                                   scalingFactor=SCALE,
                                   firstOffset=offsets0[0],
                                   lastOffset=offsets5[-1],
                                   paddingSize=PADDING,
                                   endBpm=250,
                                   metronome=999)

    m.svs.extend(svs)
    m.bpms.extend(bpms)

    m.bpms.append(OsuBpm(offset=314004, bpm=250, metronome=1))