A few years ago I came across André Michelle's Karplus-Strong guitar synthesizer . Apart from being an incredibly cool toy, the set of chords it strums is actually pretty nice to listen to. Sometimes I'd have it playing for background noise.

The only hitch is that since it's written in ActionScript, it won't run on Android. So, I set out to reimplement it in HTML5 and Javascript using Web Audio and asm.js.

Here's how it turned out. Check out https://github.com/mrahtz/javascript-karplus-strong for source. Full credit for the algorithm itself goes to André - this is an almost exact clone of the decompiled ActionScript.

If you're interested in details of how the Karplus-Strong algorithm works, check out another post, Karplus-Strong String Synthesis .

Loading controls...

0.5
0.5
0.25
0.5
0.25
0.0
0.2
(not yet set)