bowed string (e.g. violin) synthesis algorithm

561 views Asked by At

Is there a well known algorithm for synthesising bowed string instruments (e.g. violins)?

I know for plucked strings (e.g. guitars) there's the karplus-strong algorithm, which I have succesfully implemented in the past.

Ideally I would like an algorithm describing a computer program for generating/synthesizing the digital signal.

For example, the karplus-strong algorithm can be summerized as follows:

  • Determine the period length of the frequency you want to synthesize and create a buffer of exactly that size

  • Fill the buffer with random numbers (white noise)

  • Iterate over the buffer, each time average each poitn with the next point then outputting it to the output stream.

  • Repeat for the desired amount of time while applying some damping

I wonder if something similar exists for bowed strings.

Footnote:

Now, I know nothing about the physics of how strings produce the sound, so I have no idea how one would derive such an algorithm. For the karplus-strong algorithm, I simply read it in the original paper and applied it "blindly". I would have never guessed that starting with a while noise and continuously damping it would produce a sound so similar to a plucked string.

EDIT:

As usual, the close parade has started.

Before voting to close this question, please consider the following:

  • This question is not about physics. It's not about the mechanics of the string vibration or interaction with the bow and air to produce the sound.

  • This question is about the existence of a specific well known algorithm to synthesize the sound. It's strictly a question about programming.

2

There are 2 answers

2
josephvictory On

Weirdly i was able to find some stuff on this on the Stanford chuck website.

The code is written in a language called ChucK which is apparently specific for audio programming. You will have to run to use this code snippet. But here is its implementation in chuck:

// patch
Bowed bow => dac;

// scale
[0, 2, 4, 7, 8, 11] @=> int scale[];

// infinite time loop
while( true )
{
    // set
    Math.random2f( 0, 1 ) => bow.bowPressure;
    Math.random2f( 0, 1 ) => bow.bowPosition;
    Math.random2f( 0, 12 ) => bow.vibratoFreq;
    Math.random2f( 0, 1 ) => bow.vibratoGain;
    Math.random2f( 0, 1 ) => bow.volume;

    // print
    <<< "---", "" >>>;
    <<< "bow pressure:", bow.bowPressure() >>>;
    <<< "bow position:", bow.bowPosition() >>>;
    <<< "vibrato freq:", bow.vibratoFreq() >>>;
    <<< "vibrato gain:", bow.vibratoGain() >>>;
    <<< "volume:", bow.volume() >>>;

    // set freq
    scale[Math.random2(0,scale.size()-1)] + 57 => Std.mtof => bow.freq;
    // go
    .8 => bow.noteOn;

    // advance time
    Math.random2f(.8, 2)::second => now;
}

Edit: The above is just the implementation, the source file for it is here.

0
hasen On

Not an algorithm, but there's an open source library (under a very liberal license) that implements synthesis algorithms in C++ for several instruments, including bowed strings.

The Synthesis ToolKit (STK)

Official homepage: https://ccrma.stanford.edu/software/stk/

Github link: https://github.com/thestk/stk

Files with code relevant to synthesis of bowed string instruments:

The comments in the code make references to two papers:

Julius Smith also has information about bowed string synthesis available on his (standford) website:

Bowed Strings section of the "Physical Audio Signal Processing" book

MUS420 Lecture Digital Waveguide Modeling of Bowed Strings