Generate a metronome click track specification from BPM and bars
Build a deterministic metronome click track specification without rendering or analyzing audio.
Run — free
Provide the tempo in beats per minute, a time signature such as 4/4 or 6/8, and the desired duration in whole bars. The result lists every click from time zero, identifies its bar and beat, and marks the first beat of each bar as accented. Use the structured output to schedule sounds, drive animation, prepare practice tools, or test beat-aware software with repeatable timing data.
Describe the musical grid
Enter a positive BPM value, a time signature in numerator/denominator form, and a positive whole number of bars. BPM measures the beat unit named by the denominator, so 120 BPM in 4/4 means quarter-note beats arrive every half second, while 120 BPM in 6/8 means eighth-note beats arrive every half second. The numerator determines how many clicks belong to each bar. The generator starts the first click at timestamp zero because playback systems normally schedule the opening downbeat at the beginning of their timeline. It then advances by exactly sixty divided by BPM seconds for every later click. This definition avoids hidden count-ins, swing, subdivisions, or audio latency. If a session needs those features, it can transform or offset the returned schedule explicitly. Keeping the input small and musical also makes the result useful across browser audio, native audio engines, video timelines, test fixtures, and notation applications without tying it to a particular sample rate or sound file.
Read timestamps and accents
Each click record contains a one-based global index, a one-based bar number, a one-based beat number, a timestamp in seconds, and an accented flag. The first beat of every bar has accented set to true; all remaining beats are false. This gives a renderer enough information to choose a stronger click sample for downbeats while using a normal sample elsewhere. Timestamps are rounded to nine decimal places so JSON output stays stable while retaining sub-microsecond precision for ordinary musical tempos. The summary also reports the click interval, total duration, click count, beats per bar, and beat unit. Total duration describes the complete requested span through the end of the final beat interval, not merely the timestamp of the final click. For example, a one-bar 4/4 track at 120 BPM contains clicks at 0, 0.5, 1, and 1.5 seconds, while its complete duration is 2 seconds. That distinction helps prevent clipped final beats when allocating an audio or animation timeline.
Schedule the specification safely
Treat the result as a timing specification rather than rendered audio. A Web Audio application can add its playback start time to every timestamp and schedule an accent buffer or regular buffer according to the flag. A digital audio workstation script can convert seconds to its own timeline units, and a test suite can compare expected transport events without depending on speakers or media codecs. The function is deterministic: identical inputs always produce identical JSON, and it does not use the network, the current clock, or random values. Invalid tempos are rejected, including zero, negative values, missing values, infinities, and nonnumeric text. Signatures must contain a numerator from 1 through 32 and a conventional power-of-two denominator from 1 through 32. Bars must be a positive integer, and the completed schedule is limited to 10,000 clicks to keep responses practical. Because timestamps are relative to zero, application latency and device compensation remain the caller’s responsibility; add those offsets only when the final playback environment is known.
What you can do with it
Drive a browser metronome
Schedule regular and accented click samples on a Web Audio timeline from a compact musical description.
Build beat-aware animation
Align visual cues, exercise prompts, or lighting events with exact bar and beat timestamps.
Test transport logic
Create repeatable expected events for sequencers, practice apps, and playback engines without rendering audio.
FAQ
What does it cost?
The API price is $0.002 per request, and the same deterministic calculation can run free in your browser.
Is the first click at zero?
Yes. Timestamp zero is the accented downbeat of bar one, beat one.
How are downbeats marked?
Beat one of every bar has accented set to true. Every other click has accented set to false.
Does this generate an audio file?
No. It returns a structured click schedule that an audio, animation, or testing system can render or consume.
What does BPM mean for 6/8?
BPM applies to the denominator beat unit. In 6/8, each of the six eighth-note beats receives a click.
Why is total duration later than the final timestamp?
The final click begins the last beat. Total duration includes that beat's full interval so the requested bars are complete.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/audio/metronome-click-track \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"bpm":120,"time_signature":"4/4","bars":2}'const res = await fetch("https://api.kit.forhosting.com/audio/metronome-click-track", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"bpm": 120,
"time_signature": "4/4",
"bars": 2
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/audio/metronome-click-track",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"bpm": 120,
"time_signature": "4/4",
"bars": 2
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/audio/metronome-click-track", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"bpm":120,"time_signature":"4/4","bars":2}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"bpm":120,"time_signature":"4/4","bars":2}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/audio/metronome-click-track", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"bpm": 120,
"time_signature": "4/4",
"bars": 2
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "audio.metronome_click_track",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_items | 10000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |