Applied Math for Creative Coders
  1. Math Models for Creative Coders
  2. Media
  3. The Karplus-Strong Guitar Algorithm
  • Math Models for Creative Coders
    • Tools and Tech
      • Tools and Installation
      • Starting up Sound
      • Adding Libraries to p5.js
      • Using Constructor Objects in p5.js
      • The Open Sound Protocol
    • Maths
      • Complex Numbers
      • Vectors
      • Matrix Algebra Whirlwind Tour
      • Things at Right Angles
    • Systems
      • Frequency and Time Domains
      • Phasor Diagrams
      • Sampling And Aliasing
      • Fourier Series and Fourier Transform
      • Filters
      • Convolution
    • Geometry
      • Movement and Animation
      • Circles
      • Fractals
      • Affine Transformation Fractals
      • L-Systems
      • Kolams and Lusona
    • Media
      • Additive Sound Synthesis
      • FM based Sound Synthesis
      • Making Noise Predictably
      • The Karplus-Strong Guitar Algorithm
      • A Sound Glossary
    • AI
      • Working with Neural Nets
      • The Perceptron
      • The Multilayer Perceptron
      • MLPs and Backpropagation
      • Gradient Descent
      • AI by Hand
    • Projects
      • Projects

On this page

  • Inspiration!
  • What is the Karplus-Strong Algorithm?
  • What is a Delay Line?
  • What is Feedback Oscillation?
  • Karplus-Strong Guitar in Code
  • References
  1. Math Models for Creative Coders
  2. Media
  3. The Karplus-Strong Guitar Algorithm

The Karplus-Strong Guitar Algorithm

Delay Lines
Resonators
Noise
Published

March 22, 2024

Modified

December 30, 2025

Error in `theme_set()`:
! could not find function "theme_set"

Inspiration!

Here is the GUI for a guitar created in JavaScript (not p5.js).

What is the Karplus-Strong Algorithm?

What is a Delay Line?

What is Feedback Oscillation?

Karplus-Strong Guitar in Code

Let us code up our guitar and see how it works!

  • p5.js
  • R

References

  1. Karplus, K., & Strong, A. (1983). Digital Synthesis of Plucked-String and Drum Timbres. Computer Music Journal, 7(2), 43. doi:10.2307/3680062. https://sci-hub.se/https://doi.org/10.2307/3680062
  2. Julius O. Smith. PHYSICAL AUDIO SIGNAL PROCESSING FOR VIRTUAL MUSICAL INSTRUMENTS AND AUDIO EFFECTS. https://ccrma.stanford.edu/~jos/pasp/pasp.html
  3. Euphonics: The Science of Musical Instruments.https://euphonics.org/about/
  4. Karplus-Strong Guitar in PureData (pD). https://youtu.be/xEpbMWpz65E?si=Mkz-eQ4UTMrYR3Fu
  5. Amid Fish.(May 2017). Karplus Strong String Synthesis. http://amid.fish/karplus-strong
R Package Citations
Package Version Citation
ambient 1.0.2 Pedersen and Peck (2022)
mosaicCalc 0.6.4 Kaplan, Pruim, and Horton (2024)
plot3D 1.4.2 Soetaert (2025)
Kaplan, Daniel T., Randall Pruim, and Nicholas J. Horton. 2024. mosaicCalc: R-Language Based Calculus Operations for Teaching. https://doi.org/10.32614/CRAN.package.mosaicCalc.
Pedersen, Thomas Lin, and Jordan Peck. 2022. ambient: A Generator of Multidimensional Noise. https://doi.org/10.32614/CRAN.package.ambient.
Soetaert, Karline. 2025. plot3D: Plotting Multi-Dimensional Data. https://doi.org/10.32614/CRAN.package.plot3D.
Back to top

Citation

BibTeX citation:
@online{2024,
  author = {},
  title = {The {Karplus-Strong} {Guitar} {Algorithm}},
  date = {2024-03-22},
  url = {https://mathforcoders.netlify.app/content/courses/MathModelsDesign/Modules/35-Media/100-KarplusStrong/},
  langid = {en}
}
For attribution, please cite this work as:
“The Karplus-Strong Guitar Algorithm.” 2024. March 22, 2024. https://mathforcoders.netlify.app/content/courses/MathModelsDesign/Modules/35-Media/100-KarplusStrong/.
Making Noise Predictably
A Sound Glossary

License: CC BY-SA 2.0

Website made with ❤️ and Quarto, by Arvind V.

Hosted by Netlify .