1
0
mirror of synced 2024-12-18 05:45:51 +01:00
Commit Graph

284 Commits

Author SHA1 Message Date
Viv
3f981236e3 tests/: Add sorting for generated songs
This makes things nicer to debug, since we're following an expected order.
2023-06-29 15:40:05 -04:00
Viv
305b70eb27 tests/: Compare only the non-empty measures 2023-06-29 15:39:39 -04:00
Viv
0bef98c10d Stop hardcoding song['length']
Instead, rely on len(song['measures') as the single source of truth for measures
2023-06-29 15:19:51 -04:00
Viv
6286a3a78d Reorder test functions 2023-06-29 15:19:51 -04:00
Viv
73df48c70c Remove debugPrint-related funcs 2023-06-29 14:29:12 -04:00
Viv
af91e9fe47 tests: Import from src.tja2fumen
This will _actually_ perform an in-place test run, rather than importing from the installed package. This is necessary for PyCharm's coverage to ework correctly.
2023-06-29 14:10:25 -04:00
Viv
f7209de56c .gitignore: Add __pycache__ 2023-06-29 02:02:23 -04:00
Viv
c320d4248b Move dev dependencies from GHA to pyproject.toml 2023-06-29 02:01:38 -04:00
Viv
2f06ee433c Add raises=AssertionError to ia6cho xfail entry 2023-06-29 02:01:38 -04:00
Viv
52eae95161 Increase verbosity of test suite (-v -> -vv) 2023-06-29 02:01:38 -04:00
Viv
5a1d7c9aa3 Add ia6cho to test suite as XFAIL 2023-06-29 02:01:29 -04:00
vivaria
e528f48e1d
Adapt release workflow to also act as a test suite (#18) 2023-06-29 01:20:46 -04:00
Viv
1429b8f466 Make sure LUT .csv files are included in wheel/sdist 2023-06-27 19:35:45 -04:00
Viv
88031074a6 Rename test_songs -> test_conversion 2023-06-27 18:32:35 -04:00
Viv
4a2ee1cac0 create-release.yml: Add release workflow 2023-06-26 21:12:15 -04:00
Viv
99331eeeb8 __init__.py: Fix main to vary return variables
We want to return variables during testing, but not during CLI, or else they will be printed to stderr
2023-06-26 19:56:26 -04:00
Viv
07a617ab13 setup.py: Add newline 2023-06-26 19:54:51 -04:00
Viv
7b8097ef2e converters.py: Add missing barline setting 2023-06-26 19:11:04 -04:00
Viv
26b23ece19 Use LUT-based method for soul gauge bytes
The new CSV files are lookup tables generated using the following script:
https://github.com/vivaria/tja2fumen/issues/14#issuecomment-1606418746

Fixes #14.
2023-06-25 21:54:12 -04:00
Viv
c33cd4c7e7 .gitignore: Add .pytest_cache 2023-06-25 13:40:56 -04:00
Viv
a28a8da8da test_songs.py: Remove now-unnecessary header length check 2023-06-25 13:40:56 -04:00
Viv
f9760f46ce test_songs.py: Add strict case for TJA-converted headers 2023-06-25 13:40:56 -04:00
Viv
27b6dbe9d6 Move checkValidHeader into testing code 2023-06-25 13:40:56 -04:00
Viv
903410dd99 utils.py: Merge checkValidHeader and validateHeaderMetadata 2023-06-25 13:40:56 -04:00
Viv
6d8bfb97d5 utils.py: Remove now-unused checkMismatchedBytes func
This was initially used to validate the fumen writer to make sure it properly recreated the data from the fumen parser.

Any further byte-comparison will be done in a semantic way through pytest tests.
2023-06-25 13:40:56 -04:00
Viv
69af60e4e3 Improve readability of header processing code
- header -> headerPadding
- headerUnknown -> headerMetadata
- Add more thorough comments about the meaning of various header bytes
2023-06-25 13:40:56 -04:00
Viv
5899593024 Add notes about item byte in fumen files
See also: https://github.com/vivaria/tja2fumen/issues/17
2023-06-25 13:40:56 -04:00
Viv
52827f1abc Add support for #BARLINE commands
Fixes #3.

Necessary to get `mikdp` test to pass.
2023-06-25 13:40:56 -04:00
Viv
2e54975534 Add first tja-fumen pair (mikdp) to test 2023-06-25 13:40:56 -04:00
Viv
f2760d418b .gitignore: Allow tjas to be committed 2023-06-25 13:40:55 -04:00
Viv
c233dda574 converters.py: Fix bug with #GOGOEND parsing
bool('0') = True. We need to add `int()` so that bool(0) = False.
2023-06-25 12:16:27 -04:00
Viv
3b88104578 Add test to compare converted TJAs to fumens 2023-06-25 12:01:58 -04:00
Viv
2a24790d59 Clean up script I/O to make easier to call from tests 2023-06-25 01:00:08 -04:00
Viv
417bfe59eb pyproject.toml: Update for 0.0.1 release. 2023-06-04 15:27:19 -04:00
Viv
1abd86885e README.md: Update for 0.0.1 release. 2023-06-04 15:27:01 -04:00
Viv
654f67d6e2 Add * to .gitignore folders 2023-06-04 13:55:46 -04:00
Viv
58cafeb4f0 Make project pip-installable
Only local dev installs for now. PyPI will come later.
2023-06-04 12:51:07 -04:00
Viv
fed999164a Add LICENSE.txt file 2023-06-04 12:37:36 -04:00
Viv
a36849b4cc .gitignore: Add *.egg-ingo 2023-06-04 12:32:13 -04:00
Viv
2bfa3e8d31 Move main() from main.py into __init__.py 2023-06-04 12:31:42 -04:00
Viv
90f3d7902f main.py: Remove fumen-parsing code and make TJA mandatory
Fumen code was just for debugging purposes, and not necessary for TJA conversion.
2023-06-04 12:25:41 -04:00
Viv
5d50dcfa41 Switch to a src/ layout 2023-06-04 12:25:40 -04:00
Viv
2f95a8505b parsers.py: Handle STYLE to fix Ura conversion
Fixes #15.
2023-06-03 22:45:24 -04:00
Viv
41d18cf900 converters.py: Fixup comment 2023-06-03 20:40:07 -04:00
Viv
57e4198fe9 converters.py: Predefine variable to silence PyCharm warning 2023-06-03 20:34:58 -04:00
Viv
6d6985917e converters.py: Rename offset variables for clarity 2023-06-03 20:33:41 -04:00
Viv
e053e1ad7a converters.py: Rework the logic for measure offsets
To compute the first measure's offset, I currently subtract the first measure's duration from the TJA's OFFSET value.

However, I realized that you actually have to subtract the *second* measure's duration from the TJA offset value. (For 99% of songs, the first two measures will have the same duration, so that's why the bug slipped by.)

Fixes #4.
2023-06-03 20:32:50 -04:00
Viv
35ee48200f converters.py: Only subtract drumroll pos for single-measure drumroll
Commit 1953ffbc23 fixes one issue but introduced another:

 - Subtracting the drumrolls original position only makes sense if the drumroll starts and ends in the same measure.
 - If the drumroll spans multiple measures, though, then the original position is irrelevant, since we want to add the duration from the start of the next measure (i.e. pos=0).

 So, this commit makes sure to only subtract the position if the drumroll isn't a multi-measure drumroll.

 ((NB: This could probably be handled without using a new 'multimeasure' key, but I'm going to wait until the class refactor to tackle this.))

 Fixes #16.
2023-06-03 14:57:11 -04:00
Viv
1953ffbc23 converters.py: Fix drumroll duration bug
The duration calculation wasn't taking into account the starting position of the drumroll, so the drumrolls ended up with a duration that was way too long.

Fixes #1.
2023-06-03 13:28:20 -04:00
Viv
84056aef27 README.md: Stop using README as issue tracker
I will move the issues to GitHub.
2023-06-03 11:07:27 -04:00