Skip to content
Andrew Madsen edited this page Jun 19, 2022 · 7 revisions

There are several ways to add MIKMIDI to your project. Choose whichever method you're most comfortable with below. The methods are listed roughly in order of my own preference.

Using an Xcode subproject

Xcode sub-projects allow your project to use and build MIKMIDI as an implicit dependency.

  1. Add MIKMIDI to your project as a Git submodule:

    $ cd MyXcodeProjectFolder
    $ git submodule add https://github.com/mixedinkey-opensource/MIKMIDI.git Frameworks/MIKMIDI
    $ git commit -m "Added MIKMIDI submodule"
    
  2. Drag Frameworks/MIKMIDI/Framework/MIKMIDI.xcodeproj into your existing Xcode project

  3. Navigate to your project's settings, then select the target you wish to add MIKMIDI to

  4. In the Embedded Binaries section, click the + and find MIKMIDI.framework.

  5. You should now be able to add #import <MIKMIDI/MIKMIDI.h> (Objective-C) or import MIKMIDI (Swift) to any of your target's source files and begin using MIKMIDI.

Carthage

Using Carthage, you can easily add MIKMIDI to your project as a pre-built framework. In order to use this method, you must have Carthage installed.

  1. Create a Cartfile for your project.
  2. Add the following line to your Cartfile:
github "mixedinkey-opensource/MIKMIDI"
  1. In your project directory, run carthage update --use-xcframeworks
  2. Find MIKMIDI.xcframework in Carthage/Build.
  3. Navigate to your project's settings, then select the target you wish to add MIKMIDI to.
  4. On the General tab, drag MIKMIDI.xcframework from Finder into the "Embedded Binaries" section. Make sure the "Copy items if needed" option is checked.
  5. You should now be able to add #import <MIKMIDI/MIKMIDI.h> (Objective-C) or import MIKMIDI (Swift) to any of your target's source files and begin using MIKMIDI.

Using CocoaPods

You can use CocoaPods to add MIKMIDI to your project. In order to use this method, you must have CocoaPods installed.

  1. Add the following line to your Podfile:

    pod 'MIKMIDI'
  2. In your project directory, run pod update

  3. Open the .xcworkspace file that CocoaPods created (not the .xcodeproj file).

  4. You should now be able to add #import <MIKMIDI/MIKMIDI.h>, etc. to any of your app's source files and begin using MIKMIDI.

Note: If your project is in Swift, you will have to do one of the following to use the MIKMIDI CocoaPod:

Pre-built Framework

The Releases section of the MIKMIDI GitHub page also includes downloadable pre-built frameworks for each release of MIKMIDI.

  1. Download MIKMIDI-x.y.z.xcframework.zip from the Downloads section of the latest release of MIKMIDI (where x.y.z is the version number, e.g. 1.7.1).
  2. Unzip MIKMIDI-x.y.z.xcframework.zip after downloading it.
  3. Inside the resulting folder, are folders called "iOS" and "Mac". Navigate into the appropriate one for your project. Inside, you'll find MIKMIDI.framework.
  4. Navigate to your project's settings, then select the target you wish to add MIKMIDI to.
  5. On the General tab, drag MIKMIDI.xcframework from Finder into the "Embedded Binaries" section. Make sure the "Copy items if needed" option is checked.
  6. You should now be able to add #import <MIKMIDI/MIKMIDI.h> (Objective-C) or import MIKMIDI (Swift) to any of your target's source files and begin using MIKMIDI.

Manually from source

WARNING: For various reasons, using this method to install MIKMIDI is very strongly discouraged. In a future release of MIKMIDI, this method will become entirely unsupported. Instructions are provided here mostly for the sake for completeness.

If you don't want to use CocoaPods, Carthage, an Xcode subproject, or a pre-built framework, you can add MIKMIDI's source directly to your project.

  1. Add MIKMIDI to your project as a Git submodule:

    $ cd MyXcodeProjectFolder
    $ git submodule add https://github.com/mixedinkey-opensource/MIKMIDI.git ThirdParty/MIKMIDI
    $ git commit -m "Added MIKMIDI submodule"
    
  2. Drag ThirdParty/MIKMIDI/Source into your Xcode project, and ensure that you add it to the targets that you wish to use it with. (3. If your project uses Swift, add #import MIKMIDI.h to your project's bridging header.)

  3. You should now be able to add #import "MIKMIDI.h", etc. to any of your target's Objective-C source files and begin using MIKMIDI.

Note Please be aware that if you've set Xcode's Link Frameworks Automatically to No then you will need to manually link your target with CoreMIDI.framework, AudioUnit.framework, AudioToolbox.framework. Additionally, in iOS projects, regardless of this setting, you will need to link with libxml.dylib.