Electric Guitar Synthesis using the Extended Karplus-Strong Algorithm in ChucK

Music 220: Computer-Generated Sound (Autumn 2008-2009)






















Project Vision

Implement an Extended Karplus-Strong algorithm to synthesize electric guitar timbers with distortion and feedback in ChucK.


Karplus Strong Algorithm

The process of the algorithm begins by filling a delay line with white noise. A low pass filter is then attached to the output which is fed back to the delay line.

The resulting frequency-dependent decay is reminiscent of a plucked string.



Low pass filter

The prescribed 3-point low pass filter is given as:

                                                   y(n) = a0*x(n) + a1*x(n-1) + a0*x(n-2),  where a1>= 2a0 >= 0.


DC offset filter

Because of the problems relating to DC offset, a DC offset filter is introduced to avoid low frequency energy overflow and loss of precision.

The DC blocking filter is given as:

                                                  y(n) = a0*x(n) + a1*x(n-1) + b1*y(n-1),     where a0 = 1/ (1 + wco/2), a1 = - a0, b1 = a0(1- wco/2),

and wco is a cut-off frequency given as 2pi f0/10 (Sullivan 1990)


Wave Shaping Distortion

Distortion transfer functions that provides soft clipping, as is characteristic of tube amplifiers, is given as:

(a)              Clipping Cubic Nonlinearity                                                (b)    y(x) = atan(x)

                                           y(x) =  2/3, x >= 1;  x -x^3/3,  -1 < x < 1;  -2/3,  x <= -1        


    *The degree of distortion is controlled by adjusting a pre-distortion gain factor, Amplifier Feedback Gain factor and Amplifier Feedback Delay Length.




When the amplifier excites a string an oscillation grows at the fundamental frequency or one its harmonics to produce feedback. The result can be useful for

achieving sustained notes and unique timbre effects. A feedback gain factor controls the feedback gain directly. The speaker-string distance is specified as a

frequency corresponding to the length of the feedback loop. This frequency influences the feedback gain as well as the favored harmonics (Sullivan 1990).

In reality, the feedback length is determined by the length and frequency of the note.



Use the JCRev algorithm developed by John Chowning by adjusting reverb wet/dry amount.


Bending String

Bending String is implemented by smoothly adjusting the length of the delay-line by samples.


Audio Examples

Clean Karplus-Strong:  ks_sample.wav

Karplus-Strong with Delay and Feedback: ks_d&f_sample.wav


ChucK Source Code

Clean Karplus_strong:

Karplus-Strong with Delay and Feedback: ks_d&


              Home Page