1
0
mirror of synced 2024-12-02 18:27:17 +01:00

[memo2] friendlier error messages for bpp=2 mistakes

This commit is contained in:
Stepland 2022-09-05 17:24:56 +02:00
parent 9a51a2a1b2
commit e76eef79e8
7 changed files with 646 additions and 17 deletions

View File

@ -1,5 +1,7 @@
# v1.4.1
## Changed
- [memo2] The parser now displays much friendlier error messages when
it finds uneven byte lengths in `#bpp=2` mode
- Minimum required Python version is now 3.9
## Fixed
- A fresh install of jubeatools would fail because of a API break in a

View File

@ -17,7 +17,7 @@ Sanity checks before anything serious happens, from the repo's root :
Now that this is done you can move on to actually making a new version,
while still being in the repo's root :
1. Update `CHANGELOG.md`
1. Update `CHANGELOG.md` (I like to follow this changelog style: https://keepachangelog.com/en/1.0.0/)
1. Update `README.md` if you've just added support for a new format
1. Commit everything you want in the new release
1. Run the script <br> `$ poetry run python utils/bump_version.py {rule}`

View File

@ -385,7 +385,7 @@ class JubeatAnalyserParser:
elif self.circle_free and bpp == 1:
raise ValueError("Can't set #bpp to 1 when #circlefree is on")
else:
self.bytes_per_panel = int(value)
self.bytes_per_panel = bpp
def do_holdbyarrow(self, value: str) -> None:
self.hold_by_arrow = int(value) == 1

View File

@ -1,3 +1,4 @@
import textwrap
from dataclasses import astuple, dataclass
from decimal import Decimal
from itertools import product, zip_longest
@ -63,6 +64,10 @@ class BPM:
Event = Union[NoteCluster, Stop, BPM]
def dump_timing_part(events: List[Event]) -> str:
return f"|{''.join(e.dump() for e in events)}|"
@dataclass
class RawMemo2ChartLine:
position: str
@ -70,7 +75,7 @@ class RawMemo2ChartLine:
def __str__(self) -> str:
if self.timing:
return f"{self.position} |{''.join(e.dump() for e in self.timing)}|"
return f"{self.position} {dump_timing_part(self.timing)}"
else:
return self.position
@ -169,6 +174,16 @@ class Memo2Frame:
return "\n".join(res)
CHARACTER_WIDTH_HELP = textwrap.dedent(
"""
Make sure the file is :
- truly encoded as Shift-JIS
- not missusing half-width characters instead of full-width ones
- only using half-width characters in pairs
"""
).strip()
class Memo2Parser(JubeatAnalyserParser):
FORMAT_TAG = "#memo2"
@ -212,22 +227,53 @@ class Memo2Parser(JubeatAnalyserParser):
self._do_bpp(value)
def append_chart_line(self, raw_line: RawMemo2ChartLine) -> None:
if (
len(raw_line.position.encode("shift-jis-2004", errors="surrogateescape"))
!= 4 * self.bytes_per_panel
):
raise SyntaxError(
f"Invalid chart line for #bpp={self.bytes_per_panel} : {raw_line}"
)
position_length = len(
raw_line.position.encode("shift-jis-2004", errors="surrogateescape")
)
expected_position_length = 4 * self.bytes_per_panel
if position_length != expected_position_length:
message = [
textwrap.dedent(
f"""
The position part of this chart line :
{raw_line.position}
should be {expected_position_length} bytes long (4 × #bpp value) but it is {position_length}
"""
).strip()
]
message.append(CHARACTER_WIDTH_HELP)
raise SyntaxError("\n".join(message))
if raw_line.timing is not None and self.bytes_per_panel == 2:
if any(
len(e.string.encode("shift-jis-2004", errors="surrogateescape")) % 2
!= 0
for e in raw_line.timing
if isinstance(e, NoteCluster)
for note_cluster in (
elem for elem in raw_line.timing if isinstance(elem, NoteCluster)
):
raise SyntaxError(f"Invalid chart line for #bpp=2 : {raw_line}")
length = len(
note_cluster.string.encode(
"shift-jis-2004", errors="surrogateescape"
)
)
if length % 2 != 0:
timing_part = dump_timing_part(raw_line.timing)
message = [
textwrap.dedent(
f"""
The timing part of this chart line :
{timing_part}
contains the following {length} bytes long series of notes :
{note_cluster.string}
Series of notes of odd byte lengths should not happen in files that use #bpp=2
"""
).strip()
]
message.append(CHARACTER_WIDTH_HELP)
raise SyntaxError("\n".join(message))
if not raw_line.timing:
line = Memo2ChartLine(raw_line.position, None)

View File

@ -0,0 +1,571 @@
#memo2
#circlefree=1
#holdbyarrow=1
t=150
// 1
<EFBFBD> <EFBFBD> <EFBFBD> ‡A |----|
<EFBFBD> <EFBFBD> ‡B<EFBFBD>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |--‡@-|
‡@<40> <EFBFBD> <EFBFBD>  |‡A-‡B-|
2
‡F‡C‡C<EFBFBD>  |‡@-‡A-|
<EFBFBD> ‡G<EFBFBD> <EFBFBD>  |‡B-‡C-|
<EFBFBD> ‡@‡B‡@ |‡D-‡E-|
‡D<EFBFBD> ‡A‡E |‡F-‡G-|
3
‡E‡C‡C‡F |‡@-‡A-|
<EFBFBD> ‡F‡F<EFBFBD>  |‡B-‡C-|
‡@‡B‡@<40>  |‡D-‡E-|
<EFBFBD> ‡A<EFBFBD> ‡D |‡F---|
4
‡C‡D<EFBFBD> <EFBFBD>  |‡@-‡A-|
‡E<EFBFBD> <EFBFBD> <EFBFBD>  |‡B-‡C‡D|
<EFBFBD> ‡@‡@‡B |‡E-‡F-|
‡@<40> ‡A<E280A1>  |‡G---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡G<EFBFBD> 
<EFBFBD> ‡G<EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> ‡F
5
<EFBFBD> ‡C<EFBFBD> <EFBFBD>  |‡@-‡A-|
‡C‡@<40> <EFBFBD>  |‡B-‡C-|
<EFBFBD> <EFBFBD> ‡@‡B |--‡D-|
‡A<EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F-|
<EFBFBD> <EFBFBD> <EFBFBD> ‡E
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡D‡F<EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
6
‡F‡G‡C‡E |‡@-‡A-|
<EFBFBD> ‡@‡@‡C |‡B-‡C-|
‡D‡E‡F‡G |‡D-‡E-|
‡@‡A‡B‡C |‡F-‡G-|
7
<EFBFBD> ‡F‡C‡F |‡@-‡A-|
<EFBFBD> ‡@‡@‡C |‡B-‡C-|
‡D‡E‡F<EFBFBD>  |‡D-‡E-|
‡@‡A‡B‡C |‡F---|
8
‡C‡D‡E<EFBFBD>  |‡@-‡A-|
‡@<40> ‡@<40>  |‡B-‡C‡D|
‡E<EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F-|
‡@‡A‡B‡C |‡G-‡H-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡G‡G<EFBFBD> 
<EFBFBD> ‡F‡G‡H
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
9
<EFBFBD> <EFBFBD> <EFBFBD> ‡@ |‡@-‡A-|
<EFBFBD> <EFBFBD> <EFBFBD> ‡@ |‡B-‡C-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
‡@‡A‡B<E280A1>  |----|
‡C<EFBFBD> <EFBFBD> <
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> ‡C
10
1<EFBFBD> <EFBFBD> <EFBFBD>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@---|
11
><3E> <EFBFBD> ‡@ |‡@--‡A|
<EFBFBD> ‡A‡@<40>  |--‡B-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡C‡D--|
‡B‡@‡A<E280A1>  |‡E---|
<EFBFBD> ‡E<EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡D‡C<EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
12
<EFBFBD> <EFBFBD> <EFBFBD> 1 |‡@--‡A|
‡@<40> <‡A |--‡B-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡C‡D--|
<EFBFBD> ‡@‡A‡B |‡E-‡F-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
4‡C‡D<EFBFBD> 
<EFBFBD> ><3E> ‡C
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡E<EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡F<EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
13
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@--‡A|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |--‡B-|
<EFBFBD> <EFBFBD> <EFBFBD> 1 |‡C‡D--|
‡@<40> <EFBFBD> < |‡E---|
<EFBFBD> ‡E<EFBFBD> ‡A
<EFBFBD> ‡C‡D<EFBFBD> 
<EFBFBD> <EFBFBD> ‡B<EFBFBD> 
<EFBFBD> <EFBFBD> ‡@<40> 
14
<EFBFBD> <EFBFBD> <EFBFBD> ‡A |‡@--‡A|
‡@<40> <EFBFBD> < |--‡B-|
<EFBFBD> ‡B<EFBFBD> <EFBFBD>  |‡C‡D--|
1<EFBFBD> ‡@<40>  |‡E---|
<EFBFBD> ‡D‡C<EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
15
><3E> <EFBFBD> ‡@ |‡@--‡A|
1<EFBFBD> ‡A<EFBFBD>  |--‡B-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡C‡D--|
‡B‡@<40> <EFBFBD>  |‡E---|
<EFBFBD> ‡E<EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡D‡C<EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
16
<EFBFBD> <EFBFBD> ‡B1 |‡@--‡A|
‡@<40> <<3C>  |--‡B-|
<EFBFBD> <EFBFBD> ‡A<EFBFBD>  |‡C‡D--|
<EFBFBD> ‡@‡A<E280A1>  |‡E‡F‡G-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
4‡C‡D<EFBFBD> 
<EFBFBD> ><3E> ‡C
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡E<EFBFBD> <EFBFBD> 
<EFBFBD> ><3E> ‡F
<EFBFBD> ‡G<EFBFBD> 6
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
17
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@--‡A|
<EFBFBD> <EFBFBD> <EFBFBD> 1 |--‡B-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡C‡D--|
‡@<40> <EFBFBD> < |‡E---|
<EFBFBD> ‡E<EFBFBD> ‡A
<EFBFBD> ‡C‡D<EFBFBD> 
<EFBFBD> <EFBFBD> ‡B<EFBFBD> 
<EFBFBD> <EFBFBD> ‡@<40> 
18
<EFBFBD> <EFBFBD> ‡A<EFBFBD>É |‡@--‡A|
‡@‡D‡C<E280A1>  |--‡B-|
<EFBFBD> ‡B<EFBFBD> <EFBFBD>  |‡C‡D--|
1<EFBFBD> ‡E‡@ |‡E---|
19
‡@‡@‡F‡A |‡@-‡A‡B|
‡H‡D<EFBFBD> ‡G |-‡C‡D-|
<EFBFBD> ‡I‡C<EFBFBD>  |--‡E-|
‡B‡E<EFBFBD> 1 |‡F‡G‡H‡I|
20
‡A‡F‡F‡D |‡@-‡A‡B|
<EFBFBD> ‡E‡E<EFBFBD>  |-‡C‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡E---|
<EFBFBD> ‡C‡B‡@ |‡F---|
21
‡A<EFBFBD> <EFBFBD> <EFBFBD>  |‡@-‡A‡B|
<EFBFBD> <EFBFBD> ‡D<EFBFBD>  |-‡C‡D-|
<EFBFBD> ‡C‡@‡@ |--‡E-|
<EFBFBD> <EFBFBD> <EFBFBD> ‡B |‡F‡G‡H‡I|
<EFBFBD> ‡F<EFBFBD> <EFBFBD> 
‡G<EFBFBD> <EFBFBD> ‡H
<EFBFBD> <EFBFBD> ‡I<EFBFBD> 
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
22
‡D‡H‡G‡A |‡@-‡A‡B|
<EFBFBD> ‡F‡E<EFBFBD>  |-‡C‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F-|
‡@‡B‡C<E280A1>  |‡G-‡H-|
23
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@-‡A‡B|
‡C‡D<EFBFBD> <EFBFBD>  |-‡C‡D-|
<EFBFBD> ‡D<EFBFBD> ‡@ |-‡E-‡F|
‡A‡B<EFBFBD> ‡@ |‡G--‡H|
<EFBFBD> <EFBFBD> <EFBFBD> ‡E
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡G‡F
‡H<EFBFBD> ‡G<EFBFBD> 
24
‡A‡B‡@‡E |‡@-‡A‡B|
<EFBFBD> <EFBFBD> ‡@‡E |‡C‡D‡E-|
‡C‡D‡F<EFBFBD>  |‡F---|
<EFBFBD> <EFBFBD> ‡F<EFBFBD>  |‡G-‡H‡I|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
‡G<EFBFBD> ‡I<EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> ‡H
‡G<EFBFBD> <EFBFBD> <EFBFBD> 
25
‡@‡@‡@<40>  |‡@-‡A‡B|
<EFBFBD> <EFBFBD> <EFBFBD> ‡C |‡C-‡D-|
‡D<EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F‡G|
<EFBFBD> ‡B‡D‡A |‡H-‡I-|
<EFBFBD> ‡G<EFBFBD> ‡E
<EFBFBD> <EFBFBD> ‡H<EFBFBD> 
<EFBFBD> ‡E‡I‡F
‡E‡I<EFBFBD> <EFBFBD> 
26
‡@<40> ‡@<40>  |‡@-‡A‡B|
‡D‡@<40> ‡C |‡C-‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F‡G|
‡B<EFBFBD> ‡D‡A |‡H-‡I-|
‡I‡E‡H‡I
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
‡E<EFBFBD> <EFBFBD> ‡F
<EFBFBD> ‡G<EFBFBD> <EFBFBD> 
27
<EFBFBD> ‡B<EFBFBD> <EFBFBD>  |‡@-‡A‡B|
<EFBFBD> <EFBFBD> ‡C<EFBFBD>  |‡C-‡D-|
<EFBFBD> ‡@‡@<40>  |‡E-‡F‡G|
‡@‡D<E280A1> ‡A |‡H-‡I-|
<EFBFBD> <EFBFBD> ‡I<EFBFBD> 
<EFBFBD> ‡E<EFBFBD> ‡H
‡E‡G<EFBFBD> ‡E
‡I<EFBFBD> ‡F<EFBFBD> 
28
‡@‡B<E280A1> ‡D |‡@-‡A‡B|
‡@<40> ‡C<E280A1>  |‡C-‡D-|
<EFBFBD> <EFBFBD> ‡@<40>  |‡E-‡F‡G|
<EFBFBD> ‡D<EFBFBD> ‡A |‡H-‡I-|
‡I<EFBFBD> <EFBFBD> <EFBFBD> 
‡I‡E<EFBFBD> ‡E
‡E‡G‡H‡E
‡G<EFBFBD> ‡F<EFBFBD> 
29
<EFBFBD> ‡@‡@<40>  |‡@-‡A‡B|
<EFBFBD> <EFBFBD> <EFBFBD> ‡C |‡C-‡D-|
‡D<EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F‡G|
<EFBFBD> ‡B‡D‡A |‡H-‡I-|
<EFBFBD> ‡G<EFBFBD> ‡E
<EFBFBD> <EFBFBD> ‡H<EFBFBD> 
<EFBFBD> ‡E‡I‡F
‡E‡I<EFBFBD> <EFBFBD> 
30
‡@<40> ‡@<40>  |‡@-‡A‡B|
‡D‡@<40> ‡C |‡C-‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F‡G|
‡B<EFBFBD> ‡D‡A |‡H-‡I-|
‡I‡E‡H‡I
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
‡E<EFBFBD> <EFBFBD> ‡F
<EFBFBD> ‡G<EFBFBD> <EFBFBD> 
31
<EFBFBD> ‡B<EFBFBD> <EFBFBD>  |‡@-‡A‡B|
<EFBFBD> <EFBFBD> ‡C<EFBFBD>  |‡C-‡D-|
<EFBFBD> ‡@‡@<40>  |‡E-‡F‡G|
‡@‡D<E280A1> ‡A |‡H-‡I-|
<EFBFBD> <EFBFBD> ‡I<EFBFBD> 
<EFBFBD> ‡E<EFBFBD> ‡H
‡E‡G<EFBFBD> ‡E
‡I<EFBFBD> ‡F<EFBFBD> 
32
‡@‡B<E280A1> ‡D |‡@-‡A‡B|
‡@<40> ‡C<E280A1>  |‡C-‡D-|
<EFBFBD> <EFBFBD> ‡@<40>  |‡E-‡F‡G|
<EFBFBD> ‡D<EFBFBD> ‡A |‡H-‡I-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
‡I‡E<EFBFBD> ‡I
‡E‡G‡H‡E
‡G<EFBFBD> ‡F<EFBFBD> 
33
‡@<40> ‡@<40>  |‡@-‡A‡B|
<EFBFBD> ‡D‡B<EFBFBD>  |-‡C‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡E‡F‡G‡H|
<EFBFBD> <EFBFBD> ‡C‡A |‡I‡J‡K‡L|
<EFBFBD> ‡H<EFBFBD> ‡I
‡J<EFBFBD> <EFBFBD> <EFBFBD> 
‡G<EFBFBD> ‡E‡K
‡L‡F<EFBFBD> <EFBFBD> 
34
‡B‡D‡@<40>  |‡@-‡A‡B|
<EFBFBD> <EFBFBD> <EFBFBD> ‡@ |-‡C‡D-|
<EFBFBD> ‡A‡C<EFBFBD>  |‡E‡F‡G‡H|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡I‡J‡K‡L|
<EFBFBD> <EFBFBD> ‡H<EFBFBD> 
<EFBFBD> ‡E<EFBFBD> <EFBFBD> 
‡K‡L<EFBFBD> ‡G
‡I‡J‡F<EFBFBD> 
35
<EFBFBD> <EFBFBD> <EFBFBD> ‡@ |‡@-‡A‡B|
<EFBFBD> ‡D‡B‡@ |-‡C‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡E‡F‡G‡H|
<EFBFBD> <EFBFBD> ‡C‡A |‡I‡J‡K‡L|
‡J‡F<EFBFBD> ‡I
‡E<EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡G<EFBFBD> 
‡L‡H<EFBFBD> ‡K
36
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@-‡A‡B|
<EFBFBD> ‡B‡D‡@ |-‡C‡D-|
‡A‡C<EFBFBD> ‡@ |‡E‡F‡G‡H|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡I‡J‡K‡L|
‡F<EFBFBD> <EFBFBD> ‡E
‡L‡K<EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡J‡I
‡H<EFBFBD> ‡G<EFBFBD> 
37
<EFBFBD> ‡@‡@<40>  |‡@-‡A‡B|
<EFBFBD> <EFBFBD> <EFBFBD> ‡C |‡C-‡D-|
‡D<EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F‡G|
<EFBFBD> ‡B‡D‡A |‡H-‡I-|
<EFBFBD> ‡G<EFBFBD> ‡E
<EFBFBD> <EFBFBD> ‡H<EFBFBD> 
<EFBFBD> ‡E‡I‡F
‡E‡I<EFBFBD> <EFBFBD> 
38
‡@<40> ‡@<40>  |‡@-‡A‡B|
‡D‡@<40> ‡C |‡C-‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡E-‡F‡G|
‡B<EFBFBD> ‡D‡A |‡H-‡I-|
‡I‡E‡H‡I
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
‡E<EFBFBD> <EFBFBD> ‡F
<EFBFBD> ‡G<EFBFBD> <EFBFBD> 
39
<EFBFBD> ‡B<EFBFBD> <EFBFBD>  |‡@-‡A‡B|
<EFBFBD> <EFBFBD> ‡C<EFBFBD>  |‡C-‡D-|
<EFBFBD> ‡@‡@<40>  |‡E-‡F‡G|
‡@‡D<E280A1> ‡A |‡H-‡I-|
<EFBFBD> <EFBFBD> ‡I<EFBFBD> 
<EFBFBD> ‡E<EFBFBD> ‡H
‡E‡G<EFBFBD> ‡E
‡I<EFBFBD> ‡F<EFBFBD> 
40
‡@‡B‡F<E280A1>  |‡@-‡A‡B|
‡@‡E‡C<E280A1>  |‡C-‡D-|
<EFBFBD> ‡E‡@<40>  |‡E-‡F-|
<EFBFBD> ‡D‡D‡A |‡G‡H‡I‡J‡K‡L‡M‡N|
‡G<EFBFBD> <EFBFBD> ‡K
‡H<EFBFBD> <EFBFBD> ‡L
‡I<EFBFBD> <EFBFBD> ‡M
‡J<EFBFBD> <EFBFBD> ‡N
41
<EFBFBD> ‡@<40> <EFBFBD>  |‡@---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡A-‡B-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |--‡C-|
<EFBFBD> <EFBFBD>È<EFBFBD> <EFBFBD>  |--‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡B‡D
<EFBFBD> ‡C‡C‡D
<EFBFBD> <EFBFBD> ‡A<EFBFBD> 
42
<EFBFBD> 1<EFBFBD>É<EFBFBD>  |‡@---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡A---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡B---|
<EFBFBD> <EFBFBD> ‡@<40>  |‡C---|
‡A<EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡B‡C<EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
43
‡@<40> ‡A<E280A1>  |‡@---|
<EFBFBD> <EFBFBD> ‡C<EFBFBD>  |--‡A-|
<EFBFBD> ‡B<EFBFBD> ‡@ |--‡B-|
<EFBFBD>È<EFBFBD> 1<EFBFBD>  |--‡C-|
44
1<EFBFBD> <EFBFBD> <EFBFBD>É |‡@---|
<EFBFBD> ‡C‡C<EFBFBD>  |‡A---|
<EFBFBD> ‡B‡B<EFBFBD>  |‡B---|
<EFBFBD> ‡A‡A‡@ |‡C---|
45
<EFBFBD> ‡@‡@‡A |‡@---|
‡@<40> <EFBFBD> < |--‡A-|
<EFBFBD> ‡B<EFBFBD> <EFBFBD>  |--‡B-|
<EFBFBD> <EFBFBD> <EFBFBD> 1 |----|
46
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@-‡A-|
1<EFBFBD> <EFBFBD> <EFBFBD>  |‡B-‡C-|
><3E> <EFBFBD> ‡@ |--‡D-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
<EFBFBD> ‡D<EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
‡C<EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡B‡A<EFBFBD> 
47
<EFBFBD> <EFBFBD> ‡B‡A |‡@---|
<EFBFBD> <EFBFBD> ‡A‡B |--‡A-|
<EFBFBD> <EFBFBD> ‡@1 |--‡B-|
‡@<40> <EFBFBD> < |----|
48
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
1<EFBFBD> <EFBFBD> ‡@ |----|
49
‡C<EFBFBD> ‡E‡A |----|
‡D<EFBFBD> ‡B‡F |‡@-‡A‡B|
<EFBFBD> ‡C<EFBFBD> <EFBFBD>  |‡C---|
‡@<40> ‡D‡@ |‡D-‡E‡F|
50
‡C<EFBFBD> <EFBFBD> ‡C |‡@---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡A-‡B-|
‡@‡B‡@‡C |‡C--‡D|
‡A<EFBFBD> <EFBFBD> ‡A |‡E-‡F-|
<EFBFBD> <EFBFBD> ‡F<EFBFBD> 
‡E‡F<EFBFBD> ‡D
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
51
‡D‡@<40> ‡B |‡@---|
<EFBFBD> <EFBFBD> ‡@‡C |‡A-‡B‡C|
‡@<40> ‡D<E280A1>  |‡D---|
‡A<EFBFBD> <EFBFBD> ‡A |‡E-‡F‡G|
<EFBFBD> <EFBFBD> ‡F<EFBFBD> 
‡E<EFBFBD> ‡G<EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
52
‡B<EFBFBD> <EFBFBD> ‡B |‡@---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡A---|
‡@<40> <EFBFBD> ‡@ |‡B-‡C‡D|
‡A<EFBFBD> <EFBFBD> ‡A |‡E-‡F-|
<EFBFBD> <EFBFBD> ‡F<EFBFBD> 
‡E<EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡C‡D‡F
<EFBFBD> ‡E<EFBFBD> <EFBFBD> 
53
‡D<EFBFBD> <EFBFBD> ‡B |‡@---|
<EFBFBD> ‡@‡C‡@ |‡A-‡B‡C|
‡@‡D<E280A1> <EFBFBD>  |‡D---|
‡A<EFBFBD> <EFBFBD> ‡A |‡E-‡F‡G|
<EFBFBD> <EFBFBD> ‡F<EFBFBD> 
‡E<EFBFBD> <EFBFBD> ‡G
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
54
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡A-‡B-|
‡@‡B‡@<40>  |‡C--‡D|
‡A<EFBFBD> <EFBFBD> ‡A |‡E-‡F-|
‡C<EFBFBD> ‡D<EFBFBD> 
‡E‡E‡C‡F
<EFBFBD> <EFBFBD> <EFBFBD> ‡C
<EFBFBD> <EFBFBD> ‡F<EFBFBD> 
55
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡@---|
<EFBFBD> <EFBFBD> ‡B<EFBFBD>  |‡A-‡B-|
‡@<40> ‡@<40>  |‡C-‡D‡E|
‡A‡A<EFBFBD> ‡@ |--‡F-|
‡C<EFBFBD> <EFBFBD> ‡E
‡F‡D<EFBFBD> <EFBFBD> 
‡E‡C<EFBFBD> ‡C
<EFBFBD> <EFBFBD> <EFBFBD> ‡F
56
‡F‡B‡C‡E |‡@-‡A‡B|
<EFBFBD> ‡D‡A<EFBFBD>  |‡C-‡D‡E|
<EFBFBD> ‡F‡C‡F |‡F-‡G‡H|
‡C‡@‡@<40>  |‡I‡J‡K-|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
‡I<EFBFBD> ‡J‡G
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡K‡H<EFBFBD> 
57
‡H‡@‡@‡D |‡@-‡A‡B|
<EFBFBD> ‡A<EFBFBD> ‡E |‡C---‡D‡E‡F‡G|
‡@‡H‡B‡F |‡H---|
‡C<EFBFBD> <EFBFBD> ‡G |‡I-‡J‡K|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡J<EFBFBD> 
‡I<EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> ‡K<EFBFBD> <EFBFBD> 
58
‡F‡@‡@<40>  |‡@---|
‡D‡B‡G‡E |‡A-‡B‡C|
‡H‡F‡A<EFBFBD>  |‡D-‡E‡F|
‡D‡H‡C<EFBFBD>  |-‡G‡H-|
59
<EFBFBD> ‡D‡@<40>  |‡@---|
<EFBFBD> ‡B‡F‡C |‡A-‡B‡C|
<EFBFBD> ‡G‡D‡@ |‡D---|
‡A‡E‡E‡A |‡E-‡F‡G|
60
‡D<EFBFBD> ‡@<40>  |‡@---|
<EFBFBD> ‡B<EFBFBD> <EFBFBD>  |‡A-‡B‡C|
‡D<EFBFBD> ‡C‡@ |‡D-‡E‡F|
‡A<EFBFBD> <EFBFBD> ‡A |-‡G‡H-|
<EFBFBD> ‡H<EFBFBD> <EFBFBD> 
‡H<EFBFBD> <EFBFBD> ‡E
<EFBFBD> ‡F<EFBFBD> ‡G
<EFBFBD> ‡F<EFBFBD> <EFBFBD> 
61
‡D<EFBFBD> ‡@‡B |‡@---|
<EFBFBD> <EFBFBD> ‡C<EFBFBD>  |‡A-‡B‡C|
<EFBFBD> ‡D<EFBFBD> <EFBFBD>  |‡D---|
‡A<EFBFBD> ‡@‡A |‡E-‡F‡G|
<EFBFBD> <EFBFBD> ‡F<EFBFBD> 
‡E<EFBFBD> <EFBFBD> ‡G
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> ‡E<EFBFBD> 
62
‡C<EFBFBD> ‡D<EFBFBD>  |‡@---|
‡E‡E‡C‡F |‡A-‡B-|
‡@‡B‡@‡C |‡C--‡D|
‡A<EFBFBD> ‡F‡A |‡E-‡F-|
63
‡C<EFBFBD> <EFBFBD> <EFBFBD>  |‡@---|
<EFBFBD> <EFBFBD> ‡B<EFBFBD>  |‡A-‡B-|
‡@‡C‡@‡C |‡C--‡D|
‡A‡A<EFBFBD> ‡@ |‡E-‡F-|
<EFBFBD> ‡F<EFBFBD> ‡D
‡E‡D<EFBFBD> ‡F
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 
64
<EFBFBD> <EFBFBD> ‡A<EFBFBD>  |‡@---|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |‡A---|
‡@<40> ‡A<E280A1>  |‡B-‡C‡D|
‡A‡@‡@<40>  |-‡E‡F-|
‡B‡C<EFBFBD> ‡D
‡B<EFBFBD> ‡F‡D
‡E‡C<EFBFBD> ‡B
<EFBFBD> ‡E‡F‡B
65
<EFBFBD> <EFBFBD> ‡@<40>  |‡@---|
<EFBFBD> ‡@<40> <EFBFBD>  |----|
<EFBFBD> <EFBFBD> ‡@<40>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
66
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>  |----|

View File

@ -40,3 +40,11 @@ def test_MTC_Nageki_no_Ki_EXT() -> None:
def test_MTC_Mimi_EXT() -> None:
"""Also an euc-kr file but also has long notes"""
try_to_load("MTC_Mimi_EXT.txt")
def test_beat_1() -> None:
"""This file uses #bpp=2 with half-width hyphens in the timing part, this
is bound to fail on the first line that has an odd length when encoded
to shift-jis, for now I just want to display a friendlier error message"""
with pytest.raises(SyntaxError, match="Series of notes of odd byte lengths"):
try_to_load("beat(1).txt")

View File

@ -73,7 +73,7 @@ def test_memon_0_2_0(song: song.Song) -> None:
@st.composite
def memon_0_3_0_compatible_song(draw: st.DrawFn) -> song.Song:
return draw(
random_song: song.Song = draw(
jbst.song(
diffs_strat=memon_diffs(),
chart_strat=jbst.chart(timing_strat=st.none()),
@ -81,6 +81,8 @@ def memon_0_3_0_compatible_song(draw: st.DrawFn) -> song.Song:
)
)
return random_song
@given(memon_0_3_0_compatible_song())
def test_memon_0_3_0(song: song.Song) -> None: