UltraStar-Deluxe / USDX

The free and open source karaoke singing game UltraStar Deluxe, inspired by Sony SingStar™
https://usdx.eu
GNU General Public License v2.0
868 stars 162 forks source link

Remove variable BPM references #686

Open barbeque-squared opened 1 year ago

barbeque-squared commented 1 year ago

If you search the codebase for BPM[ (the [ is important here!) you'll find that most places, in particular those responsible for actually playing songs, always use BPM[0].

In USong there's also this I'm going to assume never-documented part:

else if Param0 = 'B' then
begin
  SetLength(self.BPM, Length(self.BPM) + 1);
  self.BPM[High(self.BPM)].StartBeat := ParseLyricFloatParam(CurLine, LinePos);
  self.BPM[High(self.BPM)].StartBeat := self.BPM[High(self.BPM)].StartBeat + Rel[0];

  self.BPM[High(self.BPM)].BPM := ParseLyricFloatParam(CurLine, LinePos);
  self.BPM[High(self.BPM)].BPM := self.BPM[High(self.BPM)].BPM * Mult * MultBPM;
end;

I'm going to assume the lines themselves read like B <STARTBEAT> <NEWBPM>. It sounds neat but I don't think I've ever seen it used, and though I'd have to test it to be sure, I doubt it even works throughout the code (playback, jukebox, editor).

This was like that in 2015 already. I don't have the svn history on my machine.

I propose to do a quick test to see if it even works. If no, I'd like to just delete all this multi-BPM stuff. Will be a while before I get around to this, this ticket is if anyone actually uses it or knows what it's for so they can comment

bohning commented 1 year ago

I have never seen anything in that direction either and I have been following UltraStar from the very beginning back in the days when Corvus5 started the whole thing (in 2005, I believe?). The only thing remotely related to that is the #RESOLUTION tag, that I saw rarely here and there, but it quickly disappeared. I believe it was used to set the subdivisons per beat (default: 4 or quarter notes) - I have seen very few occurences with #RESOLUTION:8, but I believe this has entirely disappeared.

barbeque-squared commented 1 year ago

I think #RESOLUTION actually still exists, but it's only used for the editor grid or something (and is generally unused anyway -- should probably also think about removing that one day by just auto-computing a sensible grid depending on what is visible).

But yeah, I had a feeling this BPM stuff was never really fully implemented, I'll be refactoring that at some point in the future then, thanks.