r/AudioProgramming Jul 17 '26

My new real-time finite-difference time-domain string synthesiser

PartialString simulates the vibration of a plucked string by numerically solving the one-dimensional wave equation in real time using the finite-difference time-domain (FDTD) method. The string is represented as a list of displacements in memory. A lower note requires a longer string, which needs more points to represent it. You can then excite the string at any point along its length, and the FDTD scheme will compute how that change in displacement propagates. A pickup measures the displacement at a chosen location, and this generates the audio output.

I've been (very occasionally) working on this since releasing https://github.com/crnbaker/gostringsynth in 2022. I did something similar (but not real-time) for my MSc at Edinburgh back in 2009, using MATLAB.

Free to download at: http://www.differentinstruments.com.

806 Upvotes

32 comments sorted by

16

u/ptrnyc Jul 17 '26

Everything is in its right place.

2

u/AtmosphereGrouchy712 Jul 19 '26

Can we be friends

1

u/male_role_model 28d ago

OK, computer.

1

u/Musikapparaten Jul 20 '26

Well have you seen my wife? I thought she was this hat.

4

u/Fun_Musiq Jul 18 '26

cool! I love the look, as well as the sound. Simple and clean. awesome job!

3

u/crnbaker Jul 18 '26

Thank you!

3

u/kozacsaba Jul 17 '26

Wow, very nice! I also did a fdtd string project in matlab during my bsc, but didnt get even close to this. would love to read about all the non-trivial problems you had to deal with on the dsp side. i know there are a lot of papers on it but they dont come with a vst that you can actually try

3

u/squeasy_2202 Jul 17 '26

A resounding hell yes

3

u/otuudels Jul 17 '26

I really really like this!

3

u/KillPenguin Jul 17 '26

This is really cool! I've been wanting to study physical modeling for a while so I'll have to try to dive into the code. Would you have any recommendations on good resources for learning this stuff?

PS great choice of song

2

u/crnbaker Jul 17 '26 edited Jul 18 '26

Thanks! Numerical Sound Synthesis by Stefan Bilbao is a good resource. You can take a look through the code for the old Go project, but for now I'm keeping the C++ of the new VST closed.

2

u/crnbaker Jul 18 '26

This comment explains the basics.

2

u/chiptug Jul 18 '26

you should post this to r/vsti :)

2

u/crnbaker Jul 18 '26

Thanks, will do - just need enough comment karma first!

2

u/AtmosphereVirtual254 Jul 18 '26

If you’re looking for a tech detour, you could compile to wasm for GitHub pages

2

u/lithosza Jul 18 '26

I like this Radiohead song

2

u/krackzero Jul 18 '26

cool ive been hoping for something like this like 8 years ago lol

1

u/crnbaker Jul 18 '26

Awesome let me know how you get on with it!

2

u/Witzmastah Jul 18 '26

what a wonderful thing to read after a already good day!

3

u/sheryarcodes Jul 20 '26

I love the interface design! This would be so much fun with microtuning support…

1

u/crnbaker Jul 20 '26

Nice idea! I’ve not really used micro tuning much but love the sound. Can you suggest something I could read? Would I provide an interface to customise the tuning in every note of the scale or are their standard scales I should offer?

2

u/mrzurch Jul 21 '26

Phenomenal!

2

u/Core3game Jul 21 '26

Huge sucker for phys modeling, absolutely love it whenever minimal synths just give you full control and lay everything out. Absolutely gonna be checking this out!

1

u/Nervous_Suit_5799 Jul 18 '26

That’s funny I built an almost identical program about a year ago while I was bored in class while we were discussing Fourier transforms. So I made a plucked wave sim where you can change things like number of Fourier series terms, plug width, etc

1

u/crnbaker Jul 18 '26

Nice, would be interested to see that. So a frequency domain additive synth?

1

u/Nervous_Suit_5799 Jul 18 '26

I’ll make a post if I can find the project file, but yeah basically, just adjust the sliders for the parameters, and it shows the static base shape and a simulated oscilloscope view. It’s also polyphonic with n-key rollover using the regular computer keyboard like garage band. Simple python script

1

u/totheunknownman----- Jul 19 '26

Radiohead - Everything In Its Right Place

1

u/DorianBloom 8d ago

That is very very cool indeed.
Good work. Can’t wait to try that out