MuseGen

How to Match BPM and Key for Mashups

MuseGen logo

MuseGen Team

9/24/2026

#bpm and key matching#camelot wheel#harmonic mixing#key lock#time stretching#mashup tempo

Every guide to mashups tells you to match the tempo and match the key, as though those were two separate errands. They are not. On a computer, and on a turntable before that, speed and pitch are wired to the same shaft. Move one and the other moves with it unless you intervene. The two numbers you are told to look up are one number seen from two angles — and once you see the connection, most of the decisions in a mashup make themselves.

A producer seen from behind at a studio desk wearing headphones, hands on a controller, with two tracks stacked on screen showing 120 BPM in 8A above 127 BPM in 3A

The short answer

Detect both numbers, then check whether the tempos are already equal or an exact 2:1 pair — if they are, no stretching is needed at all. If they are not, express the gap as a percentage: about 6% is a whole semitone, which is the point where the key genuinely moves. Below that, key lock is optional. Above it, you are choosing between two keys, not two tempos.

The reason the percentage matters is arithmetic rather than opinion. Equal temperament divides the octave into twelve identical steps, and each step is a frequency ratio of the twelfth root of two, roughly 1.05946. Play a record 5.946% faster and every frequency in it rises by exactly that ratio. A track at 120 BPM taken to 127.1 BPM with key lock switched off has not merely sped up. It has been transposed a semitone.

That is a small enough move on the tempo side to be almost invisible, and large enough on the key side to change five of the seven notes in the scale. Everything below unpacks that mismatch, plus the one case where the two numbers agree for free.

  • Detect both numbers before you decide anything. A tempo you guessed and a key you assumed send you down the wrong branch immediately, and every later step inherits the mistake.
  • Check for a 2:1 pair first. A track at 174 and a track at 87 are already in time with each other. The cheapest match in mashup work is the one that needs no stretching at all.
  • Work out the tempo gap as a percentage. About 6% is one whole semitone. That single figure tells you whether the key is about to move, and by how much, before you touch anything.
  • Decide which side moves. Instruments survive transposition better than voices do. When one element has to give, it is usually not the vocal.

Quick facts

  • Semitone ratio: ×1.05946, the twelfth root of two.
  • That ratio as tempo: +5.95% — 120 BPM becomes 127.1 BPM.
  • Camelot letters: A is minor, B is major.
  • One step round a ring: a perfect fifth; one note of the scale changes.
  • The free match: any exact 2:1 tempo pair, such as 174 and 87.
  • What has no key: percussion-only or heavily atonal audio.

Why a mashup needs two numbers

A tempo tells you when things happen. A key tells you which notes are allowed. Play two records at once and you can fail either test independently: a vocal that drifts off the grid is a timing failure; a vocal that sits perfectly on the grid while grinding against the chords underneath is a harmonic one. Both are obvious within four bars, and they need different repairs.

Most tempo writing stops at the first of those. The rest of this series has argued that a genre label rarely fixes a single number — that trap sits at 140 and feels like 70, that drum and bass is written at 174 and often reported as 87, that hip-hop is one word over two tempos. Every one was about reading a number correctly. None was about changing one.

Changing one is where the second number arrives uninvited, because you cannot alter the speed of a recording without altering its pitch. That is not a defect in any particular piece of software. It is what a recording is: a fixed sequence of samples, and playing them faster scales every frequency inside them by the same factor. Wikipedia's account of time stretching says so plainly — when speed changes, the frequencies are always scaled at the same ratio as the speed, transposing the pitch in the process.

So the honest description of a mashup is not "match the tempo, then match the key". It is: every tempo decision is also a key decision, and you either make it on purpose or by accident.

The 2:1 pair is a free match

Start with the good news. Two tempos in an exact 2:1 ratio are already in time with each other. A grid at 140 and a grid at 70 share every second beat; nothing needs stretching, nothing needs resampling, and nothing needs a key decision, because you never changed the speed. Line up the downbeats and they stay locked for as long as both tracks hold their tempo. The same is true of 174 and 87, or 128 and 64.

This matters more than it looks, because a startling amount of modern music is already written in half-time pairs. A drum and bass record and a hip-hop record can be one edit away from sitting together, not because anyone planned it, but because the same music can honestly be counted at two speeds.

A two-by-two matrix: rows are tempos already line up and tempos differ, columns are keys compatible and keys clash, with the four resulting actions nothing to fix, move the pitch only, stretch with key lock on, and stretch with key lock off

