Lesson 8 of 15

BPM and Beat Duration

Tempo and Timing

BPM (Beats Per Minute) describes the tempo of music. The beat is the rhythmic pulse you tap your foot to.

Beat Duration

The duration of one beat in seconds:

beatDuration(bpm) = 60 / bpm

Common Tempos

BPMGenreBeat (seconds)
60Slow ballad1.0000
90Moderate0.6667
120Dance / Pop0.5000
140Fast dance0.4286
180Very fast0.3333

Why This Matters

In the Web Audio API, you schedule sounds with AudioContext.currentTime (in seconds). Knowing beat duration lets you place notes on the beat grid:

// Note at beat 3 (0-indexed):
const onset = ac.currentTime + 3 * beatDuration(120);

Your Task

Implement beatDuration(bpm) returning seconds per beat.

Run your code to hear four quarter notes at 120 BPM.

Web Audio API loading...
Loading...
Click "Run" to execute your code.