Fix incorrect initial density

This commit is contained in:
smoogipoo 2020-10-09 21:11:12 +09:00
parent da03084251
commit 4d0e4f4ade
1 changed files with 2 additions and 1 deletions

View File

@ -116,7 +116,8 @@ private void computeDensity(double newNoteTime)
prevNoteTimes.RemoveAt(0);
prevNoteTimes.Add(newNoteTime);
density = (prevNoteTimes[^1] - prevNoteTimes[0]) / prevNoteTimes.Count;
if (prevNoteTimes.Count >= 2)
density = (prevNoteTimes[^1] - prevNoteTimes[0]) / prevNoteTimes.Count;
}
private double lastTime;