1
0
mirror of synced 2024-12-18 05:45:51 +01:00
Convert TJA charts into fumen (.bin) files
Go to file
Viv 2a6d1c3df5
Overhaul header metadata code with new FumenHeader Python class (plus use ints, not bytes) (#45)
Previously, I had to reverse engineer many of the bytes in a valid fumen
header. This meant that I was often working with literal byte values, as
well as guessing at what things meant, calling them "padding" or
"unknown".

However, thanks to #44, I now have a TON of knowledge about the correct
purpose of each byte in the header. This lets me properly document each
value's purpose, and it also lets me parse 4-byte groups as ints, rather
than dealing with individual raw bytes.

In summary, the changes in this PR are:

- Create a new `FumenHeader` class with individual (correctly-named!)
attributes for each 4-byte integer.
- Parse and write the fumen header as one big 520-byte chunk, instead of
handling the header in smaller increments.
- Remove a bunch of dead lines of code that were hardcoding specific
byte values, and replace them with proper integer values.
- Vastly simplify the test for valid headers by removing checks against
individual bytes..

Necessary for #40.
Fixes #44.
2023-07-19 14:36:58 -04:00
.github/workflows test_and_publish_release.yml: Try making executable smaller 2023-07-10 00:01:29 -04:00
src/tja2fumen Overhaul header metadata code with new FumenHeader Python class (plus use ints, not bytes) (#45) 2023-07-19 14:36:58 -04:00
testing Overhaul header metadata code with new FumenHeader Python class (plus use ints, not bytes) (#45) 2023-07-19 14:36:58 -04:00
.gitignore .gitignore: Add __pycache__ 2023-06-29 02:02:23 -04:00
LICENSE.txt Add LICENSE.txt file 2023-06-04 12:37:36 -04:00
MANIFEST.in Make sure LUT .csv files are included in wheel/sdist 2023-06-27 19:35:45 -04:00
pyproject.toml Move dev dependencies from GHA to pyproject.toml 2023-06-29 02:01:38 -04:00
README.md Update README.md 2023-07-19 14:10:32 -04:00
setup.py setup.py: Add newline 2023-06-26 19:54:51 -04:00

tja2fumen

tja2fumen is a tool for Taiko no Tatsujin that allows you to convert TJA charts (.tja) to fumen charts (.bin).

Goals

  • Provide open source code to act as a reference for parsing and writing both the TJA and Fumen file formats.
  • Fix the existing issues with tja2bin.exe:

Usage

tja2fumen is included as part of several existing projects. So, you may be using tja2fumen already!

  • XB1/TDMX: TakoTako converts both chart and audio files for XB1/TDMX.
  • Nijiro: TaikoSoundEditor converts both chart and audio files for NIjiro.

→ Adding tja2fumen.exe to older TakoTako versions (3.2.0 and below)

Note

: Before adding tja2fumen to TakoTako, you may want to back up the original tja2bin.exe file, to make sure you can switch back to the old converter if necessary. The easiest way to do this is by renaming the existing file to tja2bin.exe.bak.

To use this converter with TakoTako, head to the Releases page and download the tja2fumen.exe file attached to the release. Then, rename tja2fumen.exe to tja2bin.exe, and place the file in the TakoTako plugin folder.

TakoTako's plugin folder is inside of the BepInEx folder, which will typically look something like:

C:\XboxGames\T Tablet\Content\BepInEx\plugins\com.fluto.takotako

→ Using tja2fumen directly

If you'd like to build a project on top of tja2fumen, you have several options:

1. Using the executable file (tja2fumen.exe)

Head to the Releases page, and download the tja2fumen.exe file attached to the release.

Then, you can convert a TJA file on the command line by running:

tja2fumen.exe file.tja

2. Using the tja2fumen Python package

If you're familiar with Python, you can install tja2fumen by running:

pip install tja2fumen

Then, you can convert a TJA file on the command line by running:

tja2fumen file.tja

Or, you can import the main function in your Python code, and convert TJA files this way instead:

from tja2fumen import main
main(argv=["file.tja"])

Reporting bugs

If you've found a .TJA file that tja2fumen converts incorrectly, please open a new issue on the tja2fumen repo.

It is especially important that you attach the song files to the issue. You can do this by adding the song files to a .zip (Select files -> Right click -> "Send to" -> "Compressed (zipped) folder"), and then uploading the .zip to the issue. This greatly helps me to reproduce and fix any issues.

Attribution

  • The fumen-parsing code in this project is based off of a modified copy of the readFumen() function from the fumen2osu.py found in @KatieFrogs' fumen-tools project.
  • The TJA-parsing code in this project is a Python translation of the parseTJA.js file from @WHMHammer's tja-tools.

Note

: To be explicily clear, neither @KatieFrogs nor @WHMHammer have endorsed this project, are affiliated with this project, or have made any direct contributions to this project. I have just modified their existing work.