1
0
mirror of synced 2024-12-18 21:55:54 +01:00
Commit Graph

187 Commits

Author SHA1 Message Date
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
Viv
4bf2072279 main.py: Don't append course ID if tja has only 1 course
This replicates the behavior of the original tja2bin.exe
2023-06-03 11:04:57 -04:00
Viv
77aa9598a0 main.py: Use more reliable method of fetching filename
The old method failed for files with no file extension.
2023-06-03 11:04:12 -04:00
Viv
b2353df58b Add .gitignore file 2023-06-03 10:03:32 -04:00
Viv
e3cd17bf0e main.py: Add basic argparse interface 2023-06-03 09:47:59 -04:00
Viv
5f8b0c4dd5 main.py: Use course ID (m) instead of name (Oni) 2023-06-03 09:47:46 -04:00
Viv
f5aa185ec2 constants.py: Add support for 0-4 course strings 2023-06-03 09:45:53 -04:00
Viv
ffc62c73a9 constants.py: Add missing header constants (SONGVOL, SEVOL) 2023-06-03 09:45:15 -04:00
Viv
394b7badc9 main.py: Refactor main() to support external scripts
- Don't manually convert difficulties by hardcoding names
- Don't write the TJA in `main()`; let the caller decide.
2023-06-02 17:44:00 -04:00
Viv
a510696efc parsers.py: Add support for SHIFT-JIS .tjas
Roppon was formatted as SHIFTJIS, so this was necessary.
2023-06-02 17:44:00 -04:00
Viv
3e2e29baa1 parsers.py: Add NotImplementError else cases
I felt too lazy to explicitly specify each and every unsupported command.
2023-06-02 17:44:00 -04:00
Viv
f5df104e56 parsers.py: Handle incorrectly specified balloon metadata
Carmen Prelude's .tja had "30,10," which would be parsed as ['30', '10', '']. We don't want that last value, so we exclude empty values.
2023-06-02 17:44:00 -04:00
Viv
8b3a56ef0d parsers.py: Fix bug with non-empty whitespace lines
As far as a TJA file goes, ' ' == ''. Both should be discarded.
2023-06-02 17:44:00 -04:00
Viv
d671939c41 Use explicit importing over relative importing
Helps when the package is used by a different script
2023-06-02 17:44:00 -04:00
Viv
ae9cde3a20 Rename tja2fumen.py to main.py 2023-06-02 17:44:00 -04:00
Viv
226060e6b6 constants.py: Add mapping between course names and letter IDs 2023-06-02 17:43:59 -04:00
Viv
f4e8a70f01 constants.py: Add missing header commands 2023-06-02 17:43:59 -04:00
Viv
4d4dacaeab fixup command constants 2023-06-02 17:43:59 -04:00
Viv
a66498a6db Update README.md 2023-06-02 17:43:59 -04:00
Viv
383c2c6fd0 Update README.md 2023-06-02 17:43:59 -04:00
Viv
7c5cd18ac1 Update README.md 2023-06-02 17:43:59 -04:00
Viv
e856f302b7 Update README.md 2023-06-02 17:43:59 -04:00
Viv
5adcdd47d0 Update README.md 2023-06-02 17:43:59 -04:00
Viv
b4ab35a09a Create README.md 2023-06-02 17:43:59 -04:00
Viv
1f3bf163b9 Attempt to handle remaining header bytes 2023-06-02 17:43:59 -04:00
Viv
62e4be1b81 parsers.py: Add support for drumrolls/balloons 2023-06-02 17:43:59 -04:00
Viv
235448b4ab parsers.py: Account in-line comments after ,
Some charters don't follow the spec! >:V
2023-06-02 17:43:59 -04:00
Viv
4b194e5f71 parsers.py: Account for blank header metadata
Some charters are too lazy to add scoreInit/scoreDiff/etc. values
2023-06-02 17:43:59 -04:00
Viv
0a3a4ae4e6 converters.py: Fix bug with measure BPM adjustment
The adjustment occurs between ANY BPM shifts, and not just mid-measure BPM shifts.

The reason I missed this is because my test song, Rokuchounen, ONLY contains mid-measure BPM shifts, and no BPM shifts that start exactly on the measure.
2023-06-02 17:43:59 -04:00
Viv
f336c37b8b parsers.py: Move SECTION to the branch function 2023-06-02 17:43:59 -04:00
Viv
555c92a8a5 Rename durationPadding to duration
The two shouldn't have been split apart; we should have had a single name representing duration as a whole, whether or not it's present.
2023-06-02 17:43:59 -04:00
Viv
6345fe5437 constants.py: Refactor TJA command lists
Some necessary commands were actually unnecessary, and some unused commands were actually used.
2023-06-02 17:43:59 -04:00
Viv
e3d2f0f039 Prepare for testing against Unlimited Games 2023-06-02 17:43:59 -04:00
Viv
c2739b322c parsers.py: Add cases for remaining ESE commands 2023-06-02 17:43:59 -04:00
Viv
b3968bc365 Remove TTBREAK, TTROWBEAT, and measureProperties
These are unnecessary; these commands are not included in the TJA spec.
2023-06-02 17:43:59 -04:00
Viv
1d3490c600 utils.py: Add difficulty-based investigation notes 2023-06-02 17:43:59 -04:00
Viv
60fb3215d7 utils.py: Pin down "Difficulty" header bytes 2023-06-02 17:43:59 -04:00
Viv
aadbb3f8ba Add a sample "unknownHeader" to use in TJA conversions
This contains all of the dummy/padding text found through investigation, but none of the actual song-specific header metadata, so this will need to be updated further.

But, it's better than all 0s, and I want to test to see how TDMX responds to this.
2023-06-02 17:43:59 -04:00
Viv
ce99164583 utils.py: Add function to validate unknown header bytes 2023-06-02 17:43:59 -04:00
Viv
35159ea793 tja2fumen.py: Refactor main steps into main() function 2023-06-02 17:43:59 -04:00
Viv
7239a00e76 converters.py: Fixup handling of scoreInit/scoreDiff 2023-06-02 17:43:59 -04:00
Viv
c7170d6f23 converters.py: Account for HIDDEN status 2023-06-02 17:43:59 -04:00
Viv
ec6bf1db68 converters.py: Account for GOGOTIME events
Also add in cases for barline and other events
2023-06-02 17:43:59 -04:00
Viv
dcc37ff0dd converters.py: Make 'note' its own case 2023-06-02 17:43:59 -04:00
Viv
1f76b19e69 converters.py: Remove redundant submeasures object 2023-06-02 17:43:59 -04:00
Viv
fdeefc2499 converters.py: Handle #SCROLL events 2023-06-02 17:43:59 -04:00
Viv
ae84137478 converters.py: Fix typo (PM -> BPM) 2023-06-02 17:43:59 -04:00
Viv
abd0af5f57 converters.py: Migrate event code to other function 2023-06-02 17:43:59 -04:00