Search Ctrl K
Home / Tools
THE FEUTEX TOOLKIT

Audio Loop Sample Boundary

Find the nearest whole-sample boundary for a tempo-synced loop and report timing error.

Audio workspace● Runs in your browser
01 Your input
02 Your result
View or copy raw result data
FormulaSamples = Math.round(sample_rate*60*beats/bpm); Error ms = 1000*(Math.round(sample_rate*60*beats/bpm)/sample_rate-60*beats/bpm)

Made for real tasks

  • Find the nearest whole-sample boundary for a tempo-synced loop and report timing error.
  • Compare two scenarios by changing the inputs and rerunning the tool.
Explore step-by-step workflows →

Worked example

Inputs

Sample rate
48000 samples/s
Tempo (BPM)
123 BPM
Beats
16 beats

Expected results

Samples
374634 samples
Error ms
-0.003048780488 ms

Load the example in the workspace to reproduce these results. Display rounding does not change the underlying calculation.

How to use this tool

  1. Enter sample rate, bpm, beats.
  2. Use consistent units shown beside each input. Run the calculation and review the assumptions below.

Try this example

{
  "sample_rate": 48000,
  "bpm": 123,
  "beats": 16
}

Accuracy and scope

Fixed tempo and quarter-note beat count; loop length is rounded to the nearest sample. Reported error is rounded minus ideal duration, not audio drift compensation or zero-crossing analysis.

Is my data uploaded?

This tool runs locally in your browser. Input and output are not sent to a processing server. Copy or download your result before leaving the page.