Applied Math for Creative Coders
  1. Math Models for Creative Coders
  2. Media
  3. The Karplus-Strong Guitar Algorithm
  • Math Models for Creative Coders
    • Maths Basics
      • Vectors
      • Matrix Algebra Whirlwind Tour
      • Things at Right Angles
      • content/courses/MathModelsDesign/Modules/05-Maths/70-MultiDimensionGeometry/index.qmd
    • Tech
      • Tools and Installation
      • Adding Libraries to p5.js
      • Using Constructor Objects in p5.js
      • The Open Sound Protocol
    • Geometry
      • Circles
      • Complex Numbers
      • Fractals
      • Affine Transformation Fractals
      • L-Systems
      • Kolams and Lusona
    • Media
      • Fourier Series
      • Additive Sound Synthesis
      • Making Noise Predictably
      • The Karplus-Strong Guitar Algorithm
    • AI
      • Working with Neural Nets
      • The Perceptron
      • The Multilayer Perceptron
      • MLPs and Backpropagation
      • Gradient Descent
    • 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

July 22, 2025

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.1 Soetaert (2024)
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. 2024. 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/99-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/99-KarplusStrong/.
Making Noise Predictably
AI

License: CC BY-SA 2.0

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

Hosted by Netlify .