Skip to content

Commit

Permalink
fix: use bpm_base when main bpm that is too small (e.g. Aleph-0 Pre…
Browse files Browse the repository at this point in the history
…sent) (fix #3)
  • Loading branch information
zhanbao2000 committed May 7, 2024
1 parent ecceb38 commit e2850f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ArcaeaChartRender/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,14 @@ def _add_comment_bpm_change(self):
def _post_processing_segment(self):
"""Split the chart into multiple segments and then tile them from left to right."""
bpm_proportion = self._chart.get_bpm_proportion()
main_bar_duration = 4 * 60000 / max(bpm_proportion, key=bpm_proportion.get)
main_bpm = max(bpm_proportion, key=bpm_proportion.get)

# ignore the bpm that is too small (Aleph-0 Present)
if main_bpm < 10:
main_bar_duration = 4 * 60000 / self._song.bpm_base
else:
main_bar_duration = 4 * 60000 / main_bpm

segment = int(self._chart.end_time / 10000)
segment_duration = (self._chart.end_time / segment // main_bar_duration or 1) * main_bar_duration
segment_count = ceil(self._chart.end_time / segment_duration)
Expand Down

0 comments on commit e2850f4

Please sign in to comment.