The STK library and demos were built above when make was type in the top-level directory (assuming the JOS Overlay was installed). Here we look a little closer at what was going on there--also, this is how you do it if you don't have the JOS Overlay installed. First we build the STK library, stklib.a, and then build and try out a demo:
$ cd ~/stk/stk/src
$ make
g++ -g -Wall ... -c Stk.cpp -o Debug/Stk.o
g++ -g -Wall ... -c Noise.cpp -o Debug/Noise.o
...
/bin/rm -f libstk.a
ar -rsc libstk.a Debug/*.o
$
$ cd ../projects/demo
$ make
g++ -g -O2 -Wall ... -c ../../src/Stk.cpp -o Debug/Stk.o
g++ -g -O2 -Wall ... -c ../../src/Generator.cpp -o Debug/Generator.o
...
g++ -g -O2 -Wall ... -o Md2Skini Md2Skini.cpp Debug/Stk.o
Debug/RtMidi.o -lasound -lpthread -lm
$ Physical.bat
(Yes, the .bat files are executable files, even under UNIX.)
The file
wish < tcl/Physical.tcl | demo Clarinet -or -ipThe program wish is a UNIX shell supporting Tcl/Tk commands for constructing a graphical user interface (GUI) [342]. If you have Tcl/Tk installed, the wish program should be available. Say ``man wish'' to find out more about it. If you don't have it, yum install tk will install it on a Fedora system.A.4
After invoking Physical.bat, you should be looking at a GUI which presents a number of buttons and sliders, as shown in Fig.A.1. Press the NoteOn button, and you should hear a pleasant woodwind-like sound. Try increasing the vibrato amplitude with the Vibrato Amplitude slider. Next, play with the Breath Pressure slider to see how the instrument responds.
If you get an alert panel about a ``broken pipe'', this is a message from the Tcl/Tk shell (wish) that usually means the demo program exited immediately because it didn't like the i/o resources it found. For example, this will happen if there are not at least two audio input channels (an odd requirement that applies even to demos that don't use audio inputs). It will also happen if the requested sampling rate is not supported by your sound hardware.A.5
It can be useful to be aware that the jackd command line is
written to the file ~/.jackdrc by qjackctl when you
select the ``Save'' button in the ``Setup'' window and restart the
JACK server. (The ``JACK daemon'' jackd is the actual
server program started by qjackctl.) For example,
the jackd startup command for a Linux system using an
internal AC-97 CODEC chip for sound I/O might look as follows:
jackd -R -P1 -dalsa -dhw:0 -r48000 -p512 -n4 S -i2 -o2In particular, the number of input and output channels is set to 2 by the options -i2 and -o2, respectively. See the man page for jackd (say ``man jackd'') for documentation of all jackd parameters.
If the demo seems to be running ok, but you don't hear sound, you may have a sound card problem. Read the file INSTALL in the main stk directory for pointers and suggestions. See also the file stk/myproj/delay/README (toward the end) for a short trouble-shooting guide for sound playback.