Skip to content

Edinburgh-College-of-Art/maxmsp-external-template

Repository files navigation

maxmsp-external-template

Template Projects for building external objects in MaxMSP

Setup

To get started, click use this template at the top of the repository

then follow the instructions for creating a repository

Cloning this Repository

To make this repository a little more portable, the max-sdk-base has been included as a submodule. If you are using the GitHub desktop app, the submodule will be cloned automatically. If you are using git from the command line, this means you will need to state --recurse-submodules when cloning.

git clone --recurse-submodules https://github.com/Edinburgh-College-of-Art/maxmsp-external-template

You should be able to build straight away from the Xcode project or the Visual Studio solution. Other methods of cloning or downloading this repository may result in the max-sdk-base folder being empty. In that situation either use the above git command or download the max-sdk-base directly and copy over the contents.

Configuration

Build configuration is slightly different depending on which IDE you are using. For Visual Studio you should be looking at the property sheets and for Xcode the .xcconfig.

The build destination for each project is set to the default user Max Packages directory.

macOS:

~/Max 8/Packages/$(Project_Name)/externals

Windows:

$(USERPROFILE)\Documents\Max 8\Packages\$(ProjectName)\externals

This means you should be able to use your object in Max immediately after building, though Max will require a restart.

maxmspsdk.xcconfig

The maxmspsdk.xcconfig in the xcode directory sets a couple of global paths in the Xcode project. DSTROOT sets the build destination.

.prop sheets

To change the destination folder:

  1. make sure you have highlighted the project in the Solution Explorer

highlight solution explorer project

  1. Press F4 or Properties by navigating the menus View -> Properties...

  2. In Configuration Properties -> General you can change the Output Directory

vs output directory

For Visual Studio users, there should be nothing that you need to change in the property sheets. If you would like to change them or just take a look, you can edit them directly in any text editor as VS files are essentially XML files.

To edit the property sheets in visual studio:

  1. make sure you have highlighted the project in the Solution Explorer

highlight solution explorer project

  1. Select the property manager by navigating the menus View -> Other Windows -> property manager

View -> Other Windows -> property manager

  1. Select a property sheet press Alt + Enter or right click and select properties

properties

  1. navigate to user macros

User Macros


Projects

The Xcode and VS project have multiple targets / projects to demonstrate how to approach building a Max external .mxo, .mxe64 file.

max-external

The vanilla C approach. There are plenty of examples in the sdk, but this target / project aims to take a more modern approach. Documentation has been added inline as well as some slightly less obtuse variable name choices which will hopefully reduce the barrier of entry.

max-external~

The vanilla C approach to MSP objects.

mspcpp

If you have already coded a ton of DSP C++ classes for something like JUCE, you may want to start here.

Demonstrates using extern "C" to write wrappers for pre-existing c++ classes. you need only write wrapper functions for public class methods or anything that needs to be called directly in C