1
0
mirror of synced 2024-11-24 05:30:11 +01:00
Convert TJA charts into fumen (.bin) files
Go to file
Viv 57edc7aecf Simplify how #BPMCHANGEs adjust the fumenOffset
Before:

- If there was a #BPMCHANGE, tana's adjustment would be applied to _the current measure's duration_. This would result in very strange looking, impossible durations (e.g. negative)
- Additionally, this method required us to look ahead to the _next_ measure to determine the adjustment.
- Finally, it required us to keep track of two different durations: measureDurationBase (unadjusted) and measureDuration (adjusted)

After:

- Instead, we now leave the measureDuration as purely as "unadjusted".
- Then, we apply the "BPMCHANGE adjustment" _only_ when computing the fumenOffset start of the next measure.
- This requires us to keep track of both the start *and* end fumenOffset (where end = start + duration)
- However, this greatly simplifies and clarifies the code, since we:
  - No longer need to "look ahead" to the next measure to compute the offset adjustment.
  - No longer need to keep track of two different measureDurations (adjusted/unadjusted)
  - Only need to work with a single pair of measures at a time (measureFumen, measureFumenPrev)
  - The measure duration (and fumenOffsetEnd) times are now more comprehensible, since any negative offsets are only applied to the fumenOffsetStart value of the next measure.

After:
2023-07-09 15:51:04 -04:00
.github/workflows test_and_publish_release.yml: Use -e for first test 2023-06-29 20:35:37 -04:00
src/tja2fumen Simplify how #BPMCHANGEs adjust the fumenOffset 2023-07-09 15:51:04 -04:00
testing Simplify how #BPMCHANGEs adjust the fumenOffset 2023-07-09 15:51:04 -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 README.md: Update for 0.0.1 release. 2023-06-04 15:27:01 -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 games that allows you to convert TJA files (.tja) to fumen files (.bin).

This project attempts to replace/complement the existing closed-source tja2bin.exe converter packaged alongside TakoTako.

Goals

  • Act as a drop-in replacement for tja2bin.exe in TakoTako.
  • Fix https://github.com/Fluto/TakoTako/issues/16. (The original tjabin.exe doesn't properly handle #BPMCHANGE commands.)
  • Provide open source code to act as a reference for parsing and writing both the TJA and Fumen file formats.
  • Stick to the Python stdlib, i.e. no external dependencies if possible.

Usage

Option 1: Standalone Python installation

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

pip install tja2fumen

Then, you can convert a TJA file by running:

tja2fumen file.tja

Option 2: Using with TakoTako

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

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.