Fix clustering algorithm#87
Conversation
The check should be looking at the current cluster, not the previous cluster. Tested this using a truncated TJA and verified the Fumen output matched the reference video for the TJA.
vivaria
left a comment
There was a problem hiding this comment.
Thank you for opening this issue. I have not looked at tja2fumen in some time, because I started a new hobby (Edison format of Yu-Gi-Oh).
I hope I can find some time to look at this. But, most of my hobby time is spent on Edison instead, so it might take me a lot of time. Thank you for your understanding.
|
I see now that this PR is connected to
I did not know that these projects existed. Now that I know about them, I am much more excited to watch the development and try to stay in sync with the |
| # However, there's one exception: Groups of 4 notes, faster than 8th | ||
| is_fast_cluster_of_4 = (len(cluster) == 4 and | ||
| all(note.diff < eighth_note_duration | ||
| for note in cluster[:-1])) |
There was a problem hiding this comment.
Just to make sure I understand this change...
- Before: Only check notes - for
note.diff(becausecluster[:-1]==cluster[0:3]==cluster[0]+cluster{1]+cluster[2] - After: Check notes 1-4 for
note.diff
This seems like maybe it is the wrong change when comparing to https://github.com/Renzo904/tja2fumen-net/pull/4/files? (In that PR, the is_fast_cluster_of_4 check is not modified.)
There was a problem hiding this comment.
Your understanding is exactly correct. The check was returning false positives in the Python version.
This is not the same fix as I applied to tja2fumen-net. Both implementations had bugs, and I was comparing them against each other to figure out where problems were, and then fixed each implementation to match the expectations.
The check should be looking at the current cluster, not the previous cluster.
Tested this using a truncated TJA and verified the Fumen output matched the reference video for the TJA (first 4 measures).
Truncated TJA attached as text. Reference video: https://www.youtube.com/watch?v=uNfN_tipKIs
恋はみるくてぃ.txt