예제 #1
0
def test_als8_noauto():
    fname = f'{TESTS_DIR_ALS}/live8/live8-patch-markers-noauto.als'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f)

    proj.parse()

    print(proj.markers)
    print(proj.tempo_automation_events)

    marks = [
        Marker(time=125.91815320041972, text='b'),
        Marker(time=200.20986358866736, text='c')
    ]
    auto = [
        TempoAutomationFloatEvent(id=None,
                                  time=-63072000.0,
                                  real_time=None,
                                  value=95.3,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None)
    ]

    assert proj.markers == marks
    assert proj.tempo_automation_events == auto
예제 #2
0
def test_als9_noauto():
    fname = f'{TESTS_DIR_ALS}/live9/live9-patch-markers-noauto.als'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f)

    proj.parse()

    print(proj.markers)
    print(proj.tempo_automation_events)

    marks = [
        Marker(time=14.222222222222221, text='Live9Marker'),
        Marker(time=28.444444444444443, text='Live9Marker2'),
        Marker(time=56.888888888888886, text='Live9Marker3')
    ]
    auto = [
        TempoAutomationFloatEvent(id=None,
                                  time=-63072000.0,
                                  real_time=None,
                                  value=135.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None)
    ]

    assert proj.markers == marks
    assert proj.tempo_automation_events == auto
예제 #3
0
def test_flp_markers():
    """
    Test that we parse and correctly id markers of various action types.
    Test that we only look at "None" markers when computing the marker times.
    """
    fname = f'{TESTS_DIR}/fl/fl-markers.flp'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=False)
    proj.parse()

    print(proj.raw_markers)
    raw = [
        FlStudioRawMarker(time=1220, text='Auto', action=0),
        FlStudioRawMarker(time=1356, text='start', action=5),
        FlStudioRawMarker(time=1932, text='time sig', action=8),
        FlStudioRawMarker(time=2624, text='loop', action=4),
        FlStudioRawMarker(time=3168, text='marker loop', action=1),
        FlStudioRawMarker(time=3988, text='marker skip', action=2),
        FlStudioRawMarker(time=4896, text='marker pause', action=3),
        FlStudioRawMarker(time=5640, text='punch in', action=9),
        FlStudioRawMarker(time=6516, text='punch out', action=10)
    ]
    assert proj.raw_markers == raw

    print(proj.markers)
    m = [Marker(time=5.865384615384616, text='Auto')]
    assert proj.markers == m
예제 #4
0
def test_als8_auto():
    fname = f'{TESTS_DIR_ALS}/live8/live8-patch-markers-auto.als'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f)

    proj.parse()

    print(proj.markers)
    print(proj.tempo_automation_events)

    marks = [
        Marker(time=81.09683000726724, text='b'),
        Marker(time=125.34683000726724, text='c')
    ]
    auto = [
        TempoAutomationFloatEvent(id=None,
                                  time=-63072000.0,
                                  real_time=0.0,
                                  value=95.3,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id=None,
                                  time=0.0,
                                  real_time=0.0,
                                  value=95.3,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id=None,
                                  time=4.0,
                                  real_time=2.103149251721395,
                                  value=138.3,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=95.3),
        TempoAutomationFloatEvent(id=None,
                                  time=200.0,
                                  real_time=81.09683000726724,
                                  value=160.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=138.3)
    ]

    assert proj.markers == marks
    assert proj.tempo_automation_events == auto
예제 #5
0
def test_als9_auto():
    fname = f'{TESTS_DIR_ALS}/live9/live9-patch-2-0point.als'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f)

    proj.parse()

    print(proj.markers)
    print(proj.tempo_automation_events)

    marks = [
        Marker(time=11.169835008759637, text='Live9Marker'),
        Marker(time=22.141263580188213, text='Live9Marker2'),
        Marker(time=44.08412072304535, text='Live9Marker3')
    ]
    auto = [
        TempoAutomationFloatEvent(id=None,
                                  time=-63072000.0,
                                  real_time=0.0,
                                  value=135.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id=None,
                                  time=0.0,
                                  real_time=0.0,
                                  value=135.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id=None,
                                  time=4.0,
                                  real_time=1.5698350087596382,
                                  value=175.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=135.0)
    ]

    assert proj.markers == marks
    assert proj.tempo_automation_events == auto
