JAMORI Open Jamori

How it's made

Almost no recordings. Numbers, turned into sound.

Almost every sound in Jamori is calculated in your browser while you play, using the Web Audio API. Here are five of the ideas behind it, each one live on this page. Turn the sound up a little and press the buttons.

Plucked strings

A string from a burst of noise.

Take a few milliseconds of random noise and feed it into a loop exactly one vibration long. Each time round, average neighbouring samples. The randomness dies away, the loop's own pitch survives, and what's left sounds like a plucked string. This is the Karplus-Strong algorithm, published in 1983. Jamori's guitar, sitar, koto and guzheng all start this way.

Less averaging keeps more high frequencies, which sounds brighter, like a koto. The left half of the picture is the first 20 milliseconds, still mostly noise. The right half is the same string half a second later, smoothed into a repeating wave.

The app builds on this. Where you pluck matters: near the middle, the second harmonic nearly vanishes. Each note then goes through a short impulse response shaped like a guitar, koto or sitar body. The sitar also gets a jawari, a one-sided bridge the string buzzes against, which pushes energy into the high harmonics. In a test, energy above 2 kHz half a second in was 9 dB higher than for a plain string. Its sympathetic strings ring quietly behind it.

FM synthesis

Bells from one wave wobbling another.

Make one sine wave's pitch wobble very fast, at a rate set by a second wave. You don't hear a wobble; you hear new frequencies, called sidebands, at the pitch plus and minus whole steps of the wobble rate. John Chowning found this at Stanford in 1967, and it became the sound of 1980s keyboards.

Whole-number ratios give harmonic tones like electric pianos. In-between ratios like 3.5 give the clangy, metallic overtones of a bell. Depth spreads the energy wider.

Tuning

Why ragas want pure intervals.

A piano splits the octave into twelve equal steps so it can play in any key. The price is that most intervals are slightly off from the pure ratios the ear locks onto. The major third is the clearest case: 400 cents on a piano, against 386.3 cents for the pure ratio 5 : 4.

Against a tanpura's steady drone, that difference is audible as a fast beating. So in raga mode Jamori uses just intonation, and in Western mode it uses equal temperament. Play both and listen for the shimmer in the first one.

C4 is 261.63 Hz. The piano's E4 is 329.63 Hz; the pure third is 327.03 Hz, 13.7 cents lower. The fifth harmonic of C and the fourth of the piano's E sit 10.4 Hz apart, so they beat about ten times a second. With the pure third they coincide and the beating stops.

Pitch tracking

How a hum becomes notes.

To find the pitch of a voice, Jamori compares each slice of the recording with itself shifted in time. When the shift equals one vibration, the two line up and the difference drops. That shift is the pitch. This is the YIN method, from de Cheveigné and Kawahara in 2002.

Pitches are then smoothed, rounded to the nearest note, and joined into note events, and wobbly moments shorter than about 60 milliseconds are folded into their neighbours. Press the button to make a new hummed phrase and watch it get transcribed.

The line is the detected pitch; the bars are the notes it settles on.

Modal synthesis

Metal is mostly out-of-tune overtones.

Strike a metal tine, a steel shell or a bowl and it rings at a few frequencies at once. Unlike a string, they are not neat multiples of the lowest one. Jamori builds these instruments from those partials: a sine wave for each, each with its own decay.

A kalimba tine is a beam clamped at one end, so its overtones fall at 6.27, 17.55 and 34.39 times the lowest note, not at whole numbers. Harder hits bring up more of them.

Singing bowls get each partial twice, a few cents apart. The two drift in and out of phase, which is the slow beating you hear.

Pick one to hear it and see its partials.

All of it runs on your device.

No servers make the sound. Your phone or laptop computes every sample in real time, which is also why your voice never has to leave it.

The same code drives the instruments in the atlas and every sound in the app.