Read the tempos first. The pair you land in decides which dial you reach for.

The reverse of that gift is the most expensive mistake in this article. If a detector reports 87 for a record written at 174 and you take that at face value, every percentage you calculate afterwards is wrong by a factor of two. You will ask for a 15% stretch when you needed none. Nothing in the audio tells you which figure was wrong, because both descriptions are true of the same recording and only one is useful to a grid.

The defence is cheap. Before any arithmetic, check whether the two reported tempos sit within a whisker of a 2:1 ratio. A rap vocal reported at 150 and a rap instrumental at 75 are not two problems. They are one relationship described from opposite ends, and the faster figure is usually the one the software was actually built on.

Anything that is neither a 2:1 pair nor an exact match needs a stretch, and a stretch is where the second number starts moving.

One semitone is 5.95%

Here is the arithmetic that turns vague advice into a decision. Western tuning divides the octave into twelve identical parts — identical in ratio, not in Hertz. Each step multiplies the frequency by the same factor, and because twelve steps must double it, that factor is the twelfth root of two, approximately 1.05946. Musicians meet the same quantity in another costume, as the hundred cents in a semitone.

Now put it next to the tempo. Speeding a recording by 5.946% multiplies every frequency in it by 1.05946, so it is not roughly a semitone. It is a semitone. A 120 BPM record taken to 127.1 BPM without key lock is that record transposed up one step; 100 BPM taken to 105.9 is the same move. The percentage is constant, the BPM difference that produces it is not.

Two parallel sliders: a tempo slider running 120.0 BPM to 127.1 BPM labelled plus 5.95 percent, and a pitch slider running A minor to B flat minor labelled plus one semitone, above three figures reading times 1.05946, 8A to 3A, and 5 of 7

The same move, described twice. Only one description appears on the tempo control.

A semitone sounds small, and on the tempo axis it is. On the harmonic axis it is close to the largest move available — the Camelot wheel shows why.

The wheel is an adaptation of the circle of fifths, laid out as a twelve-hour clock. Each key gets a number and a letter: A for minor keys, B for majors. One hour around a ring is a perfect fifth in one direction and a perfect fourth in the other, and the useful consequence is that a neighbouring key differs from yours by exactly one note. Adjacency is a proxy for shared notes.

So where does a semitone land? Not next door. It is seven steps around the ring, because seven fifths folded back into one octave arrive a semitone above where they started. Walk seven hours from 8A, which is A minor: E, B, F♯, C♯, G♯, D♯, and finally B♭ minor at 3A. A up to B♭ is a semitone.

But 3A is nearly the far side of the clock. Backwards it is five hours, and on a twelve-hour face six is the maximum. If one step changes one note, five steps change five — and a scale only has seven. The direct check agrees: A minor and B♭ minor share nothing but C and F.

The smallest available step in pitch is almost the largest available move in harmony. Nudging a tempo by six percent because it looked like a rounding error is not a rounding error. It swaps out five of the seven notes your other track is trying to agree with.

Move on the wheelExampleNotes changedWhat it does
Same number, other letter8A → 8BNoneRelative major and minor: same seven notes, different home base
One step forward8A → 9AOneThe standard lift; brighter, same neighbourhood
One step back8A → 7AOneSame distance the other way; slightly darker
Neighbour, other letter5A → 4A, 6A or 5BNone or oneThe three safe exits from any position
Seven steps — one semitone8A → 3AFive of sevenWhat a 6% stretch does when key lock is off

One warning about a number you may have met before. Guides to time stretching often cite a limit of around six percent, past which processing becomes audible. That figure is about audio quality and has nothing causally to do with the 5.95% that makes a semitone. The two collide on the same number by coincidence — worth knowing, so you do not build a theory on it.

What key lock actually costs

Key lock, sometimes labelled master tempo or pitch lock, is the switch that breaks the coupling. With it on, a track can be sped up or slowed down while its pitch stays put. That is time stretching in the strict sense: changing the speed of a signal without affecting its pitch.

It is worth being clear about why that is harder than it sounds. Playing a recording faster is nearly free: it is just reading the same samples at a different rate. Holding the pitch still is not reading at all — it is analysis and reconstruction. The software decides what the signal was made of, then rebuilds it to keep those components at their original frequencies while occupying a different amount of time. Every stretching artefact comes from that reconstruction being imperfect: smeared transients, a watery quality on sustained tones, a loss of definition on dense percussion.

