Closed vivaria closed 7 months ago
I assume that the logic goes like this:
I will have to be quite careful when keeping track of note groupings (tracking between-measure groupings, making sure to properly identify when a grouping ends, etc.).
It looks like there are a handful of approaches for clustering in 1D (see this SO answer). Many of them are using numpy / scipy, though, whereas ideally I would want to implement something in pure Python to keep the distributed binary size small.
I do think that the 1D clustering problem here is quite a bit simpler than the cases described on SO:
So, maybe I can come up with some sort of simplified algorithm to group the notes, given some assumptions. For example:
Since TJA files use only a single number to represent dons and kas (1 and 2 respectively), I have only been writing a single type of don/ka to the converted .bin file.
However, official fumens actually have 3 types of dons and 2 types of kas. And, different types will be used depending on how the dons and kas are grouped together:
Theoretically, my converter could track if a note is part of a triplet/quad/etc. and write the different notes accordingly. But, it might be quite tricky to programmatically detect groupings of notes.
Maybe what I could do is track "time since last note". If the time decreases (i.e. notes are closer together), we enter a "grouping". If the time stays the same, then we're still within the grouping. If the time increases (i.e. notes are further apart), we have exited the grouping. But, I don't know how foolproof that is if we consider BPMCHANGE commands, etc. 🤔