Skip to content

Commit

Permalink
Fixed that the BPM don't get higher with the BPMeasure
Browse files Browse the repository at this point in the history
  • Loading branch information
siveryt committed May 26, 2024
1 parent 8aff907 commit 6bb2f84
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Toolbox/Functions/Metronome.swift
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,19 @@ struct Metronome: View {
}

private func setupTimer() {
let interval = 60.0 / bpm
let interval = 60.0 / (bpm * bpmeasure)
timer = Timer.scheduledTimer(withTimeInterval: interval / 100, repeats: true) { _ in
self.updateProgress()
}
}

private func updateProgress() {
progress += 0.01
distributeProgress()
if progress >= bpmeasure {
progress = 0
progressFrom = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
}
distributeProgress()
if progress.truncatingRemainder(dividingBy: 1) < 0.01 {
playClickSound()
}
Expand Down

0 comments on commit 6bb2f84

Please sign in to comment.