From CCRMA Wiki
Revision as of 14:49, 16 July 2008 by Gurevich (Talk | contribs)

Jump to: navigation, search

stk2pd is a script to convert STK objects to Pd objects

It is currently tested on:

  • PlanetCCRMA Linux machines running FC6
  • Intel Macs running OS 10.4.10 and Pd version 0.39.2-extended-rc3


The code and scripts in this package are provided for free with no warranty. Use at your own risk. The source package includes the rawwaves directory from the STK, which may or may not be covered by a license. The binary Pd objects generated by this package use libstk.a. See the STK source for licensing and legal information about STK.

Getting the Objects

You can either get the souce and compile the objects yourself, or try using the precompiled binary objects.

Precompiled Binary Pd Externs


Note that these require the rawwaves directory to be located in /usr/lib/rawwaves

After downloading the externs, copy the rawwaves directory by navigating to the externs directory and typing from the terminal:

  $ sudo cp -r rawwaves /usr/lib/rawwaves

Intel Mac using OS 10.5:

Intel Mac using OS 10.4:

G4 PPC using OS 10.4:

PlanetCCRMA Linux

(Compiled under Fedora 6) Note that these require the rawwaves directory to be located in /somewhere/somewhere/somewhere


Alternatively, you can download the source here:

Or, if you have a CCRMA account, you can get them with subversion

   $ svn co svn+ssh:// ./stk2pd

To Compile

1. Get STK4.2.1 You can download and compile it from source from:

1.1 Compile STK4.2.1 Follow the instructions in the STK documentation.

Some of the STK instruments use short sound files that live in a directory called "rawwaves". These are loaded when you load the Pd object, but the path to these must be specified when you compile the STK. When you compile STK, make sure that you set the rawwaves path to somewhere that this directory will live. The precompiled version of these objects sets the path to /usr/lib/rawwaves/. To set that path, when you configure STK, type:

    stk4.2.1$ ./configure RAWWAVE_PATH="/usr/lib/rawwaves/"

1.2 You can then copy the rawwaves directory to the location specified in the previous step:

    stk4.2.1$ sudo cp -r rawwaves /usr/lib/rawwaves

1.3 Now, you can compile STK4.2.1 by typing "make" from its src directory.

2. Autoconf. From the stk2pd directory, type:

    stk2pd$ autoconf

This will generate a configure file.

3. Configure. You probably need to set the pd path and the stk path, and may want to set the installation prefix. You can do this by typing:

   ./configure --with-pd-dir=/path/to/pd/include --with-stk-dir=/path/to/stk --prefix=/where/you/put/your/pd/externs

4. If this is successful, you can type:


and then

   make install

This will copy the compiled externs to the installation directory, determined by --prefix

5. Note that to install the help patches, you'll need to copy them manually to where you keep your Pd help patches.

How this (hopefully) works

  • When you type make, the Makefile (generated by configure) calls a shell script called ProcessInstrument.
  • This script generates a .cpp file for each stk instrument in the list defined on first line of the Makefile. The .cpp files are put in the cppfiles directory.
  • To change this list, you can edit the Makefile (or, and then re-run configure).
  • The .cpp files are generated by find and replace, based on the template cpp file called stk2pdTemplate.
  • After each is generated, a Pd extern is compiled into the externs directory.
  • The install: make target stupidly copies the compiled externs and the rawwaves directory to the path set by --prefix.