예제 #6
0
def test_als_auto_pathological3_daw():
    """
    25505 automation points,no slopes, just horizontal and vertical lines
    stress testing alignment
    """

    fname = f'{TESTS_DIR_ALS}/automation-pathological-end3.als'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=False)

    proj.parse()
    assert proj.markers == [
        Marker(time=447.53153265863915, text='A'),
        Marker(time=466.60806196643625, text='X'),
        Marker(time=486.1465317732963, text='B'),
        Marker(time=495.56805602397407, text='D'),
        Marker(time=505.2425003381325, text='C'),
        Marker(time=517.7672955377825, text='Z'),
        Marker(time=525.4196287976511, text='1'),
        Marker(time=539.046232416382, text='E'),
        Marker(time=549.6099694804802, text='YY')
    ]
예제 #7
0
def test_als_automation_theo():
    fname = f'{TESTS_DIR_ALS}/automation.als'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=True)

    proj.parse()

    auto = [
        TempoAutomationFloatEvent(id='92',
                                  time=-63072000.0,
                                  real_time=0.0,
                                  value=60.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='290',
                                  time=4.0,
                                  real_time=4.0,
                                  value=60.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='291',
                                  time=8.0,
                                  real_time=6.772588722239782,
                                  value=120.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='596',
                                  time=12.0,
                                  real_time=8.305065593537753,
                                  value=200.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None)
    ]
    marks = [
        Marker(time=0.0, text='A'),
        Marker(time=4.0, text='B'),
        Marker(time=5.6218604324326575, text='D'),
        Marker(time=6.772588722239782, text='C'),
        Marker(time=7.635634939595124, text='Z'),
        Marker(time=8.905065593537753, text='E')
    ]

    assert proj.tempo_automation_events == auto
    assert proj.markers == marks
