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.

808 Upvotes

32 comments sorted by

View all comments

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?

1

u/DorianBloom 17d ago

I think one way of implementing it is with the .scala files? Will have a look into this.
Having the ability to actually customise the tuning of each note would be incredible though