Wolfram Language

Computational Audio

Synthesize the Sound of a Vibrating String

Perform KarplusStrong synthesis by adding a short delay with a high feedback value to a burst of noise. This will simulate the sound of a vibrating string.

In[1]:=
Click for copyable input
freq = 60; feedback = 0.99; AudioDelay[AudioGenerator["Pink", .01], 1/freq, feedback, 1, PaddingSize -> 5, Method -> {"LowpassCutoff" -> Quantity[8000, "Hertz"]}]
Out[1]=

Simulate the strumming of a chord.

In[2]:=
Click for copyable input
chord = {130.81, 164.81, 196, 261.62};
In[3]:=
Click for copyable input
Table[AudioDelay[ AudioPad[AudioGenerator["Pink", .01], {RandomReal[.2], 0}], 1/chord[[i]], feedback, 1, PaddingSize -> 5, Method -> {"LowpassCutoff" -> Quantity[8000, "Hertz"]}], {i, Length[chord]}] // Mean
Out[3]=

Related Examples

de es fr ja ko pt-br ru zh