Blog - PSP Guitar

Added on Tuesday, 2010-06-08 11:52 CEST in category Programming
Besides the PSP Tone Generator, you can now also find PSP Guitar in the downloads section. PSP Guitar is a guitar synthesizer that supports notes from octave 2 till 6 (inclusive), with support for flat (♭) and sharp (♯) notes. See the projects page for key bindings.

If you don't have a PSP, you can also check out a short sample.

PSP Guitar uses the Karplus-Strong algorithm for emulating the physical properties of a snare. When a string is plucked (a new note starts), a buffer with a length of 1/frequency seconds is filled with white noise. On every next iteration, the current value is averaged with the next value, and slightly decayed.

For the sound buffer I made use of a linked list. This avoids hassling with modulo over different buffer lengths. However, the implementation still makes use of an array, making sure the memory area used is contiguous. It also allows for free()'ing the entire memory area of the linked list at once by keeping an extra pointer to the start of the array.