Karplus-Strong String Synthesis

We decided to accurately model an acoustic guitar that would output sound signals based on the Karplus-Strong algorithm for the plucked string signal synthesis. The guitar should essentially be a recreation of the acoustic guitar, but with additional features that would otherwise be impossible in the conventional guitar. To accurately model an acoustic guitar, we would require a somewhat realistic simulation of fretting and plucking of the strings, as well as to create a semblance of the acoustic guitar body. The Karplus-Strong algorithm produced sound should also resemble closely the sound of the actual acoustic guitar. Also, we required our final product to be portable and not too heavy, which would then influence the design and electrical components of our final guitar.

Karplus-Strong Synthesis - MUMT618 Project - Google …

We have encountered the Karplus-Strong algorithm in Example . A practical implementation of the algorithm is shown in Figure ; it is a quite peculiar filter structure since it has no input! Indeed assume there are delays in cascade and neglect for a moment the filter (); the structure forms a feedback loop in which the values are endlessly cycled at the output. By loading the delay units with all sorts of finite-length sequences we can obtain a variety of different sounds; by changing we can change the fundamental frequency of the note.


Karplus-Strong synthesis – Synthtopia

My first attempt at synthesizing a handpan sound involved implementing the Karplus-Strong algorithm

Karplus Strong was refined to a computer algorithm in the 1980s, to control some of the less stable elements of this loose signal flow. Pitch tracking is one of the less predictable functions in such a routing, with the pitch of the output tone determined by the delay time. Controlling the frequency of the resulting tone is not as simple as using a 1 Volt per Octave keyboard or sequencer, as we see in our example.


Sound and Music - The Karplus-Strong Algortihm


With regards to speed of execution, there are two paradigms to be concerned with. The first is concerning the response time from a pluck of a string to the sounding of a note. For proper user interactivity, this must be suitably close such that there is the illusion that one is indeed plucking the string. In this respect, our guitar performed excellently, with a little to no lag time between the pluck and the sound signal. This is because we allow the sampling of the strings to be at 1ms, and consequently also prevent the buzz sound due to multiple vibrations via a cooldown period. The second concern was that of the execution speed of the processes within the interrupt. If the processing time required between interrupts is longer than the period of the clock tick, then we would experience a decrease in the clock speed, especially with timer 0, which would result in a erroneous production of the resultant tone frequencies. We faced this problem initially when we were developing our code, as we placed the calculations within timer 0 interrupt. As the number of computations increased when we tried to simultaneously calculate more strings, our tone frequencies began flat. To recitfy the problem, we placed the Karplus-Strong calculations into the timer 1 interrupt, attempted to remove redundant code and also used a 20MHz crystal instead of a 16MHz crystal. This eventually gave us the capability to simultaneously run the algorithm for the 6 strings and give proper operation of the guitar.

An instrument is physically modeled and simulated


The Karplus-Strong algorithm was implemented within the interrupt of timer 1. The determination of the pitch is based on the delay line length, which is obtained from the specific string plucked and the relevant pluck position obtained from previously mentioned functions. With the delay line length determined, the each step of the algorithm is then implemented for every interrupt of timer 1 (20MHz) where an original value within the delay line is substituted with a new value based on the difference equation of the loop filter, y(n) = 0.5[x(n) + x(n-1)]. At the end of the delay line, the pointer to the delay line is reset to the start. This is done for all 6 strings, which puts considerable processing-time strain per interrupt, which is why we spent a significant amount of time streamlining our code and also opting for a faster crystal of 20MHz. The resultant signal from the 6 separate strings are summed together and scaled down accordingly before being fed out via the PWM as an audio signal.

Free Chemistry Essays and Papers - 123HelpMe

The sampling of the push buttons is simple and is carried out by functions getFret(), pluck() and modulate(). getFret() is the basic function which samples the push buttons inputs to determine any depressed button position for a specific string. pluck() and modulate() both call upon getFret for the current sampling of the push buttons. pluck() basically initializes a white noise input based on a master copy of white noise that was created during initialization, which will then be subjected to the Karplus-Strong algorithm. modulate() obtains the new positions of the push button depress and modifies the delay length of the Karplus-Strong algorithm (explained in the next subsection).