Twang is a graphical simulation of the harmonic motion of a vibrating string. The flickering line in the center is the string in question. To "pluck" the string, click on either of the double-arrow buttons at the top. You can hold the button down to create a longer disturbance in the string's vibration. (The center button stops & starts the vibrations)
The disturbance travels along the string and bounces off the top & bottom.
The string has no friction and will continue to vibrate until reset.
As you will see, plucking always gives a mixture of harmonics. For a more elegant look, you can plot pure or mixed harmonics. Simply enter up to three values in the fields at the bottom of the display, and click "Set Harmonics".
Values in the range [1-20] give the best looking waveforms. The harmonics are hard to recognize beyond about 50, and the pixel resolution gives a Nyquist frequency of this applet to be about 220. Above that frequency, harmonics cannot be correctly rendered on the screen.
"Twang" does a fair amount of floating point math, and much pixel level graphics -- two areas where Java (or for that matter, computers themselves) isn't particularly noted for speed./
This was designed on a Pentium/133 with a fast graphics card, running Microsoft Internet Explorer v3.0 (said to be the fastest Java Virtual machine available), and it still takes about 10 seconds for the disturbance to make it's way from the top to the bottom.
"Twang" is based on the article "The Vibrating String - A Simulation of Motion" by William E. Bennett, published in the Creative Computer magazine, June 1980, pg. 114pp