Free tool
Loop Length Calculator for Game Music
Find the exact length of a music loop in seconds and samples from its tempo, time signature and number of bars, or work backwards from the length a level needs.
- Seconds and samples
- Any time signature
- Works backwards
- Runs in your browser
| Bars | Seconds | Samples |
|---|
Work backwards from a target length
BPM counts quarter notes, as most DAWs do, so a bar of 6/8 lasts three quarter notes. Figures are exact math; the length your DAW exports also depends on its render settings.
How the math works
A tempo in BPM counts quarter notes per minute, so every length follows from four steps:
- Seconds per quarter note = 60 ÷ BPM
- Quarter notes per bar = beats per bar × 4 ÷ beat unit
- Loop length = bars × quarter notes per bar × 60 ÷ BPM
- Samples = loop length × sample rate
In 6/8 a bar holds 6 × 4 ÷ 8 = 3 quarter notes, so 8 bars of 6/8 at 90 BPM last 8 × 3 × 60 ÷ 90 = 16 seconds.
Worked example: 16 bars of 4/4 at 120 BPM
Sixteen bars of 4/4 hold 64 quarter notes. At 120 BPM each one lasts half a second, so the loop is exactly 32 seconds, which is 1,536,000 samples at 48 kHz or 1,411,200 at 44.1 kHz. Because both are whole numbers, a file exported at exactly that length repeats with the downbeat on time.
Getting loops to repeat cleanly
- Export the exact lengthIf the file runs longer than the musical loop, the extra silence or tail plays before every repeat and the groove stutters.
- Watch for fractional samplesSome tempos give a length that is not a whole number of samples. The calculator flags it, so you can round the export by less than one sample.
- Handle the reverb tailA common approach is to render the loop twice and keep the second pass, so the tail from the end is already sounding at the start.
- Fit the levelWork backwards from the time a level or menu needs: the calculator gives the bars it takes and the tempo that makes them fit exactly.
Frequently asked questions
How long is 16 bars at 120 BPM?
In 4/4, 16 bars last exactly 32 seconds: 64 quarter notes at half a second each. That is 1,536,000 samples at 48 kHz.
Does the time signature change the loop length?
Yes. The length depends on how many quarter notes fit in a bar: a bar of 3/4 holds three, a bar of 6/8 also holds three, and a bar of 4/4 holds four.
Which sample rate should game music use?
48 kHz is common in game and video work and 44.1 kHz in music releases. Use the rate in the delivery spec from the audio lead or the engine documentation.
Why is my loop not a whole number of samples?
The length in seconds times the sample rate can land between two samples at some tempos. Round the export to the nearest sample or pick a tempo the calculator shows as exact.