The simplest form of string synthesis is perhaps the Karplus-Strong algorithm (https://en.wikipedia.org/wiki/Karplus%E2%80%93Strong_string_...). Instead of simulating the motion of all parts of the string for each timestep, it simplifies it to a perfect transmission of motion, except at the end of the string where some function will be applied that captures the losses from the motion, typically by performing a simple low-pass filter. Computationally it is very efficient: just a few FMA operations per sample. The drawback is that you need a buffer to store the state of the string, which can be quite large (especially for low frequencies which correspond to long strings), and you need to read and write to different parts of this buffer. Thus, if you are simulating multiple strings, it's more likely that memory bandwidth will be the bottleneck instead of raw compute power.
I actually tried doing it as a Vulkan compute shader, continuously simulating 128 strings (all possible MIDI notes). It didn't work very well. While the latency was tolerable, it was slower than doing the same on the CPU (although this was with an integrated GPU, not a dedicated card).
Does it take nonlinearity of strings into account? In the demo I can't really hear it and to me it ends up sounding like the comb filter synths you get without it.
Dev here! No, this version is an ideal string - no stiffness. Just meant to provide a fun and different way to think about sound design, rather than realistic string sounds (so the physical modelling branding is a bit of a misnomer). But it sounds pretty good I think! You can get some inharmonicity via numerical dispersion by reducing the accuracy (but in the wrong direction). I have a few other devices in the pipeline, at least one of which should include stiffness.
Physical strings have some stiffness and it causes overtones to not have perfect integer ratios of frequency. It's one of many things to consider that makes it sound a bit more natural.
Considering that there's a pickup in the model, air doesn't matter. And in typical string instruments the loud part you mostly hear is coming from sound box through bridge, not from strings themselves.
The simplest form of string synthesis is perhaps the Karplus-Strong algorithm (https://en.wikipedia.org/wiki/Karplus%E2%80%93Strong_string_...). Instead of simulating the motion of all parts of the string for each timestep, it simplifies it to a perfect transmission of motion, except at the end of the string where some function will be applied that captures the losses from the motion, typically by performing a simple low-pass filter. Computationally it is very efficient: just a few FMA operations per sample. The drawback is that you need a buffer to store the state of the string, which can be quite large (especially for low frequencies which correspond to long strings), and you need to read and write to different parts of this buffer. Thus, if you are simulating multiple strings, it's more likely that memory bandwidth will be the bottleneck instead of raw compute power.
So doing it on a big GPU would be pretty helpful. I wonder if anyone has used CUDA for this, or if any hardware synths have GPUs.
I actually tried doing it as a Vulkan compute shader, continuously simulating 128 strings (all possible MIDI notes). It didn't work very well. While the latency was tolerable, it was slower than doing the same on the CPU (although this was with an integrated GPU, not a dedicated card).
The time it takes to get data to/from the GPU is problematic given the sample rate you need to deliver.
Anukari used the GPU but eventually abandoned it for the CPU. They have some good and informative blog posts about it.
I'm wondering if Pianoteq [0] works similarly.
[0] https://www.modartt.com/pianoteq_overview
Awesome LaTeX-inspired webdesign btw.!
Does it take nonlinearity of strings into account? In the demo I can't really hear it and to me it ends up sounding like the comb filter synths you get without it.
Dev here! No, this version is an ideal string - no stiffness. Just meant to provide a fun and different way to think about sound design, rather than realistic string sounds (so the physical modelling branding is a bit of a misnomer). But it sounds pretty good I think! You can get some inharmonicity via numerical dispersion by reducing the accuracy (but in the wrong direction). I have a few other devices in the pipeline, at least one of which should include stiffness.
I’m super curious what that would sound like. Could you elaborate on the non linearity part?
Physical strings have some stiffness and it causes overtones to not have perfect integer ratios of frequency. It's one of many things to consider that makes it sound a bit more natural.
This simulates the displacement of the string, but the hard part seems to be to simulate how that string affects the air and induces a sound.
Why is that harder? Because require solving PDEs, aren't they?
Considering that there's a pickup in the model, air doesn't matter. And in typical string instruments the loud part you mostly hear is coming from sound box through bridge, not from strings themselves.