How Maqam Detection Works: Name the Maqam, the Tonic and the Scale

Arabic and Turkish music does not live inside twelve notes. Between the notes of a piano there are quarter tones, and the maqam is built on them: rast has a half-flat third, bayati a half-flat second and sixth, sikah sits almost entirely on quarter tones, saba has a fourth degree that is neither natural nor sharp. A normal tuner or a key finder cannot name any of this, because it only knows twelve notes.

What the Tool Listens For

The detector works in three steps, all of them on your own device. First it follows the melody pitch by pitch, frame by frame, and ignores everything that is too quiet or too noisy to be a note. Second it builds a picture of how much time the melody spends on each pitch, on a grid of 25 cents — that is a quarter of a semitone, fine enough to see the difference between a natural note and a half-flat one. Third it compares that picture with the scale of every maqam in the list, in every possible tonic, and keeps the closest match.

The Quarter Tones, in Numbers

Each scale is written as distances in cents from the tonic, so nothing is rounded to the nearest piano key. Rast is 0 200 350 500 700 900 1050. Bayati is 0 150 300 500 700 800 1000. Sikah is 0 150 350 500 650 850 1000. Saba is 0 150 300 400 700 800 1000. Hijaz is 0 100 400 500 700 850 1000. Nahawand is 0 200 300 500 700 800 1000, the one scale in the list that is pure twelve-tone. When the result says a note is half-flat, it means the note sits 50 cents below the piano note of that name — exactly the degree that makes the maqam sound the way it does.

One more scale deserves its own line: hijaz ghareeb, also called sikah baladi. It keeps the hijaz shape but lifts the second degree to a quarter tone above the tonic and drops the sixth, which gives it the flavour singers use in religious and traditional music. Its degrees are 0 150 400 500 700 800 1000 — close to bayati, different in the third. The tool also shows the Turkish name for each scale it shares with Turkish music: rast is Rast, bayati is Uşşak, sikah is Segah, hijaz is Hicaz, nahawand is Nihavend, and so on.

How to Read the Result

What It Can and Cannot Do

On clean single-line material it is strong: in our own tests on generated oud and voice melodies across all eighteen maqams, the right maqam came first in about nine cases out of ten, the tonic was right within a quarter tone every time, and rast, bayati, sikah, saba, hijaz and nahawand were never mixed up with each other. Those are tests on generated audio, not on commercial recordings, so treat them as the shape of the tool rather than a promise about your song.

Two limits are worth knowing. When the melody is buried under a loud band, drums and a thick mix, the tool usually comes back with near-zero confidence and says it is not sure — that is deliberate, because a confident wrong maqam is worse than an honest maybe. And a few maqams differ by a single degree, like ajam and jiharkah; on those the answer can land on the neighbour, and the top-three list is there so you can see how close it was.

How to Get a Good Result

Start Now

Open the tool, upload a recording or sing fifteen seconds into the microphone, and you get the maqam, the tonic, the confidence and the full scale in seconds. Nothing is uploaded anywhere, everything runs inside your browser.

🎼 Open the Maqam Detector
← Back to Home