예제 #8
0
def test_flp_auto_complex_daw():
    fname = f'{TESTS_DIR}/fl/complex.flp'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=False)
    proj.parse()

    print(proj.tempo_automation_events)
    print(proj.markers)
    assert proj.tempo_automation_events == [
        GlobalTempoAutomationPoint(beat=0.0,
                                   real_time=0.0,
                                   bpm=127.88732528686523,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=1.6458414793014526,
                                   real_time=0.911635230481727,
                                   bpm=90.70422649383545,
                                   track_id=1,
                                   prev_aligned_bpm=90.82207798054122),
        GlobalTempoAutomationPoint(beat=2.959980010986328,
                                   real_time=1.7278841654056063,
                                   bpm=102.81690001487732,
                                   track_id=1,
                                   prev_aligned_bpm=102.75371602927872),
        ArtificialGlobalTempoAutomationPoint(
            beat=6.625,
            real_time=3.866649627455197,
            bpm=102.81690001487732,
            track_id=None,
            prev_aligned_bpm=102.81690001487732),
        GlobalTempoAutomationPoint(beat=6.625,
                                   real_time=3.866649627455197,
                                   bpm=120.0,
                                   track_id=2,
                                   prev_aligned_bpm=102.81690001487732),
        GlobalTempoAutomationPoint(beat=11.841332912445068,
                                   real_time=6.011772630351835,
                                   bpm=175.38461208343506,
                                   track_id=2,
                                   prev_aligned_bpm=175.32732608763763),
        ArtificialGlobalTempoAutomationPoint(
            beat=13.041666666666666,
            real_time=6.422413403125042,
            bpm=175.38461208343506,
            track_id=None,
            prev_aligned_bpm=175.38461208343506),
        GlobalTempoAutomationPoint(beat=13.041666666666666,
                                   real_time=6.422413403125042,
                                   bpm=124.72440719604492,
                                   track_id=4,
                                   prev_aligned_bpm=175.38461208343506),
        GlobalTempoAutomationPoint(beat=14.454412619272867,
                                   real_time=7.101306113814689,
                                   bpm=124.72440719604492,
                                   track_id=4,
                                   prev_aligned_bpm=124.72440719604492),
        GlobalTempoAutomationPoint(beat=16.589843908945717,
                                   real_time=8.128578002780092,
                                   bpm=124.72440719604492,
                                   track_id=4,
                                   prev_aligned_bpm=124.72440719604492),
        GlobalTempoAutomationPoint(beat=17.115885535875954,
                                   real_time=8.449053473364255,
                                   bpm=75.59055089950562,
                                   track_id=4,
                                   prev_aligned_bpm=76.19865436084064),
        GlobalTempoAutomationPoint(beat=17.810966531435646,
                                   real_time=8.852002840907348,
                                   bpm=138.42519521713257,
                                   track_id=4,
                                   prev_aligned_bpm=137.85757689719802),
        ArtificialGlobalTempoAutomationPoint(
            beat=22.072916666666668,
            real_time=10.699335521560686,
            bpm=138.42519521713257,
            track_id=None,
            prev_aligned_bpm=138.42519521713257),
        GlobalTempoAutomationPoint(beat=22.072916666666668,
                                   real_time=10.699335521560686,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=138.42519521713257),
        GlobalTempoAutomationPoint(beat=23.48566261927287,
                                   real_time=11.378703970971651,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=124.72440719604492),
        GlobalTempoAutomationPoint(beat=25.62109390894572,
                                   real_time=12.405975859937055,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=124.72440719604492),
        GlobalTempoAutomationPoint(beat=26.147135535875957,
                                   real_time=12.726451330521218,
                                   bpm=75.59055089950562,
                                   track_id=3,
                                   prev_aligned_bpm=76.19865436084096),
        GlobalTempoAutomationPoint(beat=26.84221653143565,
                                   real_time=13.12940069806431,
                                   bpm=138.42519521713257,
                                   track_id=3,
                                   prev_aligned_bpm=137.8575768971977),
        ArtificialGlobalTempoAutomationPoint(
            beat=33.541666666666664,
            real_time=16.03326069493774,
            bpm=138.42519521713257,
            track_id=None,
            prev_aligned_bpm=138.42519521713257),
        GlobalTempoAutomationPoint(beat=33.541666666666664,
                                   real_time=16.03326069493774,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=138.42519521713257),
        GlobalTempoAutomationPoint(beat=34.954412619272865,
                                   real_time=16.712629144348707,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=124.72440719604492),
        GlobalTempoAutomationPoint(beat=37.08984390894572,
                                   real_time=17.73990103331411,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=124.72440719604492),
        GlobalTempoAutomationPoint(beat=37.615885535875954,
                                   real_time=18.060376503898272,
                                   bpm=75.59055089950562,
                                   track_id=3,
                                   prev_aligned_bpm=76.19865436084064),
        GlobalTempoAutomationPoint(beat=38.310966531435646,
                                   real_time=18.463325871441363,
                                   bpm=138.42519521713257,
                                   track_id=3,
                                   prev_aligned_bpm=137.85757689719802),
        ArtificialGlobalTempoAutomationPoint(
            beat=39.833333333333336,
            real_time=19.123194089847328,
            bpm=138.42519521713257,
            track_id=None,
            prev_aligned_bpm=138.42519521713257),
        GlobalTempoAutomationPoint(beat=39.833333333333336,
                                   real_time=19.123194089847328,
                                   bpm=127.88732528686523,
                                   track_id=1,
                                   prev_aligned_bpm=138.42519521713257),
        GlobalTempoAutomationPoint(beat=41.47917481263479,
                                   real_time=20.034736876644555,
                                   bpm=90.70422649383545,
                                   track_id=1,
                                   prev_aligned_bpm=90.76324425465822),
        GlobalTempoAutomationPoint(beat=42.793313344319664,
                                   real_time=20.850985577344076,
                                   bpm=102.81690001487732,
                                   track_id=1,
                                   prev_aligned_bpm=102.77771914604848),
        ArtificialGlobalTempoAutomationPoint(
            beat=50.541666666666664,
            real_time=25.372628232782063,
            bpm=102.81690001487732,
            track_id=None,
            prev_aligned_bpm=102.81690001487732),
        GlobalTempoAutomationPoint(beat=50.541666666666664,
                                   real_time=25.372628232782063,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=102.81690001487732),
        GlobalTempoAutomationPoint(beat=51.954412619272865,
                                   real_time=26.052778528795397,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=124.72440719604492),
        GlobalTempoAutomationPoint(beat=54.08984390894572,
                                   real_time=27.0800504177608,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=124.72440719604492),
        GlobalTempoAutomationPoint(beat=54.615885535875954,
                                   real_time=27.400525888344962,
                                   bpm=75.59055089950562,
                                   track_id=3,
                                   prev_aligned_bpm=76.19865436084064),
        ArtificialGlobalTempoAutomationPoint(
            beat=54.895833333333336,
            real_time=27.592956291283517,
            bpm=100.89755884981437,
            track_id=None,
            prev_aligned_bpm=100.42673059443348),
        GlobalTempoAutomationPoint(beat=54.895833333333336,
                                   real_time=27.592956291283517,
                                   bpm=127.88732528686523,
                                   track_id=1,
                                   prev_aligned_bpm=100.42673059443348),
        GlobalTempoAutomationPoint(beat=56.54167481263479,
                                   real_time=28.50492617024704,
                                   bpm=90.70422649383545,
                                   track_id=1,
                                   prev_aligned_bpm=90.76324425465822),
        GlobalTempoAutomationPoint(beat=57.855813344319664,
                                   real_time=29.32117487094656,
                                   bpm=102.81690001487732,
                                   track_id=1,
                                   prev_aligned_bpm=102.77771914604848)
    ]
    marks = [
        Marker(time=29.040613113158678, text='Auto'),
        Marker(time=32.310968190553474, text='ASDF'),
        Marker(time=35.22269768207366, text='MM')
    ]
    assert proj.markers == marks
