Virtual Guitar — play a guitar online with chords, strumming, bends, hammer-ons and a MIDI keyboard

~/virtual-guitar guitar tuner chord backing track drum kit ☕ Support me apps ← about me
// virtual guitar · plucked-string model · acoustic & amp · web midi · no download · no signup
Virtual Guitar — a string calculated live in your browser
Press a chord and strum, or play the fretboard with slides, bends and vibrato. Hold a note and add a second finger for a hammer-on, lift it for a pull-off. Choose an acoustic, nylon, clean or overdriven electric sound, or play with a MIDI keyboard. Nothing is recorded: the strings, the body, the amp and the room are calculated in code.
SoundSteel-string acoustic
ChordC
Note—
String—
Technique—
MIDIoff
EngineClick to start
The body is the wooden box that gives an acoustic guitar its voice. Choosing a sound sets all of the sliders at once, and you can fine-tune them here.
Pick strength is how hard a tap or a strum hits a string. Ring after release is how long a string keeps sounding after you lift your finger.

Guide — play a guitar 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 fretboard, or press a key. Browsers only allow sound after a click, so your first touch also starts the audio engine.

2Strum a chord

Press a chord button under the strings, then swipe across the strings in the strum zone, or press Down and Up. A slow swipe is soft, a fast one is loud, and the place along the string changes the tone.

3Play the fretboard

The six lanes are the strings, high e on top. Press a lane to pick that string: the left edge is the open string and every fret to the right is a semitone higher. Slide along the string, or drag up for a bend.

4Add hammer-ons and pull-offs

Hold a note and put a second finger on the same string, higher up: that is a hammer-on. Lift the upper finger while the lower one stays: that is a pull-off. Turn on Legato to do it with one finger.

5Pick a sound or connect MIDI

Choose acoustic, nylon, clean, crunch or lead from the Sound list. Press Connect MIDI to play with a keyboard: velocity, pitch bend, mod wheel and sustain pedal all work.

What you can play with

MOUSE & TOUCHFretboard and strum zone

Six strings with high e on top, like a tab. Below them is the strum zone.

Press
picks the string at that fret: the left edge is the open string, each step right is a semitone
Slide
drag along the string: the pitch follows your finger, as fast or as smooth as the Slide setting
Bend
drag up on a held string to bend it; wobble up and down for vibrato
Strum
swipe across the strings in the zone: speed sets loudness, left is soft, right is bright; tap to pick one string
TECHNIQUESHammer-on, pull-off, palm mute

The same moves a guitarist makes with the left hand.

