Songlib: The C Library for Music Composition

written by: John C. Lusth

Revision Date: May 3, 2017

Printable Version

Mac installation instructions

Begin the installation process by downloading the songlib source tarball into a directory named songlib:

    mkdir ~/songlib
    cd ~/songlib
    curl -O

Then, unpack the tarball:

    tar xvfz *.tgz

If /usr/local/bin/ is not in your path, then you should add it. See the web for instructions on how to add a directory to the PATH environment variable.

Create the /usr/local/bin/ directory, if it doesn't already exist:

   sudo mkdir -p /usr/local/bin/

Move into the songlib directory and then into mac directory and install wget:

    cd ~/songlib/mac
    chmod +x wget
    sudo cp wget /usr/local/bin

If you want to use additional songlib instrument sample packs, install flac:

    cd ~/songlib/mac
    open flac-1.2.1.dmg

Open up the flac folder on your desktop, double click on the installation icon, and follow the instructions.

At the bottom of the file ~/.bash_profile, add the lines:

    export WAVPLAYER=afplay
    export PATH=~/bin:/usr/local/bin:$PATH:.

Log out of your computer and log in again for these changes to go into effect.

Finally, build and install the library, build and install the utilities, and install the default sample note files by typing the command:

    sudo make install

while in the songlib directory.

To test your installation, move into the quickstart directory and type make play:

    cd quickstart
    make play

You should see the song being constructed and then should hear it begin to play.