예제 #9
0
def test_flp_auto_complex_theo():
    fname = f'{TESTS_DIR}/fl/complex.flp'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=True)
    proj.parse()

    print(proj.tempo_automation_events)
    print(proj.markers)

    auto = [
        GlobalTempoAutomationPoint(beat=0.0,
                                   real_time=0.0,
                                   bpm=127.88732528686523,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=1.6458414793014526,
                                   real_time=0.9123849810850921,
                                   bpm=90.70422649383545,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=2.959980010986328,
                                   real_time=1.7283322853130831,
                                   bpm=102.81690001487732,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=6.625,
                                             real_time=3.8670974037809733,
                                             bpm=102.81690001487732,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=6.625,
                                   real_time=3.8670974037809733,
                                   bpm=120.0,
                                   track_id=2,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=11.841332912445068,
                                   real_time=6.01160364583677,
                                   bpm=175.38461208343506,
                                   track_id=2,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=13.041666666666666,
                                             real_time=6.422244148431342,
                                             bpm=175.38461208343506,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=13.041666666666666,
                                   real_time=6.422244148431342,
                                   bpm=124.72440719604492,
                                   track_id=4,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=14.454412619272867,
                                   real_time=7.101860584876991,
                                   bpm=124.72440719604492,
                                   track_id=4,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=16.589843908945717,
                                   real_time=8.129132473842393,
                                   bpm=124.72440719604492,
                                   track_id=4,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=17.115885535875954,
                                   real_time=8.450819383229293,
                                   bpm=75.59055089950562,
                                   track_id=4,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=17.810966531435646,
                                   real_time=8.852371580604116,
                                   bpm=138.42519521713257,
                                   track_id=4,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=22.072916666666668,
                                             real_time=10.699701524497247,
                                             bpm=138.42519521713257,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=22.072916666666668,
                                   real_time=10.699701524497247,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=23.48566261927287,
                                   real_time=11.379317960942895,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=25.62109390894572,
                                   real_time=12.406589849908297,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=26.147135535875957,
                                   real_time=12.728276759295197,
                                   bpm=75.59055089950562,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=26.84221653143565,
                                   real_time=13.12982895667002,
                                   bpm=138.42519521713257,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=33.541666666666664,
                                             real_time=16.033686216783245,
                                             bpm=138.42519521713257,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=33.541666666666664,
                                   real_time=16.033686216783245,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=34.954412619272865,
                                   real_time=16.713302653228894,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=37.08984390894572,
                                   real_time=17.740574542194295,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=37.615885535875954,
                                   real_time=18.062261451581197,
                                   bpm=75.59055089950562,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=38.310966531435646,
                                   real_time=18.46381364895602,
                                   bpm=138.42519521713257,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=39.833333333333336,
                                             real_time=19.12367913060178,
                                             bpm=138.42519521713257,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=39.833333333333336,
                                   real_time=19.12367913060178,
                                   bpm=127.88732528686523,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=41.47917481263479,
                                   real_time=20.036064111686873,
                                   bpm=90.70422649383545,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=42.793313344319664,
                                   real_time=20.852011415914863,
                                   bpm=102.81690001487732,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=50.541666666666664,
                                             real_time=25.37365327900887,
                                             bpm=102.81690001487732,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=50.541666666666664,
                                   real_time=25.37365327900887,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=51.954412619272865,
                                   real_time=26.05326971545452,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=54.08984390894572,
                                   real_time=27.08054160441992,
                                   bpm=124.72440719604492,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=54.615885535875954,
                                   real_time=27.402228513806822,
                                   bpm=75.59055089950562,
                                   track_id=3,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=54.895833333333336,
                                             real_time=27.5938950362706,
                                             bpm=100.89755884981437,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=54.895833333333336,
                                   real_time=27.5938950362706,
                                   bpm=127.88732528686523,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=56.54167481263479,
                                   real_time=28.506280017355692,
                                   bpm=90.70422649383545,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=57.855813344319664,
                                   real_time=29.322227321583682,
                                   bpm=102.81690001487732,
                                   track_id=1,
                                   prev_aligned_bpm=None)
    ]
    markers = [
        Marker(time=29.04176593744516, text='Auto'),
        Marker(time=32.31201984884661, text='ASDF'),
        Marker(time=35.223749340366794, text='MM')
    ]

    assert proj.tempo_automation_events == auto
    assert proj.markers == markers
