Skip to content

Reference

Calculator for music and video

Bars and beats to seconds at any tempo, seconds to frames at any frame rate, and sums kept as exact fractions, with every step of the working shown. It runs in your browser, and it can also write a formula for one of your visualizer's controls from a few words.

Calculate

Enter calculates. Up and Down bring back earlier questions; Escape clears. Words work too: plus, times, how many.

Your song and video (optional)

Try one

What it reads

Music timing

2 bars at 128 bpm in seconds is exactly 15/4 s (3.75 s). A bar is 4 beats unless you set another time signature; a phrase is 4 bars.

Video frames

how many frames is 3.5 s at 30 fps answers 105 frames. Beats become frames too: 4 beats at 120 bpm in frames at 30 fps is 60.

Exact fractions

1/3 + 1/6 is 1/2, and 0.1 + 0.2 is exactly 0.3. A fraction written together (1/2) stays one number, so 1/2 s is half a second.

Words and symbols

plus, minus, times, divided by, squared, percent of, the square root of; or + - * / ^ %, brackets, and functions such as sqrt, sin, round, clamp and lerp.

Powers come before signs, so -2^2 is -4. Writing two values side by side multiplies them and binds tighter than a slash: 2t is 2 × t, and 1 / 2t is 1 / (2t). An error says what is wrong and points at it.

Units

The units the calculator reads
UnitWrite it as
secondss, sec, secs, second
millisecondsms, msec, msecs, millisecond
minutesmin, mins, minute, minutes
beatsbeat, beats
barsbar, bars, measure, measures
phrasesphrase, phrases
bpmbpm
framesframe, frames
fpsfps
hertzhz, hertz
pixelspx, pixel, pixels
percent%, percent, pct
turnsturn, turns, rev, revs
degreesdeg, degs, degree, degrees
radiansrad, rads, radian, radians

Beats and frames turn into time with a tempo and a frame rate: add “at 128 bpm” or “at 30 fps”, or fill in your song's tempo and frame rate above.

Formulas for your controls

Describe a motion and the calculator writes the formula, checks that it reads, keeps it inside the control's range over eight bars of music, and times it exactly from the tempo. It never flashes more than three times a second.

  • “pulse the scale on every kick”: value * (1 + 0.25 * pulse(beat, 6))
  • “loop every 2 bars”: lerp(0.5, 1.5, saw(bar / 2))
  • “make the glow breathe every 4 bars”: value * (1 + 0.25 * sin(tau * bar / 4))
  • “fade in over 4 bars”: value * smoothstep(0, 4, bar)

More in the help article The calculator and formulas.

With SW Agent and Claude

Ask SW Agent “how long is 8 bars at 140 bpm” and it answers with the same working, with a link back here. AI assistants such as Claude can use the same calculator through our MCP server, as the tool calculate.