> For the complete documentation index, see [llms.txt](https://support.audacityteam.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.audacityteam.org/music/aligning-music-to-beats-and-measures.md).

# Aligning music to beats and bars

{% hint style="info" %}
**Note:** A measure and a bar are the same thing. Audacity uses "bar" in places where "measure" would be too long.
{% endhint %}

## Detecting tempo (BPM)

To align music to the beats and bars grid, you first need to know the tempo of the song, usually measured in beats per minute (BPM).

* If you're recording music on your own, try playing to a metronome to ensure you stay in tempo.
* If you're using music downloaded from the web, try figuring out its tempo. In some cases, a web search for *`song title`*` `` ``tempo ` is sufficient.
* You also can download a bpm detection plugin. The [Vamp plugin pack](https://www.vamp-plugins.org/pack.html) features several tempo detection plugins, such as:
  * *IBT - INESC Beat Tracker*
  * *Simple Fixed Tempo Estimator* form the Vamp SDK example library
  * *Tempo and Beat Tracker: Tempo* from the Queen Mary University of London

{% hint style="info" %}
Audacity is not yet able to handle midway tempo changes during a song.
{% endhint %}

## Preparing clips for snapping

Audacity will snap the beginning of the clip to the beats and bars grid, depending on your tempo and snapping setting. If your first beat doesn't start exactly at the start of the clip, you can trim the beginning of the clip. To trim a clip, simply drag the upper edge of it inwards.

<figure><img src="/files/atbbQMU2EXSScpQOKQMA" alt="" width="191"><figcaption></figcaption></figure>

{% hint style="info" %}
When trimming a clip, you may need to turn off snapping to make finer adjustments.
{% endhint %}

## Aligning to beats and bars

Once you have everything set up and snapping enabled, simply dragging your clips will align them to the beat and bars grid.

<figure><img src="/files/xPyDoD2KeBGBZ0bDWtCj" alt=""><figcaption><p>The snapping toolbar with its dropdowns.</p></figcaption></figure>

***

Once you have aligned your music, you can get started with adding loops and other content to the project [Working with audio loops](/music/working-with-audio-loops.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://support.audacityteam.org/music/aligning-music-to-beats-and-measures.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