예제 #10
0
def test_flp_auto_basic2_daw():
    fname = f'{TESTS_DIR}/fl/auto-basic2.flp'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=False)
        proj.parse()

    print(proj.tempo_automation_events)
    print(proj.markers)
    events = [
        ArtificialGlobalTempoAutomationPoint(beat=0.0,
                                             real_time=0.0,
                                             bpm=106.48648738861084,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=0.9270833333333334,
                                   real_time=0.5223667468436876,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=106.48648738861084),
        GlobalTempoAutomationPoint(beat=4.984892686208089,
                                   real_time=2.3994277372238053,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=156.1841329103173),
        ArtificialGlobalTempoAutomationPoint(
            beat=7.145833333333333,
            real_time=3.229545306174421,
            bpm=156.1904740333557,
            track_id=None,
            prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=7.145833333333333,
                                   real_time=3.229545306174421,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=11.203642686208088,
                                   real_time=5.106139355343321,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=156.18413291031732),
        ArtificialGlobalTempoAutomationPoint(
            beat=14.458333333333334,
            real_time=6.356416991072306,
            bpm=156.1904740333557,
            track_id=None,
            prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=14.458333333333334,
                                   real_time=6.356416991072306,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=18.51614268620809,
                                   real_time=8.233011040241207,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=156.18413291031726),
        ArtificialGlobalTempoAutomationPoint(
            beat=20.052083333333332,
            real_time=8.823037142461324,
            bpm=156.1904740333557,
            track_id=None,
            prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=20.052083333333332,
                                   real_time=8.823037142461324,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=24.109892686208088,
                                   real_time=10.699631191630225,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=156.18413291031732),
        ArtificialGlobalTempoAutomationPoint(
            beat=25.28125,
            real_time=11.149603938257552,
            bpm=156.1904740333557,
            track_id=None,
            prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=25.28125,
                                   real_time=11.149603938257552,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=29.339059352874756,
                                   real_time=13.026665204429104,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=156.15223454990542),
        ArtificialGlobalTempoAutomationPoint(
            beat=30.583333333333332,
            real_time=13.504648949660437,
            bpm=156.1904740333557,
            track_id=None,
            prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=30.583333333333332,
                                   real_time=13.504648949660437,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=34.641142686208084,
                                   real_time=15.381242998829336,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=156.18413291031735),
        ArtificialGlobalTempoAutomationPoint(
            beat=43.666666666666664,
            real_time=18.848365177369914,
            bpm=156.1904740333557,
            track_id=None,
            prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=43.666666666666664,
                                   real_time=18.848365177369914,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=156.1904740333557),
        GlobalTempoAutomationPoint(beat=47.72447601954142,
                                   real_time=20.7244921622086,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=156.12033618949357)
    ]
    marks = [
        Marker(time=14.466061944142794, text='Auto'),
        Marker(time=16.47145965673799, text='ASDF'),
        Marker(time=20.98239198176239, text='MM')
    ]

    assert proj.tempo_automation_events == events
    assert proj.markers == marks
