All projects

Experiment

Tambura Simulator

Play a Slavonian tamburica band in the browser: prim, bas-prim, kontra and berde in the Srijem E tuning, with physically modelled sound and a play-along kolo.

Stack
TypeScript, Web Audio, Canvas, Vite

Overview

I play tambura, and I couldn’t find anything online that lets you actually play one. So I built it: pick an instrument from the band, press frets, strum the strings with a mouse, a finger or the keyboard.

There are no samples. Every note comes from a physical model of a plucked steel string. The upper partials run slightly sharp, as on a stiff string. A bright attack fades into a softer aftersound. Doubled strings beat against each other, and each instrument has its own body resonance. Every note is within 3 cents of pitch and starts sounding in about 5 ms.

What you can do

  • 01Play prim, bas-prim, kontra and berde, tuned in the srijemski E-štim that Slavonian bands play
  • 02Press frets for single notes and drag across the strings to strum, with harder strums for faster drags
  • 03Pick from 12 chords, with shapes worked out for each instrument from its tuning
  • 04Use the keyboard as a fretboard: four key rows are the four strings
  • 05Turn on tremolo, the sound of a tamburica lead
  • 06Start “Kolo” to hear the whole band play a short kolo, or switch on “Without me”, mute your instrument and play its part from the dots on the neck

Under the hood

  • 01TypeScript and Vite, no framework, about 15 kB gzipped
  • 02Extended Karplus-Strong string: allpass dispersion fitted to the inharmonicity of real tamburica strings, two polarisations, exact phase-delay tuning
  • 03Web Audio: each instrument’s body as a convolution with its air and plate modes, and a lookahead scheduler on the audio clock for the band
  • 04Canvas 2D neck that turns vertical on phones, down to 320 px wide
  • 05Unit tests for tuning accuracy, chord shapes and the band arrangement

It replaces my older tambura animation experiment. Next up: recorded samples, the A system and more songs.

Next projectTracklens →