Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Fix clustering algorithm#87

Open
bionyx187 wants to merge 1 commit intovivaria:mainfrom
bionyx187:fast_cluster_fix
Open

Fix clustering algorithm#87
bionyx187 wants to merge 1 commit intovivaria:mainfrom
bionyx187:fast_cluster_fix

Conversation

@bionyx187
Copy link
Copy Markdown

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

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.
Copy link
Copy Markdown
Owner

@vivaria vivaria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@vivaria
Copy link
Copy Markdown
Owner

vivaria commented Feb 25, 2025

I see now that this PR is connected to tja2fumen-net:

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 -net version. So, I am happy to merge this PR. :)

# 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]))
Copy link
Copy Markdown
Owner

@vivaria vivaria Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to make sure I understand this change...

  • Before: Only check notes - for note.diff (because cluster[:-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.)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants