an Stk framework for Mac OS X


StkX is an Stk framework for Mac OS X, which will (hopefully) make your Mac Stk programming easier and more convenient.

Download (2/6/2006)

Release Notes

  • Modified headers (RtAudio.h and RtMidi.h) according to the latest post-release fixes to STK 4.2.1.
  • Builds a Universal Binary to support both PowerPC and Intel-based Macs. Details on building Universal Binaries can be found here.

System requirements

  • Mac OS X 10.4.4, Xcode 2.2. (10/24/2005)

Release Notes

  • Compatible STK version: 4.2.1. (10/14/2005).
  • Supports PowerPC only.

System requirements

  • Mac OS X 10.4, Xcode 2.1.


Before installing StkX, please download the latest version of Stk (4.2.1) and uncompress it.
Also, make sure that your files are up to date: see post-release fixes (for StkX you do not need demo.cpp and asio.tgz, though.)
  1. Downloaded the file from the link above.
  2. Put the unzipped folder StkX in the stk-4.2.1 folder.
  3. Open up a Terminal, go to the StkX directory, and run the following command:
    % sudo xcodebuild install -target StkX -configuration Release DSTROOT=/ INSTALL_PATH=your_framework_path DEPLOYMENT_LOCATION=YES
    Here, your_framework_path is the location you want to have your StkX framework installed: /Library/Frameworks is the most recommended spot for this.
    % sudo xcodebuild install -target StkX -configuration Release DSTROOT=/ INSTALL_PATH=/Library/Frameworks/ DEPLOYMENT_LOCATION=YES
    Of course, you can install it in any other location, including ~/Library/Frameworks:
    % sudo xcodebuild install -target StkX -configuration Release DSTROOT=/ INSTALL_PATH=~/Library/Frameworks/ DEPLOYMENT_LOCATION=YES
    If necessary, type in your password when asked.
For more information on xcodebuild:


  1. To remove any StkX installation, run the following command in the StkX directory:
    % sudo xcodebuild clean
  2. Now we need to remove the framework directory.
    % sudo rm -r your_framework_path/StkX.framework
    your_StkX_path is where you've installed your StkX framework. For example, to remove StkX installed in the /Library/Frameworks, run
    % sudo rm -r /Library/Frameworks/StkX.framework
    Again, enter your password if necessarry.


StkX can be used in the same way as any frameworks can be.
  1. Add (or link) StkX.framework to your target.
    You will probably need to add its path to the Frameworks Search Paths setting.
  2. To include any Stk header, you can just do the following:
    #include <StkX/StkX.h>
    For Objective-C, you might want to use import instead:
    #import <StkX/StkX.h>
  3. Important! To use Objective-C and C++-based StkX codes together in the same file (which would probably be the case for most Cocoa Stk applications), make sure that the File Type of your header and source are set as Objective-C++ (sourcecode.cpp.h and sourcecode.cpp.objcpp, respectively).
  4. Once you're using StkX, you don't need to set/add any Stk's OS X preprocessors (__GXX__ and __MACOSX_CORE__) and/or frameworks (CoreAudio, CoreMIDI, and CoreFoundation) for your target: all of OS X specific preprocessors and libraries for Stk compilation have been taken care of by StkX. :-)

Builds a command-line application HelloSine (see here.)
This would probably be one of the simplest examples that show how to use StkX to program Cocoa-based GUI applications: it plays a pure sine tone, whose amplitude and pitch can be controlled with sliders and number fields.

Notes on examples

  • The default StkX location is /Library/Frameworks: you may need to modify Framework Search Path setting otherwise.
  • Each project is to build a Universal Binary when its Build Configuration is set to Release: only native-architecture binary will be produced in Debug mode.
Copyright © 2005-2006 Woon Seung Yeo, all rights reserved.
woony AT ccrma DOT stanford DOT edu
Last updated: Sat, 11 Feb 2006 02:19:38 -0800.