Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

Customizing the STK for Development

At this point, one may read the file ~/stk/stk/INSTALL to find out how to configure and compile the STK. However, for Linux users with ALSA sound driver support, the following simplified procedure can be followed.

Download the file stk4p2p1josoverlay.tar.gz and unpack it as follows (assuming ~/stk/stk/ contains release 4.2.1 of the STK as prescribed above):

 
$ cd ~/stk 
$ # copy josoverlay package to current directory, \eg,
$ scp -d ccrma-gate.stanford.edu:~jos/Web/stk4p2p1josoverlay.tar.gz .
$ tar -zxf stk4p2p1josoverlay.tar.gz
$ cp -rp stk4p2p1josoverlay/* stk/

Notice that one new directory (~/stk/stk/myproj) has appeared. This directory is logically parallel to the STK projects directory. It is kept separate so that it can be easily copied into new releases of the STK.

Now, as described in the new file ~/stk/stk/INSTALL.jos, to configure and compile the STK, just type, in the directory ~/stk/stk/,

 
make config
make

The top-level Makefile, from the overlay, contains the new ``make config'' target:

 
config:
       configure --enable-debug --with-alsa RAWWAVE_PATH="../../rawwaves/"

The configure command generates all the various MakefilesA.2 based on automatically detected characteristics of your system [501]. The file INSTALL contains more detailed installation instructions which you should not need under UNIX if you are following this example. On the other hand, it is good to read INSTALL and README for your general edification. Similarly, the doc/ directory should be explored to learn about the STK in general.

Thus, make config uses the following configuration options:

  1. The C++ compiler flags were modified for software developers:

  2. Support is enabled for the Advanced Linux Sound Architecture (ALSA)--an Application Programming Interface (API) for sound, which will be included in future Linux kernel release, and which has been included with Planet CCRMA for some time.

  3. To enable support for the jack audio server, replace ``-with-alsa'' by ``-with-jack''. The jack server owns the audio I/O, and provides connection services among multiple client applications. If you do not already start the jack server on your Linux system, you can do it with the following command line:
     
    jackstart -R -d alsa -d hw -r 44100 &
    
    The jack audio server is also included in the Planet CCRMA distribution.

  4. The path to the rawwaves directory has been changed from ../rawwaves to ../../rawwaves. This makes it work for programs located in directories such as myproj/someproject/. (It is also possible to set the rawwaves path at run time with a message to the Stk object, like setting other global variables such as the sampling rate.)

Finally, to test out the added myproj directory, in the ~/stk/stk directory, type

 
cd myproj
make
The default make target in the myproj directory is test. Therefore, you should hear test sound emitted after each subdirectory is made. Before the tests are compiled, however, the STK library is made, so first you see the many library files being compiled. (See the various Makefiles regarding how this is carried out.) If you do not hear the test sounds, read myproj/delay/README for some trouble-shooting tips.



Subsections
Next  |  Prev  |  Up  |  Top  |  Index  |  JOS Index  |  JOS Pubs  |  JOS Home  |  Search

[How to cite and copy this work] 
``Physical Audio Signal Processing for Virtual Musical Instruments and Digital Audio Effects'', by Julius O. Smith III, (December 2005 Edition).
Copyright © 2006-07-01 by Julius O. Smith III
Center for Computer Research in Music and Acoustics (CCRMA),   Stanford University
CCRMA  [Automatic-links disclaimer]