Scala File Creator

A tool to create your own tunings from uploaded samples

Drop audio files of individual tones. Each file's fundamental frequency is detected and assembled into a downloadable tuning file — Scala (.scl) or AnaMark (.tun). The lowest frequency becomes the root — click any tone to set it as the new root. Use the tone generator to confirm accuracy of the analysis by ear.

Drop audio files here
or click to choose — WAV, FLAC, MP3, M4A, AIFF, AIF, AAC accepted
Detected tones
Pitch detection isn't always exact — it can lock onto a harmonic instead of the fundamental pitch. To check by ear, preview a tone, dial the Reference Tone Generator to its Hz, and play both: a slow wavering pulse means they're close but not matched. Nudge the Hz until the pulse disappears.

Nothing analyzed yet.

Fundamentals outside these bounds aren't detected. Narrow it if a tone locks onto a harmonic; widen it for very low or high tones. Changing either value re-analyzes.
Folds every tone into a single 1200-cent octave above the root. The cents column above updates live.
Off
Reference Tone Generator
Hz
drag to sweep — scroll or shift+drag to fine-tune
50%
File preview
A .tun file gives every MIDI key an absolute pitch, so the scale is laid out from the root on note 60 and repeated across the keyboard. Octave repeats every 1200 cents. Scale span repeats at the interval between the lowest and highest tone, preserving the measured intervals but producing a non-octave repeat. With octave folding on, the repeat is always 1200 cents.
Scale details
Required. Describe the origin of this tuning and its sources.
How pitch detection works in this tool

The tool uses an algorithm called NSDF (Normalized Square Difference Function), a refined form of autocorrelation. In short: it takes a short slice from the sustained portion of each uploaded file — skipping the attack transient — and looks for the point at which the signal most closely repeats itself. That repetition period corresponds to the fundamental frequency, which becomes the Hz reading.

This works reliably on sounds with a clear, sustained fundamental. Metallic percussion — gamelan bars, bells, bonang — tends to produce accurate results, as do most sustained pitched instruments. The Detection Range setting constrains which frequencies the algorithm considers, which reduces the chance of locking onto a harmonic instead of the fundamental.

Some materials are harder. Muted or fast-decaying sounds — bamboo instruments like jegog, for instance — have little sustained energy for the algorithm to analyze. Large gongs and bells can be ambiguous because their perceived pitch doesn't always align with their lowest spectral partial. Instruments with unusually dense or inharmonic overtone structures may produce inconsistent readings. In any of these cases, the Hz field in each tone row can be edited manually, and the Reference Tone Generator is there to verify by ear.

Interactive essay How Machines Hear Pitch The five detection methods evaluated for this tool, walked through with playable demos and tested against four instruments — including the inharmonic bronze that trips most of them up. No maths required. Headphones on.

Credits & Inspirations: This project is inspired by Latent Sonorities and Leimma and a conversation between Morgan Sully and Laurel Pardue. It was originally built to be used with gamelanic instruments in mind. Check out the GitHub repository for detailed technical notes on the pitch detection methods. Issues and pull requests are welcome.