Virtual Violin — play a violin online with a bow, vibrato, glissando and a MIDI keyboard

~/virtual-violin piano violin tuner drum kit ☕ Support me apps ← about me
// virtual violin · bowed-string model · web midi · no download · no signup
Virtual Violin — a bowed string calculated live in your browser
Press a string to play. Use the bow for dynamics, add vibrato, slur notes in legato and slide in a glissando. Play with the mouse, your fingers, the keyboard or a MIDI keyboard with velocity, mod wheel and pitch bend. Nothing is recorded: the violin, its body and the room are calculated in code.
ViolinSolo violin
Note—
String—
BowAuto
MIDIoff
EngineClick to start
Dynamics is the bow speed. Pressure is the bow force inside the playable range. Position moves the bow between the fingerboard and the bridge. Choosing a violin sets all of these at once, and you can fine-tune them here.

Guide — play a violin in your browser in five steps

No download, no account and no samples. Works with the mouse, your fingers, the keyboard or a USB MIDI keyboard.
1Start the sound

Click or tap the fingerboard, or press a key. Browsers only allow sound after a click, so your first touch also starts the audio engine.

2Pick a string and a note

The four lanes are the strings G, D, A and E, with E on top. Press in a lane to play: the far left is the open string and every step to the right is a semitone higher. Slide along the lane for a glissando.

3Shape the bow

In Auto bow mode the area under the strings sets how loud you play (left to right) and how hard you press (top to bottom). In Manual bow mode you draw the bow yourself: stroke left and right on a string.

4Add vibrato and legato

Vibrato depth and speed are sliders on the Sound tab, and the mod wheel of a MIDI keyboard controls them live. Overlapping MIDI notes are slurred on one string, like a real legato.

5Connect a MIDI keyboard

Press Connect MIDI, allow access and play. Velocity sets the bow speed, the mod wheel adds vibrato, CC11 shapes the dynamics and the pitch bend wheel bends the note.

What you can play with

MOUSE & TOUCHDraw on the strings

Four lanes, one per string, like the real fingerboard seen from above.

Press
plays the note under your finger: the left edge is the open string, each step right is a semitone
Slide
a glissando: the pitch follows your finger; the magnet snaps to a scale if you choose one
Bow area
sets loudness and pressure; with Manual bow, stroke left and right on a string
Wheel
changes the dynamics while a note sounds
KEYBOARDTwo rows of piano keys

Plays the notes of the violin from the keys of your computer. Several keys at once play several strings.

Lower row
Z X C V B N M are C D E F G A B from middle C, with S D G H J as the sharps
Upper row
Q W E R T Y U are the octave above, with 2 3 5 6 7
Octave
Shift + ↑ / ↓ moves both rows an octave; Esc stops all sound
MIDIA MIDI keyboard or controller

Any USB MIDI keyboard, wind controller or digital piano. It works with Chrome, Edge, Opera and Firefox.

Velocity
bow speed: soft keys give a gentle, slow start, hard keys a strong one
CC1, pressure
the mod wheel and channel pressure add vibrato
CC11, CC7
expression changes the dynamics while the note sounds; CC7 is the volume
CC64, CC74
sustain pedal keeps the bow going; CC74 moves the bow from the fingerboard to the bridge
Pitch bend
bends held notes up to the range you choose

A virtual violin that is calculated, not recorded

This free virtual violin plays a violin that is simulated in your browser. There are no recordings and no sample library: every sound is calculated while you play, from a model of a bowed string, a violin body and a room. Because it is a model, the sound reacts to how you play the way a real violin does. A slow bow makes a soft, breathy tone, a fast bow a loud one, a bow near the bridge sounds brighter, and a note can slide smoothly into the next one, since nothing is switched between samples. It uses the Web Audio API to make the sound and the Web MIDI API to read a MIDI keyboard, so nothing is installed and nothing is uploaded.

How is a bowed string simulated?

A violin string is a long, thin string that is tuned by its tension. When you pluck it, it rings and fades. A bow does something different: it keeps feeding energy into the string. Rosin makes the hair of the bow grip the string, so the bow drags the string sideways until the tension of the string pulls it free. The string then slips back, and the bow catches it again. This stick and slip repeats hundreds of times per second. It does not make a messy noise, because the string settles into a very regular movement that Hermann von Helmholtz described in the 19th century: a sharp corner runs back and forth along the string, and the string sticks to the bow for most of each period and slips back for a short moment. The result is a sound with a lot of harmonics, which is why a violin is so rich.

The model has the same parts as the real thing. Two delay lines hold the two parts of the string, on each side of the bow. At the bridge and at the finger (or the nut for an open string) the waves are reflected, with small losses that make the high harmonics fade faster, and the place where the bow touches the string has a friction curve with a static and a dynamic friction of the rosin. This method is called digital waveguide synthesis and is based on the work of McIntyre, Schumacher and Woodhouse on bowed strings and of Julius O. Smith on waveguides. The code runs in an AudioWorklet, so it stays on time while the page is busy.

Bow speed, pressure and position

A violinist controls three things with the bow: its speed, the force on the string and the distance to the bridge. They are not independent. Schelleng showed in 1973 that for a given speed and bow position there is a window of bow forces that gives a clean tone: with too little force the string does not get gripped and the sound is thin and whistling, with too much the tone becomes raucous. Closer to the bridge the window moves up (you need more force) and gets narrower, which is why a loud, bright sound near the bridge is harder to play.

