Gen Code Export: iOS


    Following are the steps for the creation of iOS filters with gen~ and Audiobus.

    Requirements

    Xcode 4.6 or later Max 6.1 or later

    Preliminaries

    Building an Audiobus iOS Project

    1. Show the iOSGenFilter folder from the above download in Finder
    2. Copy The Amazing Audio Engine to the project folder as follows:
      1. Open TheAmazingAudioEngine.xcodeproj in Xcode
      2. Build the project (Cmd+B)
      3. Find the products group in the Xcode navigator and Ctrl+Click on the libTheAmazingAudioEngine.a to show it in Finder
      4. Copy the file (libTheAmazingAudioEngine.a) to the iosGenFilter folder
      5. Close TheAmazingAudioEngine.xcodeproj Xcode project
      6. From the Finder, copy the AmazingAudioEngine with all of the header (.h) and source (.m) files to the iosGenFilter folder
    3. From the Audiobus SDK, copy the Audiobus folder and libAudiobus.a file to the iosGenFilter folder
    4. Open the gen~ patch in the iOSGenFilter folder
    5. In Max, export the gen~ patch as C++ code as follows:
      1. Unlock the patch and select the gen~ object
      2. From the inspector, under the Export header, click on the "choose" button next to the field "Folder to export into"
      3. Choose the GenFilter folder inside project folder, where the code will be exported
      4. Click the exportcode message connected to the gen~ object to finally export the code
    6. Open the GenFilter.xcodeproj in the iosGenFilter folder
    7. In xcode, Change the namespace used in GenFilter.mm to match that of the exported code
      1. Find the statement near the top of file starting with “using namespace” and edit it to look like this: using namespace gen_exported;
      2. (if you get a bunch of errors, you will need to find out what your exported code is called. It will be the most recent .cpp file in the GenFilter folder.)
    8. Connect your iOS device to your computer (iPhone or iPad)
    9. Build the Xcode project for the device
    10. Generate an Audiobus API key
      1. In the ‘products’ group in Ccode navigator, Ctrl+Click on the GenFilter.app product and select ‘open in finder’.
      2. Ctrl+Click on the GenFilter.app in Finder and select ‘open package contents.’ Leave this finder window open
      3. In a browser, go to [4] - you’ll probably need to login with your user/password set up earlier.
      4. Drag the info.plist file from the Finder window just opened into the dropbox in the browser.
      5. Enable the 'Filter Port' option and click the button on the web page to generate a key
      6. You should get a screen with your temporary API key.
      7. Copy the API key into the AppDelegate.mm file replacing the existing one – around line 51. Rebuild the project to make sure you have no errors
    To test the filter:
    1. Ensure the iOS device is still connected
    2. Build and Run the Xcode project
    3. You should now see the GenFilter app running on your device
    4. Switch out of the app and launch AudioBus
    5. In AudioBus, select the microphone input for input, the GenFilter for effect, and the speaker or headphone output for output.
    6. Switch back to GenFilter and twiddle some parameters
    7. You should hear audio coming out of your device