예제 #11
0
def test_flp_auto_basic2_theo():
    fname = f'{TESTS_DIR}/fl/auto-basic2.flp'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=True)
        proj.parse()

    print(proj.tempo_automation_events)
    print(proj.markers)
    auto = [
        ArtificialGlobalTempoAutomationPoint(beat=0.0,
                                             real_time=0.0,
                                             bpm=106.48648738861084,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=0.9270833333333334,
                                   real_time=0.5223667468436876,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=4.984892686208089,
                                   real_time=2.398727645463972,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=7.145833333333333,
                                             real_time=3.2288451006413315,
                                             bpm=156.1904740333557,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=7.145833333333333,
                                   real_time=3.2288451006413315,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=11.203642686208088,
                                   real_time=5.1052059992616154,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=14.458333333333334,
                                             real_time=6.355483521217345,
                                             bpm=156.1904740333557,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=14.458333333333334,
                                   real_time=6.355483521217345,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=18.51614268620809,
                                   real_time=8.23184441983763,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=20.052083333333332,
                                             real_time=8.821870408284491,
                                             bpm=156.1904740333557,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=20.052083333333332,
                                   real_time=8.821870408284491,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=24.109892686208088,
                                   real_time=10.698231306904775,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=25.28125,
                                             real_time=11.148203939758847,
                                             bpm=156.1904740333557,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=25.28125,
                                   real_time=11.148203939758847,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=29.339059352874756,
                                   real_time=13.024564838379131,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=30.583333333333332,
                                             real_time=13.502548142351761,
                                             bpm=156.1904740333557,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=30.583333333333332,
                                   real_time=13.502548142351761,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=34.641142686208084,
                                   real_time=15.378909040972044,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        ArtificialGlobalTempoAutomationPoint(beat=43.666666666666664,
                                             real_time=18.846031105739364,
                                             bpm=156.1904740333557,
                                             track_id=None,
                                             prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=43.666666666666664,
                                   real_time=18.846031105739364,
                                   bpm=106.48648738861084,
                                   track_id=1,
                                   prev_aligned_bpm=None),
        GlobalTempoAutomationPoint(beat=47.72447601954142,
                                   real_time=20.722392004359648,
                                   bpm=156.1904740333557,
                                   track_id=1,
                                   prev_aligned_bpm=None)
    ]
    markers = [
        Marker(time=14.464036142744112, text='Auto'),
        Marker(time=16.46912558510744, text='ASDF'),
        Marker(time=20.980291463829325, text='MM')
    ]

    assert proj.tempo_automation_events == auto
    assert proj.markers == markers
예제 #12
0
def test_flp_theo():
    fname = f'{TESTS_DIR}/fl/fl test.flp'
    with open(fname, 'rb') as f:
        markers = extract_markers(fname, f, theoretical=True)
    assert markers == [
        Marker(time=0.0, text='yoyo'),
        Marker(time=3.9006710621563982, text='magic'),
        Marker(time=9.068958321105523, text='sdaf'),
        Marker(time=25.042552775223523, text='sdf'),
        Marker(time=114.55011445229198, text='yoy'),
        Marker(time=172.16755032966174, text='new son - yo'),
        Marker(time=275.46808052745877, text='yoxxxxxxxGGGG'),
        Marker(time=392.855046661319, text='bleh33'),
        Marker(time=571.870170015456, text='IN'),
        Marker(time=669.8882867372292, text='QWER'),
        Marker(time=967.2686009430086, text='WOW'),
        Marker(time=3259.962403563346, text='out here'),
        Marker(time=3626.980089866244, text='end')
    ]
예제 #13
0
def test_als_automation_intense_theo():
    fname = f'{TESTS_DIR_ALS}/automation-intense.als'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=True)

    proj.parse()

    # auto = [TempoAutomationFloatEvent(id='598', time=-63072000.0, real_time=0.0, value=120.760574, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='597', time=2.0, real_time=0.9937018020467507, value=120.760574, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='290', time=4.0, real_time=2.4905527030701258, value=60.0, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='600', time=5.0, real_time=3.5868133818231116, value=50.3135643, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='599', time=6.5, real_time=4.838676372461883, value=125.883995, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='601', time=7.25, real_time=5.57897557720625, value=40.0667267, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='291', time=8.0, real_time=6.32803879569597, value=120.0, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='602', time=8.5, real_time=6.534582951935399, value=183.949417, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='603', time=9.5, real_time=7.251625196560135, value=54.1561279, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='596', time=12.0, real_time=9.011510026924826, value=200.0, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='604', time=13.0, real_time=9.563386505013117, value=74.6498032, curve_control1=None, curve_control2=None), TempoAutomationFloatEvent(id='605', time=15.25, real_time=10.924744397672802, value=147.658524, curve_control1=None, curve_control2=None)]
    # marks = [Marker(time=0.0, text='A'), Marker(time=0.7452763515350631, text='X'), Marker(time=2.4905527030701258, text='B'), Marker(time=4.481006849648747, text='D'), Marker(time=6.32803879569597, text='C'), Marker(time=7.708620375464505, text='Z'), Marker(time=8.710756906470802, text='1'), Marker(time=10.245379935705511, text='E'),Marker(time=12.042187505799767, text='YY')]

    auto = [
        TempoAutomationFloatEvent(id='598',
                                  time=-63072000.0,
                                  real_time=0.0,
                                  value=120.760574,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='597',
                                  time=2.0,
                                  real_time=0.9937018020467507,
                                  value=120.760574,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='290',
                                  time=4.0,
                                  real_time=2.3751211991079835,
                                  value=60.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='600',
                                  time=5.0,
                                  real_time=3.4657381748335556,
                                  value=50.3135643,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='599',
                                  time=6.5,
                                  real_time=4.557934529843792,
                                  value=125.883995,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='601',
                                  time=7.25,
                                  real_time=5.158240936269706,
                                  value=40.0667267,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='291',
                                  time=8.0,
                                  real_time=5.775787872079139,
                                  value=120.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='602',
                                  time=8.5,
                                  real_time=5.976181756557032,
                                  value=183.949417,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='603',
                                  time=9.5,
                                  real_time=6.541445040210277,
                                  value=54.1561279,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='596',
                                  time=12.0,
                                  real_time=7.885121207824302,
                                  value=200.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='604',
                                  time=13.0,
                                  real_time=8.356844190648877,
                                  value=74.6498032,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='605',
                                  time=15.25,
                                  real_time=9.618101061558722,
                                  value=147.658524,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None)
    ]
    marks = [
        Marker(time=0.0, text='A'),
        Marker(time=0.7452763515350631, text='X'),
        Marker(time=2.3751211991079835, text='B'),
        Marker(time=4.292025681716721, text='D'),
        Marker(time=5.775787872079139, text='C'),
        Marker(time=6.984600086821905, text='Z'),
        Marker(time=7.722987605556904, text='1'),
        Marker(time=9.024251745511293, text='E'),
        Marker(time=10.735544169685687, text='YY')
    ]

    assert proj.markers == marks
    assert proj.tempo_automation_events == auto