In this violin, Dynamics is the bow speed, Bow pressure chooses a force inside the playable window, and Bow position moves the bow between the fingerboard (soft, hollow) and the bridge (bright, intense). The page keeps the force inside the playable window, so a stray movement of the mouse does not make the tone collapse. Pressing harder gives a fuller and edgier sound, lighter pressure a thinner and airier one. Fast notes start with a quick, strong bow and slow notes with a gentle one: the start of the note depends on the velocity or on how fast you move the bow.

The body: why it sounds like a violin

A string alone makes almost no sound. The bridge passes its vibration to the top plate and the body, and the body radiates it as sound. The body has its own resonances, and they shape the voice of the instrument. A violin has an air resonance (the “A0” mode, the air moving in and out of the f-holes) at roughly 270 to 290 Hz, a group of strong plate and body resonances between about 400 and 600 Hz, a dense series of weaker resonances higher up, and a broad boost between about 2 and 3 kHz that violin makers call the bridge hill, which gives the sound its brilliance and its carrying power.

The page filters the string through a body that is built from damped resonances at these places. There are five variants (solo, bright, old, chamber and fiddle) with slightly shifted modes and a different bridge hill. The sound then goes through a reverb that is also calculated in code, from a small room to a cathedral, plus a few open strings that ring along softly (the sympathetic strings), just as the open strings of a real violin resonate when you play a note that is related to them.

Vibrato, legato and glissando

Three techniques make a violin sound alive, and all three are available here. Vibrato is a small, slow wobble of the pitch from rocking the finger on the string: players usually do it about five to seven times a second. In this violin it starts a little after the note begins and grows, as players do it, so short notes stay straight and long notes bloom. Depth and speed are sliders, and a MIDI mod wheel controls the depth live. A tiny random variation keeps it from sounding mechanical.

Legato means joining notes without a new bow: the bow keeps moving while the finger changes the pitch. On a MIDI keyboard, play the next note before you let go of the first one, and the two are slurred on the same string. With the mouse, slide your finger. A glissando is a continuous slide between pitches; the string simply gets shorter or longer. The Slide speed setting says how fast the pitch follows your finger, and the Magnet setting (with a scale and a key) snaps to the notes of a scale as you slide, so you can play melodies without tuning every note by ear.

How do I play it?

With mouse or touch, press on a string. The far left is the open string, and each step to the right is one semitone higher, up to two octaves on every string. The strings are laid out like a real fingerboard, so the same finger position on a different string plays a note a fifth higher or lower. With Auto bow, you set how loud and how hard you play with the area under the strings and the sliders, and the bow runs continuously while a note is held. With Manual bow, tap the fingerboard to put a finger on a note (it stays there until you move it), then stroke left and right on that string in the bow area: the speed of your hand is the speed of the bow, the height inside the lane is the pressure, and a stroke that stops makes the sound stop. On a touch screen you can set a finger with one hand and bow with the other.

With the computer keyboard, two rows of piano keys play notes from middle C, and every key finds a good string and position for its note.

Which MIDI messages does it use?

Connect a MIDI keyboard, wind controller or digital piano by USB, press Connect MIDI and allow the access. Notes, controllers and the pitch bend wheel then work as in the table. The MIDI monitor tab lists every message that arrives, with time, channel and values, which is also a handy MIDI tester.

MessageWhat it does
Note on, velocityStarts a note on the best string. Velocity sets the bow speed and how quickly the note speaks. Notes that arrive within a few milliseconds of each other are treated as a chord and spread over different strings where possible.
Note offLifts the bow: the string stops after a short release.
Overlapping notesWith Legato on, a new note that starts while the previous one is still held slurs on the same string without a new bow. Releasing the new note returns to the held one, which gives trills.
CC1 (mod wheel), channel pressureAdds vibrato; the depth follows the wheel or the pressure of your fingers.
CC11 (expression)Changes the bow speed while the note sounds: swells and fades.
CC7 (volume)Master volume of the violin.
CC64 (sustain pedal)Keeps the bow going after you release the keys.
CC74 (brightness)Moves the bow from over the fingerboard (dark) to the bridge (bright).
Pitch bendBends the sounding notes; the range is 1, 2, 4 or 12 semitones on the MIDI tab.
CC120, CC123All sound off, all notes off.

The range of the violin is G3 (MIDI note 55) up to C7 (96). Notes outside that range are ignored, and the page shows a short message. The channel setting lets you listen to one MIDI channel only, which helps with keyboards that send on several channels.

The seven violins

Latency, CPU and phones

The delay between a key or a touch and the sound is the sum of your MIDI keyboard, the browser and your audio device. With wired headphones or speakers it is usually short enough to play comfortably; the Engine box at the top of the page shows the browser’s own output latency. Bluetooth headphones add 100 to 300 ms, so use a cable if you play from a keyboard. A bowed string needs more calculation than a sample player: up to ten notes can sound at once, and a very old phone may crackle with many notes. On a phone, turn the device to landscape and use the touch bow area; Chrome on Android also supports USB MIDI keyboards with an OTG adapter, while Safari on iPhone and iPad has no Web MIDI.

Privacy

Everything runs on your device. The page does not upload your playing and does not record anything. It stores your settings (violin, sliders, scale) in this browser only, and your MIDI messages are only used to play sound.

Honest limits

This is a physical model, not a recording of a Stradivari. It sounds like a violin, with the character of a model: bow, string and body are simplified, so it will not fool a trained ear in a side-by-side test with a great player. It has no pizzicato, no harmonics, no spiccato bouncing bow and no real double stops by one bow (chords are played as notes on separate strings). It is made to be playable, expressive and free, and to show how a violin works.

More music tools

Try the virtual piano with MIDI keyboard support, tune a real violin with the instrument tuner, keep time with the metronome, or play the virtual drum kit with e-drums or MIDI pads.