Physical modeling of acoustic instruments
Artifastring ("artificial fast string") is a highly optimized physical simulation of a violin for sound synthesis.
Source code: http://percival-music.ca/artifastring/
To make a real-world analogy, Vivi is the violinist, while Artifastring is the violin. Artifastring can be used without Vivi, and Vivi could play violins other than Artifastring (if I had other simulations available).
Consider the wave equation for a stiff string:
The truly important part is y(x,t) – this is the position of the string at position x at time t. We are interested in a modal solution:
... skipping over a lot of physics and mathematics...
- The external forces F(x,t) come from the violinist – the bow force and finger force.
- If we know the physical constants and external forces, we can calculate the "wiggle" of a violin string.
- The amount of "wiggle" is transferred to the violin body via the bridge.
- We can imitate the violin body’s influence by convoluting the bridge signal with the impulse response of the body.
- The output is our sound!
If you are interested in the physics and math, see:
The physical simulation used by Artifastring is not the most accurate version known to researchers. Actually, it might be fair to say that every single aspect of this simulation is known to be inaccurate!
However, my goal was not to advance the state of musical acoustics. My background is philosophy, music, and computer science – I’m not a physicist. I have enormous respect for people who do experimental science, but the last time I did any measurements of the real world was back in 1997, in high school.
This physical simulation was chosen because:
- The PhD thesis and conference paper gave a complete algorithm – there were no missing steps or assumptions that the reader already knew how to do portions of the simulation.
- There were sound (and video!) examples of the output, so I knew that final sound would be worth it.
Despite using a simple simulation, it still took us approximately 200 hours to get it working. It was great fun, and I learned a lot about digital signal processing programming and physics – but I don’t regret picking an "inaccurate" simulation. This one was enough work.
Vivi’s violin isn’t the best that science can offer, but it’s good enough to start practicing with. :)