TJAPlayer3 implementation details
(https://github.com/IepIweidieng/TJAPlayer3/blob/gh-pages/tja.md#senotechange):
- `#SENOTECHANGE` can be placed at the start of a measure, or in the
middle of the measure
- It will only apply to 1 note immediately after the command
- It will override any automatic Don2/Don3/Ka2 assignment (from note
clusters)
How it works in `tja2fumen`:
- `#SENOTECHANGE` will be tracked in the TJA measure object
- It will split the measure into sub-measures (similar to gogo/bpm/etc.)
- It will only be applied to the first note, after which it will be
overwritten
- We set a `manually_set` flag to ensure that the manually-chosen value
doesn't get overwritten.
Fixes#69.
I was making a bad assumption:
1. Songs with branches have the same number of balloons.
2. Each balloon has the same number of hits across branches.
Because I was making these assumptions, I thought I could just repeat
the `BALLOON:` field for each branch. **But this is wrong!!** Branches
can have different numbers of balloons, and they can have different
number of hits in their balloons. So, we need to **NOT** necessarily
repeat `BALLOON:`, and instead use the written value of `BALLOON:`
directly. This way we can get the different values for each branch.
This fixes the parsing of Emma's Ura (and probably other songs). Also,
this revealed a bug in my parsing of Roppon no Bara to Sai no Uta, so I
needed to make sure we account for "duplicated" balloons too, and repeat
the values _only when necessary_.
Previously, I had translated the existing levelhold behavior in
WHMHammer's tja parsing code, assuming that it would produce the correct
behavior for fumen charts. However, that is not the case -- the behavior
is completely wrong.
So, this PR takes out all the old `flag_levelhold` behavior and instead
properly sets the `branch_info` bytes whenever #LEVELHOLD is present on
a branch.
This PR also prepares `shoto9.tja` for further testing, but I'm leaving
that for later...
Fixes#52.
This PR updates the behavior for songs with drumroll branching
conditions (`#BRANCHSTART r`)
The changes include:
- Correctly setting the `branchInfo` bytes for branching conditions that
occur _after_ the first condition.
- Correctly setting the `branch_points` bytes in the header when there
are only drumroll conditions.
- Correctly setting the `branch_ratio` bytes in the header when total
notes differ between branches.
- Correctly handling #SECTION commands for a number of different corner
cases:
1. #SECTION occurs on its own without a #BRANCHSTART
2. #BRANCHSTART occurs with a #SECTION command
3. #BRANCHSTART occurs without a #SECTION command (and is first branch
condition)
4. #BRANCHSTART occurs without a #SECTION command (and is NOT first
branch condition)
Note: I've added `shoto9` to the test suite, but the TJA file is
structured in a way that the number of measures doesn't match the number
of fumen measures. The TJA needs to be reworked, but that's okay,
because its purpose was just to check that the branching bytes were
correct.
Fixes#40.
This PR adds `genpe.tja` to the test suite, a song that currently fails
due to how `tja2fumen` handles `#SECTION` commands.
We fix the problems with branching commands in
8ad2102f0a. (Making sure that any #SECTION
commands that occur before the first #BRANCHSTART are properly handled.)
This PR also contains a few refactoring commits to improve the clarity
of how the branching logic works, to make further debugging of branching
songs easier.
Fixes#33.
This PR adds a new chart to the test suite (`imcanz.tja`) that uses
`p,0,0`, `p,999,999` _and_ `#SECTION` commands:
- `p,0,0`: Forces the chart into the Master branch (since it's
impossible to fail a 0% accuracy requirement)
- `p,999,999`: Forces the chart into the Normal branch (since it's
impossible to pass a 999% accuracy requirement)
- `#SECTION`: Resets accuracy values for notes and drumrolls on the next
measure. (In practice, this just means that the branch condition is
repeated on the next measure, at least according to the official fumen I
have.)
Note: Only the Oni and Hard difficulties have actually been added to the
test suite. The Normal and Easy charts were too broken to easily match
the official fumens. They will need a lot of work to fix charting
errors, so I'm leaving them commented out for now.
Fixes#27.
- Before: 'OFFSET' = 2nd measure fumenOffset
- After: ('OFFSET'-Full measure duration) = 1st measure fumenOffset
Both methods will produce the same results if no #MEASURE/#BPMCHANGE
commands are present in the first two measures. However, if these
commands ARE present, then you will get wildly different results.
This change doesn't affect 4/6 tests, but for 2/6 tests there were
#MEASURE/#BPMCHANGE commands. For these songs, I had erroneously "fixed"
the OFFSET values, when they were correct all along. So, I reverted them
back to their original values.
Fixes#25.
This PR adds support for multiplayer charts, and adds a new multiplayer
TJA/fumen combo for testing.
This PR is quite small, because the only work that needed to be done is
parsing the course metadata. Once the TJA lines are split into courses,
the actual course-by-course parsing logic is identical to the songs that
came before.
Fixes#6.
This PR adds the remaining changes needed to support branching TJA
songs.
- Properly handling `r` (drumroll) based branching conditions
- Handling commands that come after a measure end but _before_ the first
`#BRANCHSTART` command. (This was not previously covered by
`hol6po.tja`.)
As well, it adds a bit of cleanup/refactoring to the changes from the
previous branch PR (#20).
To test these changes, another new branching TJA-fumen pair is added to
the test suite.
The official fumen had some issues where a note ended up in the wrong measure:
- Expected: pos 0.0 on the next measure
- Actual: pos 645 on the prev measure (impossible pos)
They're the same pos, but only pos 0.0 is possible to express in TJA charts, so the fumens themselves had to be updated.
Also, the TJA chart had errors, too:
- The BPMs/SCROLLs in the BPMCHANGE section were incorrect
- Some drumrolls were too short
Fixing these errors caused the failing test to pass.