예제 #14
0
def test_als_auto_unaligned_daw():
    'als with many points, fairly steep slopes, and points unaligned on 16th notes'
    fname = f'{TESTS_DIR_ALS}/automation-intense-unaligned.als'
    with open(fname, 'rb') as f:
        proj = load_project(fname, f, theoretical=False)

    proj.parse()
    print(proj.tempo_automation_events)
    auto = [
        TempoAutomationFloatEvent(id='598',
                                  time=-63072000.0,
                                  real_time=0.0,
                                  value=120.760574,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=None),
        TempoAutomationFloatEvent(id='649',
                                  time=1.8125,
                                  real_time=0.9005422581048679,
                                  value=120.760574,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=120.760574),
        TempoAutomationFloatEvent(id='667',
                                  time=4.0625,
                                  real_time=2.3966117557062345,
                                  value=60.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=61.687793722222224),
        TempoAutomationFloatEvent(id='669',
                                  time=4.093925345487846,
                                  real_time=2.427177295750691,
                                  value=80.6271286,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=61.687793722222224),
        TempoAutomationFloatEvent(id='670',
                                  time=4.1484021187146185,
                                  real_time=2.480163570609616,
                                  value=34.5163536,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=61.687793722222224),
        TempoAutomationFloatEvent(id='671',
                                  time=4.178364343989344,
                                  real_time=2.5093060217820256,
                                  value=95.9973831,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=61.687793722222224),
        TempoAutomationFloatEvent(id='668',
                                  time=4.25,
                                  real_time=2.578981708028704,
                                  value=58.0627136,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=61.687793722222224),
        TempoAutomationFloatEvent(id='672',
                                  time=4.457870775058275,
                                  real_time=2.7937881772788167,
                                  value=55.9149513,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=58.0627136),
        TempoAutomationFloatEvent(id='712',
                                  time=4.548306901431902,
                                  real_time=2.8828996005984946,
                                  value=72.4000015,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=63.594430905110116),
        TempoAutomationFloatEvent(id='700',
                                  time=4.80127970987346,
                                  real_time=3.113221253516874,
                                  value=78.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=76.86483333864655),
        TempoAutomationFloatEvent(id='600',
                                  time=5.0,
                                  real_time=3.268340530951092,
                                  value=50.3135643,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=76.86483333864655),
        TempoAutomationFloatEvent(id='599',
                                  time=6.5,
                                  real_time=4.455212285145871,
                                  value=125.883995,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=50.3135643),
        TempoAutomationFloatEvent(id='601',
                                  time=7.25,
                                  real_time=4.946994580622144,
                                  value=40.0667267,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=125.883995),
        TempoAutomationFloatEvent(id='291',
                                  time=8.0,
                                  real_time=5.706896019728953,
                                  value=120.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=40.0667267),
        TempoAutomationFloatEvent(id='602',
                                  time=8.5,
                                  real_time=5.9305966531965275,
                                  value=183.949417,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=120.0),
        TempoAutomationFloatEvent(id='603',
                                  time=9.5,
                                  real_time=6.410345802117857,
                                  value=54.1561279,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=183.949417),
        TempoAutomationFloatEvent(id='596',
                                  time=12.0,
                                  real_time=7.860727189077446,
                                  value=200.0,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=54.1561279),
        TempoAutomationFloatEvent(id='604',
                                  time=13.0,
                                  real_time=8.27541854608016,
                                  value=74.6498032,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=200.0),
        TempoAutomationFloatEvent(id='605',
                                  time=15.25,
                                  real_time=9.587704231552863,
                                  value=147.658524,
                                  curve_control1=None,
                                  curve_control2=None,
                                  prev_aligned_bpm=74.6498032)
    ]
    assert proj.tempo_automation_events == auto
    assert proj.markers == [
        Marker(time=0.0, text='A'),
        Marker(time=0.7452763515350631, text='X'),
        Marker(time=2.335821771598745, text='B'),
        Marker(time=4.173841066076857, text='D'),
        Marker(time=5.706896019728953, text='C'),
        Marker(time=6.905534691333889, text='Z'),
        Marker(time=7.692021891450212, text='1'),
        Marker(time=8.974199935476374, text='E'),
        Marker(time=10.705147339679828, text='YY')
    ]