Tutorials

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:

  3. Open TheAmazingAudioEngine.xcodeproj in Xcode

  4. Build the project (Cmd+B)

  5. Find the products group in the Xcode navigator and Ctrl+Click on the libTheAmazingAudioEngine.a to show it in Finder

  6. Copy the file (libTheAmazingAudioEngine.a) to the iosGenFilter folder

  7. Close TheAmazingAudioEngine.xcodeproj Xcode project

  8. From the Finder, copy the AmazingAudioEngine with all of the header (.h) and source (.m) files to the iosGenFilter folder

  9. From the Audiobus SDK, copy the Audiobus folder and libAudiobus.a file to the iosGenFilter folder

  10. Open the gen~ patch in the iOSGenFilter folder

  11. In Max, export the gen~ patch as C++ code as follows:

  12. Unlock the patch and select the gen~ object

  13. From the inspector, under the Export header, click on the "choose" button next to the field "Folder to export into"

  14. Choose the GenFilter folder inside project folder, where the code will be exported

  15. Click the exportcode message connected to the gen~ object to finally export the code

  16. Open the GenFilter.xcodeproj in the iosGenFilter folder

  17. In xcode, Change the namespace used in GenFilter.mm to match that of the exported code

  18. Find the statement near the top of file starting with “using namespace” and edit it to look like this: using namespace gen_exported;

  19. (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.)

  20. Connect your iOS device to your computer (iPhone or iPad)

  21. Build the Xcode project for the device

  22. Generate an Audiobus API key

  23. In the ‘products’ group in Ccode navigator, Ctrl+Click on the GenFilter.app product and select ‘open in finder’.

  24. Ctrl+Click on the GenFilter.app in Finder and select ‘open package contents.’ Leave this finder window open

  25. In a browser, go to [4] - you’ll probably need to login with your user/password set up earlier.

  26. Drag the info.plist file from the Finder window just opened into the dropbox in the browser.

  27. Enable the 'Filter Port' option and click the button on the web page to generate a key

  28. You should get a screen with your temporary API key.

  29. 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

by Cycling '74 on June 20, 2013

Creative Commons License