So key lock is not free and it is not lossless. It buys a fixed key at the price of some fidelity, and how much depends on the material and the algorithm. The only reliable test is the pair of tracks in front of you at the percentage you need.

Three situations make the choice easy. If the gap is tiny, leave key lock off — a fraction of a percent is a fraction of a cent, and the reconstruction is a cost with nothing to show for it. If the gap is large and the keys are already compatible, turn it on, because you have something worth protecting. And if the gap is large and the keys clash anyway, work out where an unlocked stretch would land the key before reaching for anything else. Occasionally it lands somewhere better, and you get both fixes in one move at no processing cost.

Which side should move

Once you know a move is needed, you still have to choose a victim. The general answer is that the instrumental moves and the voice stays.

The reasoning is not mystical. A voice is the sound listeners have the most experience of, and the resonances that make a particular person sound like that person do not scale politely when the whole signal is shifted. Push a vocal up and it acquires a thin, chipmunk quality; pull it down and it goes heavy and synthetic. Instruments are more forgiving, partly because a synth pad or a filtered loop carries fewer cues about what size of body produced it. For what shifting does to a human voice and why it announces itself so quickly, the pitch correction article covers that ground properly.

Two corollaries follow. First, when the vocal genuinely has to move, move it by whole semitones rather than whatever percentage the tempo happened to need. A whole number of steps lands in a real key and can be described on the wheel; four-fifths of a step lands between two keys and will never agree with anything.

Second, if the arrangement allows it, split the difference. Bringing the instrumental up two percent and the vocal down two percent halves the damage on either side, and if the total needed is under a semitone, neither has moved far enough to declare itself.

The order matters too. Set the project tempo first, to whichever element is immovable, and fit everything else to that. Then look at the keys — because the tempo decisions you just made may already have changed them.

Reading a key, and its limits

All of this assumes you know what key each track is in, and for anything you did not write yourself, that means detection.

A key detector measures how strongly each of the twelve pitch classes appears across a recording — how much C there is, how much C♯, and so on, regardless of octave — then matches the resulting profile against the expected profile of every major and minor key. The best match is the answer. That explains both what the tool is good at and where it stops.

What it is good at is anything with clear harmonic content: a piano part, a vocal over chords, a bassline with a defined root. What it struggles with follows from the method. Percussion-only material and heavily atonal audio may not contain enough pitch information for the question to have an answer, and a detector asked anyway returns its best match rather than an admission of defeat. A drum loop does not have a key.

A subtler failure catches people out. Relative major and minor share all seven notes, so a detector's choice between 8A and 8B rests on which note the music treats as home, not on which notes are present. Picking the wrong one of that pair usually matters little, precisely because the note pool is identical — but the label on your screen is wrong, and if you build a chain of wheel moves on it, the error travels.

Two habits cover most of this. Detect on the most melodic section rather than the intro or the drop, because the analysis reflects whatever you feed it. And treat the result as a hypothesis to confirm by ear. A key detector narrows twenty-four possibilities to one or two; it is not an oracle, and the moment it disagrees with your ears, your ears win.

▶ Watch on YouTube: "How To Mix In Key: The Complete Harmonic Mixing Guide For DJs" — a DJ-facing guide to mixing in key, which is the practice the rules above come out of.

One worked example

Take a concrete pair. An a cappella detected at 120 BPM in 8A, and an instrumental detected at 127.1 BPM in 3A.

First question: are they a 2:1 pair? No — twice 120 is 240 and half of 127.1 is 63.6, so neither is a half-time reading of the other. This is a real gap, and something will have to move.

Second question: how big is the gap? Slowing 127.1 to 120 is a drop of 5.95%, which by now you can read on sight. That is one semitone — a small tempo move and a large harmonic one.

Third question: which way do the keys need to go? The vocal is at 8A and the instrumental at 3A — exactly one semitone above it.

Read those answers together and the job does itself. The tempo needs to come down a semitone's worth, and so does the key. Those are the same move. Pull the instrumental from 127.1 to 120 with key lock off and it arrives in time and in 8A at once, at no processing cost. The coupling that causes most of the trouble on this page has, for once, done the work for you.

Now change one detail and the answer inverts. Suppose the instrumental had come back at 127.1 BPM already in 8A. The tempo still needs the same 5.95%, but that stretch would now carry a matched key seven steps round the wheel to 3A and break something that was already right. So key lock goes on, you accept the processing cost, and both elements stay in A minor. Same tempo gap, opposite decision — separated only by a number that never appears on a tempo control.

