This first simple example is a simple plucked string along the lines described in §4.6. As introduced in Appendix A, the programming language is C++, and we make use of the Synthesis Tool Kit (STK) [85,90]. While we typically use the matlab language for sound analysis work [449], the C++ language and the STK library are better suited for developing real-time prototypes of virtual musical instruments and audio effects. Another advantage of C++ implementations is that they are readily ported over to standard plugin architectures such as VST and LADSPA/DSSI.
The first listing below is a simple main program, main.cpp, followed by discussion of how it works. The second listing gives the plucked-string object itself, SimpString, followed by some discussion. The component STK modules are described in the STK Class Documentation.