Main Group 15: Karplus/Strong Algorithm


Return to main index
01 PLUCK Decay Method 1: Simple Averaging
1 PLUCK-made vs. home-made random numbers
2 EXPSEG envelope
3 LINSEG envelope
3B Variation of duration/frequency on f73
4 Adjustable pitchbend mechanism
02 PLUCK Decay Method 2: Stretched Averaging
03 PLUCK Decay Method 3: Simple Drum
04 PLUCK Decay Method 4: Stretched Drum
05 PLUCK Decay Method 5: Weighted Averaging
06 PLUCK Decay Method 6: 1st Order Recursive Filter

Overview

In its simplest form the algorithm consists of averaging each two successive samples of a circular buffer (or wave-table), and then writing the average back to the buffer as the new sample value. The various harmonics of whatever initial spectrum are decaying to an almost pure sine wave, but at different rates. The initial buffer values are chosen as a function of the desired sound type. Plucked strings, with high partials, are best obtained if the circular buffer is filled with random values. As these are periodically repeated, the result is not noisy or hissing and, without decay algorithm, sounds like a reed organ. With the decay algorithm, it will sound like a plucked string. Using a different random buffer for each note adds a small variation to notes of the same pitch, resulting in even more natural sounding tones.

The implementation of the algorithm Yt = 1/2(Yt-p+Yt-p-1) is made extremely efficient by use of bit shifting operators. Multiplication is not necessary. Thus the technique can provide impressive real-time performance without loss of quality. (Karplus et al. 1989: pp. 467-480)

The process of averaging can be further specified by stretching the process in time, adding a roughness factor to control the range between pitch and noise, or combinations of both. (Jaffe et al. 1989: pp. 481-494)


Suggested Reading

Karplus, K., and A. Strong 1983.
"Digital Synthesis of Plucked-String and Drum Timbres."
Computer Music Journal 7(2):43-55.
Reprinted in C.Roads, ed. 1989.
The Music Machine.
MIT Press, pp. 467-480.

Jaffe, David A. and Julius O. Smith 1983.
"Extensions of the Karplus-Strong Plucked-String Algorithm."
Computer Music Journal 7(2).
Reprinted in C.Roads, ed. 1989.
The Music Machine.
MIT Press, pp. 481-494.


15_01_1

additional parameters: none

In instrument 1 PLUCK uses a set of random numbers, made by PLUCK itself, while in instrument 2 the table f77 is created from the soundfile "Sflib/10_02_1.SF". This soundfile also contains random numbers, but gives additional control over the bandwidth of the noise. For both instruments the cyclic buffer of PLUCK contains 128 numbers and the chosen decay method is simple averaging. From each instrument two notes with a duration of a second are played.

NB: The instrument has no envelope to give the net impression of this unit generator.

Suggestions:

Use other audio soundfiles as well.

[flowchart]

Orchestra, Score and Sample

WAV and mp3


15_01_2

additional parameters: ibuf, if1

The EXPSEG envelope adds a decay pattern to the tones. The first section plays two PLUCK-made tones. In the second and third section, we use 10 different noise tables. The noises' bandwidth descends from 10000 Hz to 25 Hz in each section.

[flowchart]

Orchestra and Score

WAV and mp3


15_01_3

additional parameters:

This differs from 15_02_1 only by the type of envelope used: LINSEG. Linear decay has a distorting effect: it seems to decay like an event with a longer duration and then disappears all too suddenly.

As in the previous example, we apply a number of noises tables with different bandwidths to PLUCK's table input.

In the third section, we used a larger internal buffer: ibuf is 1024.

[flowchart]

Orchestra and Score

WAV and mp3


15_01_3B

additional parameters: ibuf, if1

One noise has been selected for further investigation: f73 (bandwidth is 2500 Hz). This noise yields the best quality of a plucked string tone.

Notes of various duration and frequency.

[flowchart]

Orchestra and Score

WAV and mp3


15_01_4

additional parameters: ibuf, if1, if2, igliss

A pitchbend mechanism implemented with an EXPSEG unit generator. The pitchbend ratio can be varied by the variable igliss. The right and left channel use different source soundfiles for PLUCK to produce subtle differences.

[flowchart]

Orchestra and Score

WAV and mp3


Return to main index
jpff@cs.bath.ac.uk
Last modified: Sun Feb 26 13:32:52 GMT 2006