Skip to content

Csound~ for Max MSP on OSX: a build guide

vlazzarini edited this page Apr 6, 2014 · 1 revision

The following are brief instructions for building and testing csound~ on Mac OSX.

Requirements

  • Standard Requirements for Csound
  • Max/MSP SDK 6.1.3

Building

To build, you will need to run CMake to generate an Xcode project. You will also need to set where the Max SDK is located. You can do this by adding "-DMAX_SDK_ROOT=/location/of/maxsdk" if you run CMake on the commandline. Alternatively, you can add an option to your Custom.cmake, such as:

set(MAX_SDK_ROOT /Users/stevenyi/work/max_msp/MaxSDK-6.1.3)

When running CMake, you should see a message like:

-- Building csound~ for Max/MSP -- MAX_SDK_ROOT: /Users/stevenyi/work/max_msp/MaxSDK-6.1.3

If successful, when you open the XCode project, you should see a target called "csound~.mxo". Select that target and build. That should create a csound~.mxo framework within the /build/folder/frontends/max_csound_tilde/Debug folder, where /build/folder is where you ran CMake from.

Also to note, if you would like to use this in both i386 and x86_64 versions of Max/MSP (i.e. running the application in 32-bit mode or 64-bit mode), you will need to run CMake with:

-DCMAKE_OSX_ARCHITECTURES="i386;x86_64"

You can use an equivalent set option in Custom.cmake.

Testing

To test the build, you will need to use the Max Runtime application. The full Max application will not work for testing. To do this, assuming csound~.mxo is the active target, from the XCode menu choose "Product -> Scheme -> Edit Scheme" or use the cmd-< shortcut. In the run settings, go to "Info" and for Executable, go to Other and browse to the Max Runtime.app. Now when you do a run for this target, it will load up the Max Runtime.

The easiest way to test at this point is to put the files you are testing into the Debug folder where the csound~.mxo framework is built. Then, when you run the Max Runtime application from XCode, navigate to the Debug folder and open the testing maxpat from there. That way, it will load the csound~.mxo found in that directory, which is one freshly built from XCode.

With this setup, you can use XCode's debugger. Also, since the version of csound~ that is built is linked with the CsoundLib64.framework built within XCode, it will allow you to debug any issues that may have come from CsoundLib.

Releases

For release builds, the build should be done with CMake with -DCMAKE_BUILD_TYPE=Release. However, to simplify things, there is a script within the csound6/frontends/max_csound_tilde/installer folder called build-installer.sh. This script will automatically build csound~ from a fresh clone of sources, as well as use pkgbuilder and build an installer. (This is the script used for the releases of csound~).