Hammer-on
hold a note, then put a second finger higher on the same string: it sounds without a new pick
Pull-off
lift the upper finger while the lower one stays down
Legato
the button next to the sound list lets one finger hammer on or pull off a string that is still ringing
Palm mute
the PM button, or hold `: short, dull, chunky notes
KEYBOARDNotes and strums

Two rows of piano keys play notes; the arrow keys strum.

Lower row
Z X C V B N M are C D E F G A B from C3, 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
Strum
click the fretboard first, then ↓ strums down, ↑ up, ← → change the chord, Space mutes
Octave
Shift + ↑ / ↓ moves both rows; Esc stops all sound
MIDIA MIDI keyboard or controller

Any USB MIDI keyboard, guitar-to-MIDI pickup or digital piano. It works with Chrome, Edge, Opera and Firefox.

Velocity
how hard the string is picked: soft keys are mellow, hard keys bright and loud
Pitch bend
bends all sounding notes up to the range you choose
CC1, pressure
the mod wheel and channel pressure add vibrato
CC64, CC67
sustain pedal keeps notes ringing; the soft pedal is palm mute
CC7, CC11, CC74
volume, expression and tone

A virtual guitar that is calculated, not recorded

This free virtual guitar plays a guitar 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 plucked string, a guitar body or an amplifier, and a room. Because it is a model, the sound reacts to how you play. A string picked near the bridge is thin and bright, near the neck it is round and hollow. A soft touch is mellow and a hard one bites. A note can slide, bend or hop to another fret without a new pick, because 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 plucked string simulated?

When you pluck a string, a wave runs along it, bounces back at the nut or the finger and at the bridge, and keeps going until it has lost its energy. A computer can do the same with a delay line: a short memory in which a wave travels around in a loop. The length of the loop sets the pitch, and a small filter in the loop takes away a little energy on every round, and more of the high frequencies than of the low ones. That is why a real string starts bright and gets softer, and why the high harmonics fade first. The idea goes back to the Karplus-Strong algorithm of 1983 and was worked out into digital waveguide synthesis by Julius O. Smith, David Jaffe and others.

This guitar adds the details that make it sound like a string and not like a buzzer. The loop uses a fractional delay, so the pitch can be any value and can glide smoothly for slides, bends and vibrato. The loop filter is calculated from two decay times, one for the fundamental and one for the high partials, which is how each of the six strings gets its own length of sustain. A pair of all-pass filters makes the high partials a little sharp, as they are on a real string because it is stiff (this is called inharmonicity, and it is stronger on thin plain steel strings than on nylon or wound strings). Every string is also made of two vibration planes with a slightly different pitch, so the note has the slow, gentle beating of a real string. The code runs in an AudioWorklet, so it stays on time while the page is busy.

Picks, fingers and where you pick

The pluck is a short pulse put into the loop. With a hard pick it is sharp and narrow, with a fingertip it is wide and soft; the Pick hardness slider moves between the two, and a few milliseconds of noise give the click of a pick or a nail. The pulse also goes through a comb filter whose delay is the distance between the pick and the bridge, because a string that is plucked at a point cannot move there: harmonics that have a node at that point are not excited. In the strum zone the horizontal position of your finger is the pick position, from near the neck (soft and round) to near the bridge (bright and thin). Electric guitars have a second comb of the same kind, from the place of the pickup.

The body: why it sounds like an acoustic guitar

A string alone makes almost no sound. The bridge passes its vibration to the top plate, and the body radiates it. The body has resonances that colour every note: an air resonance (the sound hole acting like the neck of a bottle) near 100 Hz in a dreadnought, the first top plate mode near 200 Hz, and a long series of weaker plate and back modes up to about 1.5 kHz, with a gentle presence and a steep fall above a few kilohertz. The page puts the string through a body built from damped resonances at these places. There are four bodies: a big dreadnought, a small parlor guitar (everything higher and thinner), a classical guitar (soft and round) and a jumbo (deep, with a long ring).

The electric guitar, the amp and the cabinet

The four electric sounds skip the body. The string signal passes a pickup (with its comb), then an amplifier. The preamp is a waveshaper that rounds off the peaks of the waveform, with a slight asymmetry that adds even harmonics, as a tube stage does. At low gain it only adds sparkle and at high gain it saturates and sustains. After it come the bass, mid and treble controls and a presence control, then a speaker cabinet: an impulse response that is built in code with the low cut, the cone resonance and the steep roll-off of a guitar speaker, in an open-back 2×12, a closed 4×12 or a small 1×12. Chorus and delay come last, followed by the room. The amp is a simple model made for playing, not a measured copy of a famous amplifier.

Slides, bends, vibrato, hammer-ons and pull-offs

These are what make a guitar line sound like a guitar, and all of them are available. A slide is a drag along the string: the pitch follows your finger fret by fret, and the Slide speed setting sets how quickly, from steps to a smooth glide. A bend pushes the string sideways so it gets tighter: drag up on a held string and the pitch rises by up to the bend range you choose (one to four semitones). Vibrato is a quick, small bend up and down; wobble your finger, or use the Vibrato sliders and the mod wheel, which fade in after the note starts, as a player does.

A hammer-on sounds a higher note on the same string by pressing a finger down on a fret while the string rings, without picking again. The string is not plucked, so the new note is quieter and rounder. In this instrument, the highest finger on a string sets its pitch, like the real thing: put a second finger on the same string above the first one and the pitch jumps with a small, soft re-excitation. A pull-off is the opposite: lift the upper finger while a lower finger is down, and the string sounds the lower note, with a little pluck from the finger that leaves. With a MIDI keyboard, turn on Legato and overlap two notes that are a few semitones apart to get the same effect, and release the upper one to pull off, which gives trills.

Strumming and chords

A chord is a shape for the left hand: which fret to press on each string, with some strings left out. The page has the common open chord shapes (C, A, G, E, D and their minors and sevenths), and for all others it moves the E-shape and A-shape barre chords up the neck to the right place. There are 12 roots and 12 chord types, 144 chords in all, from major, minor and sevenths to sus, diminished, augmented, sixths and add9. Choose a key to get its seven chords as buttons, as in a chord chart (I, ii, iii, IV, V, vi and vii°, or i to VII in a minor key). Pressing a chord shows its shape on the fretboard and strums it, if Strum on chord press is on.

The strum zone plays the shape string by string as your finger crosses the strings, so a slow swipe is a slow arpeggio and a fast one a hard strum, and each string is picked at the speed you cross it. A new note on a string stops the old note on that same string, as it does on a real guitar, so a second strum cleans up the first. The capo raises all the open strings and the chord shapes follow it, so you can play the easy shapes in a hard key. Other tunings (drop D, DADGAD, open G, open D, half or whole step down) change the open strings; the chord shapes are fret patterns for standard tuning, so in another tuning the same shape sounds as a different chord.

Which MIDI messages does it use?

Connect a MIDI keyboard, a guitar-to-MIDI pickup or a 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 also makes it a handy MIDI tester.

MessageWhat it does
Note on, velocityPicks a string on the best fret for that note. Velocity sets how hard the string is picked. Notes that arrive within a few milliseconds of each other are treated as a chord and spread over different strings.
Note offLets go of the string: it dies away over the “ring after release” time.
Overlapping notesWith Legato on, a new note that is 1 to 5 semitones higher than the note that is still held hammers on to the same string. Releasing it pulls off back to the held note.
Pitch bendBends all sounding notes; the range is 1, 2, 4 or 12 semitones on the MIDI tab.
CC1 (mod wheel), channel pressureVibrato on held notes.
CC64 (sustain pedal)Keeps notes ringing after you release the keys.
CC67 (soft pedal)Palm mute while pressed.
CC7, CC11, CC74Volume, expression and tone (brightness).
Program changeSelects one of the eight sounds (0 to 7).
CC120, CC123All sound off, all notes off.

The range of the guitar in standard tuning is E2 (MIDI note 40) up to D6 (86) with 22 frets. 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 eight sounds

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. Six strings with a chord, an amp and a reverb need more calculation than a sample player: up to fourteen strings can sound at once, and a very old phone may crackle on a long strum with the high-gain sounds. On a phone, turn the device to landscape for a wider fretboard; 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 (sound, sliders, tuning, chord) 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 Martin or a Stratocaster. It sounds like a guitar, with the character of a model: the string, the body and the amp are simplified, so it will not fool a trained ear in a side-by-side test with a real instrument. One string can only sound one note at a time, as on a real guitar, so a lead line and a chord that share a string cut each other off. There are no natural harmonics, no tapping, no whammy bar and no amp feedback. A mouse presses one place at a time, so chords come from the chord buttons and the strum zone, and a touch screen cannot feel the string. It is made to be playable, expressive and free, and to show how a guitar works.

More music tools

Tune your real guitar with the guitar tuner, practise with the chord backing track and the metronome, or play the virtual piano, the virtual drum kit and the virtual violin.