Solving the Sound of a Guitar String
Source Code

Jason Pelc
December 10, 2007

The code linked to this page is part of a report submitted as coursework for Physics 210, Stanford University, Fall 2007. It is written in C and posted as the tarball guitar.tar.gz. The instructions for compiling with gcc under linux and running are

                  tar -zxf piano.tar.gz
                  ./runwavefiles.sh
    

This code invokes the libsndfile libraries to generate .wav files. These libraries, obtained from www.mega-nerd.com/libsndfile are posted here as the tarball libsndfile-1.0.17.tar.gz. The compilation instructions are

                  tar -zxf libsndfile-1.0.17.tar.gz
                  cd libsndfile-1.0.17
                  ./configure
                  make
                  make install
    

The default installation directory is /usr/local/lib. Under some unix distributions (e.g. Fedora Core 5) ld is not set up to look in /usr/local/lib. Running the executable will then result in a message like "error while loading shared libraries libsndfile.so.1: cannot open shared object file: No such file or directory." The simplest solution to this problem is to create a soft link in a directory that ld searches, for example

                  cd /usr/lib
                  ln -s /usr/local/lib/libsndfile.so.1.0.17 libsndfile.so.1
    

© 2007 Jason Pelc. The author grants permission to copy, distribute and display this work in unaltered form, with attribution to the author, for noncommercial purposes only. All other rights, including commercial rights, are reserved to the author.