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
| BPM | Genre | Beat (seconds) |
|---|---|---|
| 60 | Slow ballad | 1.0000 |
| 90 | Moderate | 0.6667 |
| 120 | Dance / Pop | 0.5000 |
| 140 | Fast dance | 0.4286 |
| 180 | Very fast | 0.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.