     open func setTempo(_ bpm: Double) {
         if isAVSequencer { return }
 
-        let constrainedTempo = min(max(bpm, 10.0), 280.0)
+        let constrainedTempo = (10...280).clamp(bpm)
 
         var tempoTrack: MusicTrack? = nil
 

            return
        }

        let constrainedTempo = min(max(bpm, 10.0), 280.0)

        var tempoTrack: MusicTrack? = nil


        let noteOnTimeRel = currentRelativePosition.beats
        let lastSpot = AKDuration(beats: modTime(noteOnTimeRel - (noteOnTimeRel.truncatingRemainder(dividingBy: quantizationInBeats))))
        let nextSpot = AKDuration(beats: modTime(lastSpot.beats + quantizationInBeats))
        return [lastSpot, nextSpot]
    }
    
    /// Time modulus
