Stk2pd

From CCRMA Wiki

Revision as of 13:25, 5 July 2009 by Eberdahl (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.5 and 10.4
  • PPC Macs running OS 10.4

(Chris Chafe and Michael Gurevich, 2007)

Contents

Legal

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 Binary Objects

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

Mac

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

Assuming you don't have a /usr/share/stk directory, you'll need to create it:

   $ sudo mkdir /usr/share/stk

After downloading and uncompressing the externs, navigate to the directory and copy the rawwaves to /usr/share/stk by typing from the terminal:

   $ sudo cp -r rawwaves /usr/share/stk/rawwaves

Intel Mac using OS 10.5:

Intel Mac using OS 10.4:

G4 PPC using OS 10.4:


Linux

(Compiled under Fedora 6)

Note that these require the rawwaves directory to be located in /usr/share/stk/rawwaves If you don't have a /usr/share/stk directory, you'll need to create it:

   $ sudo mkdir /usr/share/stk

After downloading and uncompressing the externs, navigate to the directory and copy the rawwaves to /usr/share/stk by typing from the terminal:

   $ sudo cp -r rawwaves /usr/share/stk/rawwaves

Compiling from Source

Alternatively, you can download the source here:

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

   $ svn co svn+ssh://user@ccrma-gate.stanford.edu/usr/ccrma/group/pid/svn/pd/stk2pd ./stk2pd

1. Get STK4.2.1 You can download and compile it from source from: http://ccrma.stanford.edu/software/stk/release/stk-4.2.1.tar.gz

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/share/stk/rawwaves. To set that path, when you configure STK, type:

    stk4.2.1$ ./configure RAWWAVE_PATH="/usr/share/stk/rawwaves/"

1.2 You can then copy the rawwaves directory to the location specified in the previous step (you may first need to create /usr/share/stk):

    stk4.2.1$ sudo cp -r rawwaves /usr/share/stk/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:

   stk2od$ ./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:

   stk2pd$ make

and then

   stk2pd$ 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 Makefile.in, 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.
Personal tools