There is a third route that skips the negotiation. If the instrumental is generated rather than borrowed, both numbers are specifications rather than measurements: dub techno, 120 BPM, in A minor, hollow chord stabs and a long sub pulse asks for tempo and key together, and nothing needs stretching afterwards because nothing was ever in the wrong place. For the rest of the workflow — choosing material, handling vocals, arranging the result — the full mashup guide walks through it end to end.

Match the tempos first, because a 2:1 pair is free and a mis-read tempo poisons everything after it. Then read the gap as a percentage, because 6% is a semitone and a semitone is five of seven notes. The key decision was already made the moment you touched the tempo — all you are choosing is whether you made it deliberately.

Two numbers, and a tool for each

Two numbers, two tools, and one of them has gone unmentioned in this series until now. MuseGen's BPM detector reads the tempo of a track you upload — the number the previous five articles were about. Its song key finder reads the other one, and it returns rather more than a label: the key and scale, its relative key, the DJ-compatible Camelot values, and the diatonic chords that belong to it. That last set is what matters for a mashup: it hands you the wheel positions directly instead of asking you to look them up.

Two honest details before you rely on either. The tools have different length limits — the BPM detector accepts up to twelve minutes of audio, the key finder up to seven — so a long DJ edit may need trimming before the key side will read it. And the key finder analyses in your browser rather than sending the file to a server, which matters if the material is not yours to upload anywhere.

The other direction is the one this article has been building towards. If you are generating the bed rather than borrowing it, you do not have to detect anything: state both numbers in the description and let them be true from the start. MuseGen's song maker takes a tempo and a key in plain language, which turns a matching problem into a specification problem. The two numbers stop being something you measure and become something you decide.

The MuseGen Song Key Finder and Scale Detector page, with an Upload file and Paste link tab pair above a drag-and-drop panel noting MP3, WAV, OGG and FLAC support and a maximum duration of 7 minutes, and a Detect key button below

The key finder returns the scale, the relative key, the Camelot value and the diatonic chords.

The MuseGen BPM detector page, showing an upload area for an audio file and a detect button that returns a single tempo figure in beats per minute

The tempo side, with a longer duration limit than the key side.

Stop guessing the second number. Read the tempo and the key of a track, or state both up front and have the music written to them — Try MuseGen.

FAQ

How do you match BPM and key for a mashup?

Detect the tempo and key of both tracks, then check whether the tempos are equal or an exact 2:1 pair. If they are, only the key is left to solve. If not, work out the gap as a percentage and decide whether to stretch with key lock on, which holds the keys still, or off, which moves them.

Does changing the tempo change the key?

It does, unless the software is told not to let it. Speed and pitch scale at the same ratio, so a record played faster is also a record played higher. Key lock breaks that link, and it does so by resynthesising the audio rather than simply playing it at a different speed.

What is the Camelot wheel?

It is a twelve-hour clock face used by DJs, adapted from the circle of fifths. Every key gets a number from 1 to 12 and a letter, where A means minor and B means major. Moving one step around a ring changes only one note of the scale, which is why neighbouring numbers sound compatible.

How much can you stretch a track before it sounds bad?

There is no single figure, because it depends on the material and on the algorithm. Dense percussion and sustained vocals give the process away soonest. What is fixed is the arithmetic: a gap of about 6% is one whole semitone, so past that point the question is no longer only about audio quality but about which key you have landed in.

Are two songs at 140 and 70 BPM already in time?

Yes. A 2:1 ratio means the faster grid lines up with every other beat of the slower one, so the two are already matched and need no stretching. The same holds for 174 and 87, or 128 and 64. This is the one case in mashup work that costs nothing.

Should I pitch the vocal or the instrumental?

Move the instrumental where you can. A human voice carries cues that make transposition obvious quickly, while a synth pad or a drum loop tolerates the same move with far less complaint. If the vocal has to move, keep it to whole semitones so it lands in a real key.

Do I need the same key, or just a compatible one?

Compatible is enough, and often better. Two tracks sharing a Camelot number, such as 8A and 8B, are built from the same seven notes and simply name them differently. Stepping one place around a ring, from 8A to 9A or 7A, changes a single note and tends to lift the energy.

Can a key detector be wrong?

It can, and the way it works tells you when. A detector measures how strongly each of the twelve pitch classes appears and matches that profile against every major and minor key, so it needs pitched material to read. Percussion-only loops and heavily atonal audio may not contain enough pitch information.

Sources