diff --git a/CHANGELOG.md b/CHANGELOG.md index 614d157..9780030 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# v1.2.1 +## Fixed +- [malody] Parsing a file with keys that are unused for conversion + (like `meta.mode_ext` or `extra`) would fire errors, not anymore ! + # v1.2.0 ## Added - [malody] 🎉 initial malody support ! diff --git a/jubeatools/formats/konami/jbsq/test_jbsq.py b/jubeatools/formats/konami/jbsq/test_jbsq.py index 882149e..32a40a1 100644 --- a/jubeatools/formats/konami/jbsq/test_jbsq.py +++ b/jubeatools/formats/konami/jbsq/test_jbsq.py @@ -1,4 +1,4 @@ -from hypothesis import given, reproduce_failure +from hypothesis import given from jubeatools import song from jubeatools.formats import Format diff --git a/jubeatools/formats/malody/schema.py b/jubeatools/formats/malody/schema.py index 8263b6a..3c7c16e 100644 --- a/jubeatools/formats/malody/schema.py +++ b/jubeatools/formats/malody/schema.py @@ -3,6 +3,7 @@ from decimal import Decimal from enum import Enum from typing import List, Optional, Tuple, Union +from marshmallow import EXCLUDE from marshmallow.validate import Range from marshmallow_dataclass import NewType, class_schema @@ -10,6 +11,7 @@ from marshmallow_dataclass import NewType, class_schema class Ordered: class Meta: ordered = True + unknown = EXCLUDE @dataclass diff --git a/jubeatools/formats/malody/tests/__init__.py b/jubeatools/formats/malody/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/jubeatools/formats/malody/tests/data/1533908574.mc b/jubeatools/formats/malody/tests/data/1533908574.mc new file mode 100644 index 0000000..7bb821f --- /dev/null +++ b/jubeatools/formats/malody/tests/data/1533908574.mc @@ -0,0 +1,2686 @@ +{ + "meta": { + "creator": "honoohane", + "background": "tmp_1513363139.jpg", + "version": "EXT", + "id": 25975, + "mode": 4, + "time": 1535716455, + "song": { + "title": "MilK", + "artist": "モリモリあつし", + "id": 5026 + }, + "mode_ext": {} + }, + "time": [ + { + "beat": [0,0,1], + "bpm": 150.0 + } + ], + "note": [ + { + "beat": [5,0,4], + "index": 5 + }, + { + "beat": [7,0,4], + "index": 10 + }, + { + "beat": [9,0,4], + "index": 13 + }, + { + "beat": [11,2,4], + "index": 8 + }, + { + "beat": [12,0,4], + "index": 4 + }, + { + "beat": [12,2,4], + "index": 0 + }, + { + "beat": [13,2,4], + "index": 2 + }, + { + "beat": [14,2,4], + "index": 5 + }, + { + "beat": [15,2,4], + "index": 10 + }, + { + "beat": [16,2,4], + "index": 3 + }, + { + "beat": [17,2,4], + "index": 9 + }, + { + "beat": [18,2,4], + "index": 6 + }, + { + "beat": [19,2,4], + "index": 11 + }, + { + "beat": [20,2,4], + "index": 1 + }, + { + "beat": [21,0,4], + "index": 2 + }, + { + "beat": [23,0,4], + "index": 5 + }, + { + "beat": [25,0,4], + "index": 10 + }, + { + "beat": [27,2,4], + "index": 8 + }, + { + "beat": [28,0,4], + "index": 4 + }, + { + "beat": [28,2,4], + "index": 0 + }, + { + "beat": [29,2,4], + "index": 3 + }, + { + "beat": [30,2,4], + "index": 5 + }, + { + "beat": [31,2,4], + "index": 10 + }, + { + "beat": [32,2,4], + "index": 13 + }, + { + "beat": [32,4,8], + "index": 15 + }, + { + "beat": [37,0,4], + "index": 0 + }, + { + "beat": [37,0,4], + "index": 10 + }, + { + "beat": [38,0,4], + "index": 1 + }, + { + "beat": [39,0,4], + "index": 2 + }, + { + "beat": [39,0,4], + "index": 8 + }, + { + "beat": [40,0,4], + "index": 3 + }, + { + "beat": [41,0,4], + "index": 0 + }, + { + "beat": [41,0,4], + "index": 10 + }, + { + "beat": [42,0,4], + "index": 1 + }, + { + "beat": [43,0,4], + "index": 2 + }, + { + "beat": [43,0,4], + "index": 8 + }, + { + "beat": [43,2,4], + "index": 13 + }, + { + "beat": [44,0,4], + "index": 3 + }, + { + "beat": [44,0,4], + "index": 9 + }, + { + "beat": [44,2,4], + "index": 5 + }, + { + "beat": [45,0,4], + "index": 0 + }, + { + "beat": [45,2,4], + "index": 15 + }, + { + "beat": [46,0,4], + "index": 1 + }, + { + "beat": [46,2,4], + "index": 14 + }, + { + "beat": [47,0,4], + "index": 2 + }, + { + "beat": [47,2,4], + "index": 13 + }, + { + "beat": [48,0,4], + "index": 3 + }, + { + "beat": [48,2,4], + "index": 12 + }, + { + "beat": [49,0,4], + "index": 0 + }, + { + "beat": [49,2,4], + "index": 15 + }, + { + "beat": [50,0,4], + "index": 1 + }, + { + "beat": [51,0,4], + "index": 2 + }, + { + "beat": [51,0,4], + "index": 5 + }, + { + "beat": [51,2,4], + "index": 13 + }, + { + "beat": [52,0,4], + "index": 3 + }, + { + "beat": [52,0,4], + "index": 4 + }, + { + "beat": [52,2,4], + "index": 12 + }, + { + "beat": [52,3,4], + "index": 10 + }, + { + "beat": [53,0,4], + "index": 0 + }, + { + "beat": [53,3,4], + "index": 5 + }, + { + "beat": [54,0,4], + "index": 1 + }, + { + "beat": [54,3,4], + "index": 9 + }, + { + "beat": [55,0,4], + "index": 2 + }, + { + "beat": [55,3,4], + "index": 13 + }, + { + "beat": [56,0,4], + "index": 3 + }, + { + "beat": [56,2,4], + "index": 11 + }, + { + "beat": [57,0,4], + "index": 0 + }, + { + "beat": [57,2,4], + "index": 8 + }, + { + "beat": [58,0,4], + "index": 1 + }, + { + "beat": [58,1,4], + "index": 6 + }, + { + "beat": [58,2,4], + "index": 5 + }, + { + "beat": [58,3,4], + "index": 10 + }, + { + "beat": [59,0,4], + "index": 2 + }, + { + "beat": [59,2,4], + "index": 11 + }, + { + "beat": [59,3,4], + "index": 4 + }, + { + "beat": [60,0,4], + "index": 3 + }, + { + "beat": [60,1,4], + "index": 12 + }, + { + "beat": [60,2,4], + "index": 14 + }, + { + "beat": [60,2,4], + "index": 15 + }, + { + "beat": [61,0,4], + "index": 9 + }, + { + "beat": [61,1,4], + "index": 6 + }, + { + "beat": [61,2,4], + "index": 5 + }, + { + "beat": [61,3,4], + "index": 10 + }, + { + "beat": [62,0,4], + "index": 8 + }, + { + "beat": [62,1,4], + "index": 7 + }, + { + "beat": [62,2,4], + "index": 4 + }, + { + "beat": [62,3,4], + "index": 11 + }, + { + "beat": [63,0,4], + "index": 0 + }, + { + "beat": [63,1,4], + "index": 15 + }, + { + "beat": [63,2,4], + "index": 1 + }, + { + "beat": [63,3,4], + "index": 14 + }, + { + "beat": [64,0,4], + "index": 2 + }, + { + "beat": [64,1,4], + "index": 13 + }, + { + "beat": [64,2,4], + "index": 3 + }, + { + "beat": [64,3,4], + "index": 12 + }, + { + "beat": [65,0,4], + "index": 5 + }, + { + "beat": [65,0,4], + "index": 6 + }, + { + "beat": [68,0,4], + "index": 13 + }, + { + "beat": [68,2,4], + "index": 2 + }, + { + "beat": [69,0,4], + "index": 0 + }, + { + "beat": [69,0,4], + "index": 15 + }, + { + "beat": [70,0,6], + "index": 4 + }, + { + "beat": [70,1,6], + "index": 5 + }, + { + "beat": [70,2,6], + "index": 6 + }, + { + "beat": [70,3,6], + "index": 9 + }, + { + "beat": [70,4,6], + "index": 10 + }, + { + "beat": [70,5,6], + "index": 11 + }, + { + "beat": [71,0,4], + "endbeat": [72,0,4], + "index": 3, + "endindex": 0 + }, + { + "beat": [71,0,4], + "endbeat": [72,0,4], + "index": 12, + "endindex": 15 + }, + { + "beat": [73,0,4], + "endbeat": [75,0,4], + "index": 6, + "endindex": 4 + }, + { + "beat": [75,0,4], + "endbeat": [76,0,4], + "index": 3, + "endindex": 15 + }, + { + "beat": [75,0,4], + "endbeat": [76,0,4], + "index": 12, + "endindex": 0 + }, + { + "beat": [76,0,6], + "index": 10 + }, + { + "beat": [76,3,6], + "index": 5 + }, + { + "beat": [77,0,6], + "index": 2 + }, + { + "beat": [77,0,6], + "index": 13 + }, + { + "beat": [77,2,4], + "index": 4 + }, + { + "beat": [77,2,4], + "index": 11 + }, + { + "beat": [79,0,4], + "endbeat": [80,0,4], + "index": 3, + "endindex": 0 + }, + { + "beat": [79,0,4], + "endbeat": [80,0,4], + "index": 12, + "endindex": 15 + }, + { + "beat": [80,0,4], + "index": 5 + }, + { + "beat": [80,0,4], + "index": 10 + }, + { + "beat": [81,0,4], + "endbeat": [82,2,4], + "index": 6, + "endindex": 14 + }, + { + "beat": [81,0,4], + "endbeat": [82,2,4], + "index": 9, + "endindex": 1 + }, + { + "beat": [82,2,4], + "index": 0 + }, + { + "beat": [82,2,4], + "index": 15 + }, + { + "beat": [83,2,4], + "index": 3 + }, + { + "beat": [83,2,4], + "index": 12 + }, + { + "beat": [84,0,4], + "index": 7 + }, + { + "beat": [84,0,4], + "index": 8 + }, + { + "beat": [84,2,4], + "index": 4 + }, + { + "beat": [84,2,4], + "index": 11 + }, + { + "beat": [85,0,4], + "endbeat": [87,0,4], + "index": 5, + "endindex": 7 + }, + { + "beat": [85,0,4], + "endbeat": [87,0,4], + "index": 10, + "endindex": 8 + }, + { + "beat": [87,0,4], + "endbeat": [88,0,4], + "index": 3, + "endindex": 0 + }, + { + "beat": [87,0,4], + "endbeat": [88,0,4], + "index": 12, + "endindex": 15 + }, + { + "beat": [88,0,4], + "index": 4 + }, + { + "beat": [88,0,4], + "index": 11 + }, + { + "beat": [89,0,4], + "index": 9 + }, + { + "beat": [90,0,4], + "index": 6 + }, + { + "beat": [91,0,4], + "endbeat": [92,0,4], + "index": 3, + "endindex": 15 + }, + { + "beat": [91,0,4], + "endbeat": [92,0,4], + "index": 12, + "endindex": 0 + }, + { + "beat": [92,0,4], + "index": 4 + }, + { + "beat": [92,0,4], + "index": 11 + }, + { + "beat": [92,2,4], + "index": 2 + }, + { + "beat": [92,2,4], + "index": 13 + }, + { + "beat": [93,0,6], + "index": 5 + }, + { + "beat": [93,1,6], + "index": 10 + }, + { + "beat": [93,2,6], + "index": 9 + }, + { + "beat": [93,3,6], + "index": 6 + }, + { + "beat": [93,4,6], + "index": 1 + }, + { + "beat": [93,5,6], + "index": 14 + }, + { + "beat": [94,0,6], + "index": 8 + }, + { + "beat": [94,1,6], + "index": 7 + }, + { + "beat": [94,2,4], + "index": 0 + }, + { + "beat": [94,3,4], + "index": 15 + }, + { + "beat": [95,0,4], + "index": 3 + }, + { + "beat": [95,0,4], + "index": 12 + }, + { + "beat": [95,3,4], + "index": 2 + }, + { + "beat": [95,3,4], + "index": 13 + }, + { + "beat": [96,2,4], + "index": 1 + }, + { + "beat": [96,2,4], + "index": 14 + }, + { + "beat": [97,0,4], + "index": 8 + }, + { + "beat": [97,2,4], + "index": 9 + }, + { + "beat": [98,0,4], + "index": 7 + }, + { + "beat": [98,2,4], + "index": 6 + }, + { + "beat": [99,0,4], + "index": 5 + }, + { + "beat": [99,1,4], + "index": 10 + }, + { + "beat": [99,3,4], + "index": 3 + }, + { + "beat": [99,3,4], + "index": 12 + }, + { + "beat": [100,1,4], + "index": 4 + }, + { + "beat": [100,2,4], + "index": 11 + }, + { + "beat": [101,0,4], + "index": 1 + }, + { + "beat": [101,0,4], + "index": 7 + }, + { + "beat": [101,0,4], + "index": 8 + }, + { + "beat": [101,0,4], + "index": 14 + }, + { + "beat": [103,0,4], + "endbeat": [104,0,4], + "index": 3, + "endindex": 0 + }, + { + "beat": [103,0,4], + "endbeat": [104,0,4], + "index": 12, + "endindex": 15 + }, + { + "beat": [105,0,4], + "endbeat": [107,0,4], + "index": 6, + "endindex": 4 + }, + { + "beat": [105,0,8], + "endbeat": [107,0,8], + "index": 9, + "endindex": 11 + }, + { + "beat": [107,0,4], + "endbeat": [108,0,4], + "index": 3, + "endindex": 15 + }, + { + "beat": [107,0,4], + "endbeat": [108,0,4], + "index": 12, + "endindex": 0 + }, + { + "beat": [108,0,4], + "index": 10 + }, + { + "beat": [108,2,4], + "index": 5 + }, + { + "beat": [109,0,4], + "index": 2 + }, + { + "beat": [109,0,4], + "index": 13 + }, + { + "beat": [109,2,4], + "index": 4 + }, + { + "beat": [109,4,8], + "index": 11 + }, + { + "beat": [111,0,4], + "endbeat": [112,0,4], + "index": 3, + "endindex": 0 + }, + { + "beat": [111,0,4], + "endbeat": [112,0,4], + "index": 12, + "endindex": 15 + }, + { + "beat": [112,0,4], + "index": 5 + }, + { + "beat": [112,0,4], + "index": 10 + }, + { + "beat": [113,0,4], + "endbeat": [114,2,4], + "index": 6, + "endindex": 14 + }, + { + "beat": [113,0,4], + "endbeat": [114,2,4], + "index": 9, + "endindex": 1 + }, + { + "beat": [114,2,4], + "index": 0 + }, + { + "beat": [114,2,4], + "index": 15 + }, + { + "beat": [115,2,4], + "index": 3 + }, + { + "beat": [115,2,4], + "index": 12 + }, + { + "beat": [116,0,4], + "index": 7 + }, + { + "beat": [116,0,4], + "index": 8 + }, + { + "beat": [116,2,4], + "index": 4 + }, + { + "beat": [116,2,4], + "index": 11 + }, + { + "beat": [117,0,4], + "endbeat": [119,0,4], + "index": 5, + "endindex": 7 + }, + { + "beat": [117,0,4], + "endbeat": [119,0,4], + "index": 10, + "endindex": 8 + }, + { + "beat": [119,0,4], + "endbeat": [120,0,4], + "index": 3, + "endindex": 0 + }, + { + "beat": [119,0,4], + "endbeat": [120,0,4], + "index": 12, + "endindex": 15 + }, + { + "beat": [120,0,4], + "index": 4 + }, + { + "beat": [120,0,4], + "index": 11 + }, + { + "beat": [121,0,4], + "endbeat": [123,0,4], + "index": 6, + "endindex": 4 + }, + { + "beat": [121,0,4], + "endbeat": [123,0,4], + "index": 9, + "endindex": 11 + }, + { + "beat": [123,0,4], + "endbeat": [124,0,4], + "index": 3, + "endindex": 15 + }, + { + "beat": [123,0,4], + "endbeat": [124,0,4], + "index": 12, + "endindex": 0 + }, + { + "beat": [124,0,4], + "index": 4 + }, + { + "beat": [124,0,4], + "index": 11 + }, + { + "beat": [124,2,4], + "index": 2 + }, + { + "beat": [124,2,4], + "index": 13 + }, + { + "beat": [125,0,4], + "endbeat": [125,2,4], + "index": 7, + "endindex": 5 + }, + { + "beat": [125,2,4], + "endbeat": [126,0,4], + "index": 8, + "endindex": 0 + }, + { + "beat": [126,0,4], + "endbeat": [126,2,4], + "index": 15, + "endindex": 13 + }, + { + "beat": [126,2,4], + "index": 0 + }, + { + "beat": [127,0,4], + "index": 3 + }, + { + "beat": [127,0,4], + "index": 12 + }, + { + "beat": [127,3,4], + "index": 2 + }, + { + "beat": [127,3,4], + "index": 13 + }, + { + "beat": [128,2,4], + "index": 1 + }, + { + "beat": [128,2,4], + "index": 14 + }, + { + "beat": [129,0,4], + "index": 8 + }, + { + "beat": [129,2,4], + "index": 9 + }, + { + "beat": [130,0,4], + "index": 7 + }, + { + "beat": [130,2,4], + "index": 6 + }, + { + "beat": [131,0,4], + "endbeat": [131,2,4], + "index": 12, + "endindex": 8 + }, + { + "beat": [131,2,4], + "endbeat": [132,0,4], + "index": 4, + "endindex": 8 + }, + { + "beat": [132,0,4], + "endbeat": [132,2,4], + "index": 13, + "endindex": 9 + }, + { + "beat": [132,2,4], + "endbeat": [133,0,4], + "index": 5, + "endindex": 9 + }, + { + "beat": [133,0,6], + "index": 10 + }, + { + "beat": [134,0,6], + "index": 1 + }, + { + "beat": [135,0,6], + "index": 2 + }, + { + "beat": [135,0,6], + "index": 8 + }, + { + "beat": [136,0,6], + "index": 3 + }, + { + "beat": [137,0,6], + "index": 0 + }, + { + "beat": [137,0,4], + "index": 10 + }, + { + "beat": [138,0,6], + "index": 1 + }, + { + "beat": [139,0,6], + "index": 2 + }, + { + "beat": [139,0,4], + "index": 8 + }, + { + "beat": [139,2,4], + "index": 13 + }, + { + "beat": [140,0,6], + "index": 3 + }, + { + "beat": [140,0,4], + "index": 9 + }, + { + "beat": [140,2,4], + "index": 5 + }, + { + "beat": [141,0,4], + "index": 0 + }, + { + "beat": [141,2,4], + "index": 15 + }, + { + "beat": [142,0,4], + "index": 1 + }, + { + "beat": [142,2,4], + "index": 14 + }, + { + "beat": [143,0,4], + "index": 2 + }, + { + "beat": [143,2,4], + "index": 13 + }, + { + "beat": [144,0,4], + "index": 3 + }, + { + "beat": [144,2,4], + "index": 12 + }, + { + "beat": [145,0,4], + "index": 0 + }, + { + "beat": [145,2,4], + "index": 15 + }, + { + "beat": [146,0,4], + "index": 1 + }, + { + "beat": [147,0,4], + "index": 2 + }, + { + "beat": [147,0,4], + "index": 5 + }, + { + "beat": [147,2,4], + "index": 13 + }, + { + "beat": [148,0,4], + "index": 3 + }, + { + "beat": [148,0,4], + "index": 4 + }, + { + "beat": [148,2,4], + "index": 12 + }, + { + "beat": [148,3,4], + "index": 10 + }, + { + "beat": [149,0,6], + "index": 0 + }, + { + "beat": [149,3,4], + "index": 5 + }, + { + "beat": [150,0,4], + "index": 1 + }, + { + "beat": [150,3,4], + "index": 9 + }, + { + "beat": [151,0,4], + "index": 2 + }, + { + "beat": [151,3,4], + "index": 13 + }, + { + "beat": [152,0,4], + "index": 3 + }, + { + "beat": [152,2,4], + "index": 11 + }, + { + "beat": [153,0,4], + "index": 0 + }, + { + "beat": [153,2,4], + "index": 8 + }, + { + "beat": [154,0,4], + "index": 1 + }, + { + "beat": [154,1,4], + "index": 6 + }, + { + "beat": [154,2,4], + "index": 5 + }, + { + "beat": [154,3,4], + "index": 10 + }, + { + "beat": [155,0,4], + "index": 2 + }, + { + "beat": [155,2,4], + "index": 11 + }, + { + "beat": [155,3,4], + "index": 4 + }, + { + "beat": [156,0,4], + "index": 3 + }, + { + "beat": [156,1,4], + "index": 12 + }, + { + "beat": [156,2,4], + "index": 14 + }, + { + "beat": [156,2,4], + "index": 15 + }, + { + "beat": [157,0,4], + "index": 9 + }, + { + "beat": [157,1,4], + "index": 6 + }, + { + "beat": [157,2,4], + "index": 5 + }, + { + "beat": [157,3,4], + "index": 10 + }, + { + "beat": [158,0,4], + "index": 8 + }, + { + "beat": [158,1,4], + "index": 7 + }, + { + "beat": [158,2,4], + "index": 4 + }, + { + "beat": [158,3,4], + "index": 11 + }, + { + "beat": [159,0,4], + "index": 0 + }, + { + "beat": [159,1,4], + "index": 15 + }, + { + "beat": [159,2,4], + "index": 1 + }, + { + "beat": [159,3,4], + "index": 14 + }, + { + "beat": [160,0,4], + "index": 2 + }, + { + "beat": [160,1,4], + "index": 13 + }, + { + "beat": [160,2,4], + "index": 3 + }, + { + "beat": [160,3,4], + "index": 12 + }, + { + "beat": [161,0,4], + "index": 5 + }, + { + "beat": [161,2,4], + "index": 10 + }, + { + "beat": [162,0,4], + "index": 0 + }, + { + "beat": [162,0,4], + "index": 8 + }, + { + "beat": [162,2,4], + "index": 7 + }, + { + "beat": [162,2,4], + "index": 15 + }, + { + "beat": [163,0,4], + "index": 1 + }, + { + "beat": [163,0,4], + "index": 4 + }, + { + "beat": [163,2,4], + "index": 11 + }, + { + "beat": [163,2,4], + "index": 14 + }, + { + "beat": [164,0,4], + "index": 5 + }, + { + "beat": [164,1,4], + "index": 6 + }, + { + "beat": [164,2,4], + "index": 9 + }, + { + "beat": [164,3,4], + "index": 10 + }, + { + "beat": [165,0,4], + "index": 2 + }, + { + "beat": [165,0,4], + "index": 13 + }, + { + "beat": [165,3,4], + "index": 3 + }, + { + "beat": [165,3,4], + "index": 12 + }, + { + "beat": [166,2,4], + "index": 7 + }, + { + "beat": [166,2,4], + "index": 8 + }, + { + "beat": [167,1,4], + "index": 4 + }, + { + "beat": [167,1,4], + "index": 11 + }, + { + "beat": [168,0,4], + "index": 9 + }, + { + "beat": [168,2,4], + "endbeat": [169,0,4], + "index": 6, + "endindex": 5 + }, + { + "beat": [169,0,4], + "index": 1 + }, + { + "beat": [169,0,4], + "index": 14 + }, + { + "beat": [169,3,4], + "index": 0 + }, + { + "beat": [169,3,4], + "index": 15 + }, + { + "beat": [170,2,4], + "index": 4 + }, + { + "beat": [170,2,4], + "index": 11 + }, + { + "beat": [171,1,4], + "index": 7 + }, + { + "beat": [171,1,4], + "index": 8 + }, + { + "beat": [172,0,4], + "endbeat": [173,0,4], + "index": 5, + "endindex": 9 + }, + { + "beat": [172,0,4], + "endbeat": [173,0,4], + "index": 10, + "endindex": 6 + }, + { + "beat": [173,0,4], + "index": 2 + }, + { + "beat": [173,0,4], + "index": 13 + }, + { + "beat": [173,3,4], + "index": 3 + }, + { + "beat": [173,3,4], + "index": 12 + }, + { + "beat": [174,2,4], + "index": 7 + }, + { + "beat": [174,2,4], + "index": 8 + }, + { + "beat": [175,1,4], + "index": 4 + }, + { + "beat": [175,1,4], + "index": 15 + }, + { + "beat": [176,0,4], + "index": 5 + }, + { + "beat": [176,2,4], + "index": 9 + }, + { + "beat": [176,3,4], + "index": 10 + }, + { + "beat": [177,0,4], + "index": 0 + }, + { + "beat": [177,0,4], + "index": 3 + }, + { + "beat": [177,2,4], + "index": 11 + }, + { + "beat": [178,0,4], + "index": 4 + }, + { + "beat": [178,2,4], + "index": 12 + }, + { + "beat": [179,0,4], + "index": 2 + }, + { + "beat": [179,2,4], + "index": 13 + }, + { + "beat": [180,0,4], + "index": 6 + }, + { + "beat": [180,1,4], + "index": 5 + }, + { + "beat": [180,2,4], + "index": 10 + }, + { + "beat": [180,3,4], + "index": 9 + }, + { + "beat": [181,0,4], + "index": 1 + }, + { + "beat": [181,0,4], + "index": 14 + }, + { + "beat": [181,3,4], + "index": 0 + }, + { + "beat": [181,3,4], + "index": 15 + }, + { + "beat": [182,2,4], + "index": 4 + }, + { + "beat": [182,2,4], + "index": 11 + }, + { + "beat": [183,1,4], + "index": 7 + }, + { + "beat": [183,1,4], + "index": 8 + }, + { + "beat": [184,0,4], + "index": 10 + }, + { + "beat": [184,2,4], + "endbeat": [185,0,4], + "index": 5, + "endindex": 6 + }, + { + "beat": [185,0,4], + "index": 2 + }, + { + "beat": [185,0,4], + "index": 13 + }, + { + "beat": [185,3,4], + "index": 3 + }, + { + "beat": [185,3,4], + "index": 12 + }, + { + "beat": [186,2,4], + "index": 7 + }, + { + "beat": [186,2,4], + "index": 8 + }, + { + "beat": [187,1,4], + "index": 4 + }, + { + "beat": [187,1,4], + "index": 11 + }, + { + "beat": [188,0,4], + "endbeat": [189,0,4], + "index": 6, + "endindex": 10 + }, + { + "beat": [188,0,4], + "endbeat": [189,0,4], + "index": 9, + "endindex": 5 + }, + { + "beat": [189,0,4], + "index": 1 + }, + { + "beat": [189,0,4], + "index": 14 + }, + { + "beat": [189,3,4], + "index": 0 + }, + { + "beat": [189,3,4], + "index": 15 + }, + { + "beat": [190,2,4], + "index": 4 + }, + { + "beat": [190,2,4], + "index": 11 + }, + { + "beat": [191,1,4], + "index": 7 + }, + { + "beat": [191,1,4], + "index": 8 + }, + { + "beat": [192,0,4], + "index": 2 + }, + { + "beat": [192,2,4], + "index": 5 + }, + { + "beat": [192,3,4], + "index": 10 + }, + { + "beat": [193,0,4], + "endbeat": [197,0,4], + "index": 12, + "endindex": 4 + }, + { + "beat": [193,0,4], + "index": 13 + }, + { + "beat": [197,0,4], + "index": 3 + }, + { + "beat": [197,0,4], + "index": 5 + }, + { + "beat": [197,0,4], + "index": 10 + }, + { + "beat": [198,0,4], + "index": 0 + }, + { + "beat": [198,3,4], + "index": 7 + }, + { + "beat": [198,3,4], + "index": 15 + }, + { + "beat": [199,2,4], + "index": 6 + }, + { + "beat": [199,2,4], + "index": 14 + }, + { + "beat": [200,0,4], + "index": 9 + }, + { + "beat": [200,0,4], + "index": 10 + }, + { + "beat": [200,2,4], + "index": 1 + }, + { + "beat": [200,2,4], + "index": 2 + }, + { + "beat": [201,0,4], + "index": 4 + }, + { + "beat": [201,0,4], + "index": 12 + }, + { + "beat": [201,3,4], + "index": 5 + }, + { + "beat": [201,3,4], + "index": 13 + }, + { + "beat": [202,2,4], + "index": 3 + }, + { + "beat": [202,2,4], + "index": 11 + }, + { + "beat": [203,1,4], + "index": 2 + }, + { + "beat": [203,1,4], + "index": 10 + }, + { + "beat": [204,0,4], + "endbeat": [205,0,4], + "index": 6, + "endindex": 7 + }, + { + "beat": [205,0,4], + "index": 4 + }, + { + "beat": [205,0,4], + "index": 12 + }, + { + "beat": [205,3,4], + "index": 5 + }, + { + "beat": [205,3,4], + "index": 13 + }, + { + "beat": [206,2,4], + "index": 3 + }, + { + "beat": [206,2,4], + "index": 11 + }, + { + "beat": [207,1,4], + "index": 2 + }, + { + "beat": [207,1,4], + "index": 10 + }, + { + "beat": [208,0,4], + "index": 0 + }, + { + "beat": [208,2,4], + "index": 5 + }, + { + "beat": [208,3,4], + "index": 6 + }, + { + "beat": [209,0,4], + "index": 12 + }, + { + "beat": [209,0,4], + "index": 15 + }, + { + "beat": [209,2,4], + "index": 4 + }, + { + "beat": [210,0,4], + "index": 11 + }, + { + "beat": [210,2,4], + "index": 3 + }, + { + "beat": [211,0,8], + "index": 14 + }, + { + "beat": [211,2,4], + "index": 2 + }, + { + "beat": [212,0,4], + "index": 5 + }, + { + "beat": [212,1,4], + "index": 6 + }, + { + "beat": [212,2,4], + "index": 9 + }, + { + "beat": [212,3,4], + "index": 10 + }, + { + "beat": [213,0,4], + "index": 0 + }, + { + "beat": [213,0,4], + "index": 15 + }, + { + "beat": [213,3,4], + "index": 1 + }, + { + "beat": [213,3,4], + "index": 14 + }, + { + "beat": [214,2,4], + "index": 2 + }, + { + "beat": [214,2,4], + "index": 13 + }, + { + "beat": [215,1,4], + "index": 3 + }, + { + "beat": [215,1,4], + "index": 12 + }, + { + "beat": [216,0,4], + "index": 6 + }, + { + "beat": [216,0,4], + "index": 9 + }, + { + "beat": [216,3,4], + "index": 5 + }, + { + "beat": [216,3,4], + "index": 10 + }, + { + "beat": [217,2,4], + "index": 4 + }, + { + "beat": [217,2,4], + "index": 11 + }, + { + "beat": [218,1,4], + "index": 7 + }, + { + "beat": [218,1,4], + "index": 8 + }, + { + "beat": [219,0,4], + "index": 3 + }, + { + "beat": [219,0,4], + "index": 12 + }, + { + "beat": [219,3,4], + "index": 2 + }, + { + "beat": [219,3,4], + "index": 13 + }, + { + "beat": [220,2,4], + "index": 5 + }, + { + "beat": [220,2,4], + "index": 10 + }, + { + "beat": [221,1,4], + "index": 6 + }, + { + "beat": [221,1,4], + "index": 9 + }, + { + "beat": [222,0,6], + "index": 3 + }, + { + "beat": [222,0,6], + "index": 12 + }, + { + "beat": [222,3,4], + "index": 7 + }, + { + "beat": [222,3,4], + "index": 8 + }, + { + "beat": [223,2,4], + "index": 4 + }, + { + "beat": [223,2,4], + "index": 11 + }, + { + "beat": [224,1,4], + "index": 0 + }, + { + "beat": [224,1,4], + "index": 15 + }, + { + "beat": [225,0,4], + "index": 6 + }, + { + "beat": [225,4,8], + "index": 1 + }, + { + "beat": [225,5,8], + "index": 5 + }, + { + "beat": [225,6,8], + "index": 9 + }, + { + "beat": [225,7,8], + "index": 13 + }, + { + "beat": [226,0,8], + "index": 7 + }, + { + "beat": [226,4,8], + "index": 2 + }, + { + "beat": [227,0,8], + "index": 0 + }, + { + "beat": [227,1,8], + "index": 4 + }, + { + "beat": [227,2,8], + "index": 8 + }, + { + "beat": [227,3,8], + "index": 12 + }, + { + "beat": [227,4,8], + "index": 10 + }, + { + "beat": [228,0,4], + "index": 3 + }, + { + "beat": [228,2,4], + "index": 15 + }, + { + "beat": [229,0,4], + "index": 14 + }, + { + "beat": [230,0,6], + "index": 9 + }, + { + "beat": [230,1,6], + "index": 6 + }, + { + "beat": [230,2,6], + "index": 5 + }, + { + "beat": [230,3,6], + "index": 10 + }, + { + "beat": [230,4,6], + "index": 13 + }, + { + "beat": [230,5,6], + "index": 2 + }, + { + "beat": [231,0,288], + "endbeat": [232,0,288], + "index": 3, + "endindex": 0 + }, + { + "beat": [231,0,288], + "endbeat": [232,0,288], + "index": 12, + "endindex": 15 + }, + { + "beat": [233,0,288], + "endbeat": [235,0,288], + "index": 6, + "endindex": 4 + }, + { + "beat": [233,0,8], + "endbeat": [235,0,4], + "index": 9, + "endindex": 11 + }, + { + "beat": [235,0,288], + "endbeat": [236,0,288], + "index": 3, + "endindex": 15 + }, + { + "beat": [235,0,288], + "endbeat": [236,0,288], + "index": 12, + "endindex": 0 + }, + { + "beat": [236,0,288], + "index": 10 + }, + { + "beat": [236,144,288], + "index": 5 + }, + { + "beat": [237,0,288], + "index": 2 + }, + { + "beat": [237,0,288], + "index": 13 + }, + { + "beat": [237,144,288], + "index": 4 + }, + { + "beat": [237,2,4], + "index": 11 + }, + { + "beat": [239,0,288], + "endbeat": [240,0,288], + "index": 3, + "endindex": 0 + }, + { + "beat": [239,0,288], + "endbeat": [240,0,288], + "index": 12, + "endindex": 15 + }, + { + "beat": [240,0,288], + "index": 5 + }, + { + "beat": [240,0,288], + "index": 10 + }, + { + "beat": [241,0,288], + "endbeat": [242,144,288], + "index": 6, + "endindex": 14 + }, + { + "beat": [241,0,288], + "endbeat": [242,144,288], + "index": 9, + "endindex": 1 + }, + { + "beat": [242,144,288], + "index": 0 + }, + { + "beat": [242,144,288], + "index": 15 + }, + { + "beat": [243,144,288], + "index": 3 + }, + { + "beat": [243,144,288], + "index": 12 + }, + { + "beat": [244,0,288], + "index": 7 + }, + { + "beat": [244,0,288], + "index": 8 + }, + { + "beat": [244,144,288], + "index": 4 + }, + { + "beat": [244,144,288], + "index": 11 + }, + { + "beat": [245,0,288], + "endbeat": [247,0,288], + "index": 5, + "endindex": 7 + }, + { + "beat": [245,0,288], + "endbeat": [247,0,288], + "index": 10, + "endindex": 8 + }, + { + "beat": [247,0,288], + "endbeat": [248,0,288], + "index": 3, + "endindex": 0 + }, + { + "beat": [247,0,288], + "endbeat": [248,0,288], + "index": 12, + "endindex": 15 + }, + { + "beat": [248,0,288], + "index": 4 + }, + { + "beat": [248,0,288], + "index": 11 + }, + { + "beat": [249,0,4], + "index": 9 + }, + { + "beat": [250,0,4], + "index": 6 + }, + { + "beat": [251,0,288], + "endbeat": [252,0,288], + "index": 3, + "endindex": 15 + }, + { + "beat": [251,0,288], + "endbeat": [252,0,288], + "index": 12, + "endindex": 0 + }, + { + "beat": [252,0,6], + "index": 7 + }, + { + "beat": [252,0,6], + "index": 8 + }, + { + "beat": [252,3,6], + "index": 2 + }, + { + "beat": [252,3,6], + "index": 13 + }, + { + "beat": [253,0,6], + "index": 1 + }, + { + "beat": [253,1,6], + "index": 14 + }, + { + "beat": [253,2,6], + "index": 9 + }, + { + "beat": [253,3,6], + "index": 6 + }, + { + "beat": [253,4,6], + "index": 4 + }, + { + "beat": [253,5,6], + "index": 11 + }, + { + "beat": [254,0,6], + "index": 5 + }, + { + "beat": [254,1,6], + "index": 10 + }, + { + "beat": [254,3,6], + "index": 0 + }, + { + "beat": [254,3,4], + "index": 15 + }, + { + "beat": [255,0,288], + "index": 3 + }, + { + "beat": [255,0,288], + "index": 12 + }, + { + "beat": [255,216,288], + "index": 2 + }, + { + "beat": [255,216,288], + "index": 13 + }, + { + "beat": [256,2,4], + "index": 1 + }, + { + "beat": [256,2,4], + "index": 14 + }, + { + "beat": [257,0,288], + "index": 8 + }, + { + "beat": [257,144,288], + "index": 9 + }, + { + "beat": [258,0,288], + "index": 7 + }, + { + "beat": [258,144,288], + "index": 6 + }, + { + "beat": [259,0,4], + "index": 5 + }, + { + "beat": [259,1,4], + "index": 10 + }, + { + "beat": [259,216,288], + "index": 3 + }, + { + "beat": [259,216,288], + "index": 12 + }, + { + "beat": [260,1,4], + "index": 0 + }, + { + "beat": [260,2,4], + "index": 15 + }, + { + "beat": [261,0,4], + "index": 2 + }, + { + "beat": [261,0,4], + "index": 7 + }, + { + "beat": [261,0,4], + "index": 8 + }, + { + "beat": [261,0,4], + "index": 13 + }, + { + "beat": [263,0,288], + "endbeat": [264,0,288], + "index": 3, + "endindex": 0 + }, + { + "beat": [263,0,288], + "endbeat": [264,0,288], + "index": 12, + "endindex": 15 + }, + { + "beat": [265,0,288], + "endbeat": [267,0,288], + "index": 6, + "endindex": 4 + }, + { + "beat": [265,0,4], + "endbeat": [267,0,4], + "index": 9, + "endindex": 11 + }, + { + "beat": [267,0,288], + "endbeat": [268,0,288], + "index": 3, + "endindex": 15 + }, + { + "beat": [267,0,288], + "endbeat": [268,0,288], + "index": 12, + "endindex": 0 + }, + { + "beat": [268,0,288], + "index": 10 + }, + { + "beat": [268,144,288], + "index": 5 + }, + { + "beat": [269,0,288], + "index": 2 + }, + { + "beat": [269,0,288], + "index": 13 + }, + { + "beat": [269,144,288], + "index": 4 + }, + { + "beat": [269,2,4], + "index": 11 + }, + { + "beat": [271,0,288], + "endbeat": [272,0,288], + "index": 3, + "endindex": 0 + }, + { + "beat": [271,0,288], + "endbeat": [272,0,288], + "index": 12, + "endindex": 15 + }, + { + "beat": [272,0,288], + "index": 5 + }, + { + "beat": [272,0,288], + "index": 10 + }, + { + "beat": [273,0,288], + "endbeat": [274,144,288], + "index": 6, + "endindex": 14 + }, + { + "beat": [273,0,288], + "endbeat": [274,144,288], + "index": 9, + "endindex": 1 + }, + { + "beat": [274,144,288], + "index": 0 + }, + { + "beat": [274,144,288], + "index": 15 + }, + { + "beat": [275,144,288], + "index": 3 + }, + { + "beat": [275,144,288], + "index": 12 + }, + { + "beat": [276,0,288], + "index": 7 + }, + { + "beat": [276,0,288], + "index": 8 + }, + { + "beat": [276,144,288], + "index": 4 + }, + { + "beat": [276,144,288], + "index": 11 + }, + { + "beat": [277,0,288], + "endbeat": [279,0,288], + "index": 5, + "endindex": 7 + }, + { + "beat": [277,0,288], + "endbeat": [279,0,288], + "index": 10, + "endindex": 8 + }, + { + "beat": [279,0,288], + "endbeat": [280,0,288], + "index": 3, + "endindex": 0 + }, + { + "beat": [279,0,288], + "endbeat": [280,0,288], + "index": 12, + "endindex": 15 + }, + { + "beat": [280,0,288], + "index": 4 + }, + { + "beat": [280,0,288], + "index": 11 + }, + { + "beat": [281,0,288], + "endbeat": [283,0,288], + "index": 6, + "endindex": 4 + }, + { + "beat": [281,0,288], + "endbeat": [283,0,288], + "index": 9, + "endindex": 11 + }, + { + "beat": [283,0,288], + "endbeat": [284,0,288], + "index": 3, + "endindex": 15 + }, + { + "beat": [283,0,288], + "endbeat": [284,0,288], + "index": 12, + "endindex": 0 + }, + { + "beat": [284,0,288], + "index": 4 + }, + { + "beat": [284,0,288], + "index": 11 + }, + { + "beat": [284,144,288], + "index": 2 + }, + { + "beat": [284,144,288], + "index": 13 + }, + { + "beat": [285,0,288], + "endbeat": [285,144,288], + "index": 7, + "endindex": 5 + }, + { + "beat": [285,144,288], + "endbeat": [286,0,288], + "index": 8, + "endindex": 0 + }, + { + "beat": [286,0,288], + "endbeat": [286,144,288], + "index": 15, + "endindex": 13 + }, + { + "beat": [286,144,288], + "index": 0 + }, + { + "beat": [287,0,288], + "index": 3 + }, + { + "beat": [287,0,288], + "index": 12 + }, + { + "beat": [287,216,288], + "index": 2 + }, + { + "beat": [287,216,288], + "index": 13 + }, + { + "beat": [288,2,4], + "index": 1 + }, + { + "beat": [288,2,4], + "index": 14 + }, + { + "beat": [289,0,288], + "index": 8 + }, + { + "beat": [289,144,288], + "index": 9 + }, + { + "beat": [290,0,288], + "index": 7 + }, + { + "beat": [290,144,288], + "index": 6 + }, + { + "beat": [291,0,288], + "endbeat": [291,144,288], + "index": 12, + "endindex": 8 + }, + { + "beat": [291,144,288], + "endbeat": [292,0,288], + "index": 4, + "endindex": 8 + }, + { + "beat": [292,0,288], + "endbeat": [292,144,288], + "index": 13, + "endindex": 9 + }, + { + "beat": [292,144,288], + "endbeat": [293,0,288], + "index": 5, + "endindex": 9 + }, + { + "beat": [293,0,4], + "index": 10 + }, + { + "beat": [0,0,1], + "sound": "item.ogg", + "vol": 100, + "offset": 292, + "type": 1 + } + ], + "extra": { + "test": { + "divide": 4, + "speed": 100, + "save": 0, + "lock": 0, + "edit_mode": 0 + } + } +} \ No newline at end of file diff --git a/jubeatools/formats/malody/tests/data/__init__.py b/jubeatools/formats/malody/tests/data/__init__.py new file mode 100644 index 0000000..de5849e --- /dev/null +++ b/jubeatools/formats/malody/tests/data/__init__.py @@ -0,0 +1,2 @@ +"""This file is here so the test code can use importlib as a portable way to +open test data in this folder""" diff --git a/jubeatools/formats/malody/tests/test_examples.py b/jubeatools/formats/malody/tests/test_examples.py new file mode 100644 index 0000000..67f14cf --- /dev/null +++ b/jubeatools/formats/malody/tests/test_examples.py @@ -0,0 +1,19 @@ +from importlib import resources + +from jubeatools.formats import LOADERS +from jubeatools.formats.guess import guess_format + +from . import data + + +def try_to_load(example_file: str) -> None: + with resources.path(data, example_file) as p: + format_ = guess_format(p) + loader = LOADERS[format_] + _ = loader(p) + + +def test_MilK() -> None: + """An actual malody chart will have may keys unspecified in the marshmallow + schema, these should be ignored""" + try_to_load("1533908574.mc") diff --git a/jubeatools/formats/malody/test_malody.py b/jubeatools/formats/malody/tests/test_malody.py similarity index 100% rename from jubeatools/formats/malody/test_malody.py rename to jubeatools/formats/malody/tests/test_malody.py