SynthLab SDK
SynthLab-DM MacOS

Creating SynthLab-DM projects in Xcode is simple and easy. These instructions are for Xcode 12 but should be the same for other versions. The DM core files include two (PCMSample.h and PCMSample.cpp) for PCM sample support that require the Corefoundation framework, which comes with the compiler. When you are done, you will have a very small and simple project that builds a dylib. Note that you use the same set of sdk files for both MacOS and Windows and there are no compiler pre-processor commands or special link settings.


new_DM_mac_1.png

SynthLab-DM Project: Xcode

In Xcode use:

  1. File -> New Project
  2. macOS -> Library (this is under "Framework & Library")
  3. Name and choose Framework -> None(Plain C/C++ Library)
  4. When the the Xcode Project opens, go to the Target panel and select your project name, then
  • Go to Build Phases -> Link Binary with Libraries
  • Hit the (+) button and add: Corefoundation framework from the massive list
  1. OPTIONAL add a post build rule to the Xcode Build Phases to copy the dylib to its final destination; see the example module solutions for help

Here is the Framework setup:


corefoundation.png


And here is the Build Phase for copying an oscillator dylib to the prescribed folder; alter the syntax as needed.


dmdev_9.png


At this point, the compiler settings are done, and you only need to add the files from the corefiles folder.

Add DM Core Files
You have two choices here: make copies of the core files and use those, or share the core files with other projects. Here we will make a copy and use that. Later on, you can share the files across projects as you like.

  1. In the SDK /dm_support find the /corefiles/ folder and copy that into your new Xcode project folder so that it resides along side of the project.xcodeprojfile
  2. In Xcode's navigator, right-click and choose "Add files to //your project//" then browse and add all of the files in the /corefiles/ folder

Add DM Core Files
You need the two DLL support files along with the files that contain the ModuleCore C++ object. First, copy the two DLL files from the SynthLab_SDK/synthlab_dm/dll_support_files/ into your project folder, then in Xcode's navigator, right-click and choose "Add files to //your project//" to import the files

  • synthlabdll.h
  • synthlabdll.cpp

Then, if starting from scratch: copy the two template files from SynthLab_SDK/source/core_templates/ into your project folder; these are blank files with just the skeleton code you need to implement a ModuleCore from scratch, then in Xcode's navigator, right-click and choose "Add files to //your project//" to import the files

  • synthlabcore.h
  • synthlabcore.cpp

Or, if cloning an existing core: choose the two core files from the SDK (e.g. classicwtcore.h and classicwtcore.cpp) and copy them into your project folder, changing their names to synthlabcore.h and synthlabcore.cpp. Then with a text editor, open the files and change all occurrances of the class name (e.g. ClassicWTCore here) to SynthLabCore. Make sure to change the name of the #included .h file while you are at it. Then in Xcode's navigator, right-click and choose "Add files to //your project//" to import the files which really contain a clone of the SDK object of choice

  • synthlabcore.h
  • synthlabcore.cpp

Add SDK Files
Next, add the necessary SDK files for your DM project. You may use the example projects to get started. Most of these projects will require around 10 files depending on type. The example projects and this documentation will help you figure out what you need. When in doubt, just add ALL of the sdk_files to your project; all of the example projects will build from these same sets of files, even if not needed. But ultimately you want to pare down the set of files to a minimum.

And, every DM core project will require an identical set of "core" files to start:

Do a Test Build
Rebuild the library; the core files are set to give you an empty ModuleCore by default, found in the synthlabcore.h and .cpp files. When this builds successfully, if you are re-packaging an existing ModuleCore, then you may follow the steps in the previous section regarding altering the project for your new module name.

Test the DM
Copy the __.dylib__ file from the local /Debug/ or /Release/ folder into the SynthLabModules folder in your main plugin binary folder as per the instructions at the start of this guide. Start SynthLab-DM and find your new ModuleCore in the appropriate location to test and develop.


synthlab_4.png