Tuesday, 30 August 2011

Upgrade to XCode 4.1 - problems with VALID_ARCHS for iOS Simulator builds

Now that I've taken the plunge and moved to XCode 4.x from XCode 3.x ... I had a really weird problem trying to build my iOS projects for the simulator.

The builds failed with an error related to the i386 architecture. I simply couldn't figure-out how to solve this directly with the XCode IDE.

Luckily, I did manage to figure-out a fix: my solution was to edit the project.pbxproj files by hand with vim, and remove a handul of fixed definitions of VALID_ARCHS ... which presumably were legacies from previous XCode versions. This is not the first time that I've been forced to fix XCode projects by hand!

Monday, 29 August 2011

Mac - how to build installs the easy way

I was having some issues getting my Mac installers (using packagemaker) working with the latest XCode.

Surfing-around, I found an amazing free tool called Packages. The link is here:


I've changed our own installers to use this, and all my Mac install problems have disappeared with an hours work. :)


Wednesday, 10 August 2011

Audio and MIDI Visualization in iOS and Android

I've spent the past month focused mainly on Intermorphic's Audio/MIDI visualizer framework, dusting-down the work I did (in the main) several years ago, and bringing it all up-to-date.

I've recently experimented with lots of stuff, 2D and 3D, on iOS (UIKit ,Quartz, Core Animation and OpenGL ES) and Android (Canvas and OpenGL ES), and have learned a lot about performance differences between these approaches. I've also learned that OpenGL ES is a truly horrible API in which to get things done. :)

Anyways - things are coming on nicely: the next update for Mixtikl should be another good one!

Wednesday, 3 August 2011

Android - turn key events into UTF8

As I've been asked a few times how to turn Android key events into UTF8 data, I figured it might be a good idea to share this info in my blog! It is actually really easy:

  public boolean onKeyDown(int keyCode, KeyEvent event) {
    int [] unicodePoints = new int[1];
    unicodePoints[0] = event.getUnicodeChar();
    String x = new String(unicodePoints, 0, 1);
    byte utf8Bytes[];
    try {
      utf8Bytes = x.getBytes("UTF-8");
      // Do something with your UTF-8 data here!
      // ....
      // ...
    } catch (UnsupportedEncodingException e) {
      Log.e(TAG, "Failed to key event to UTF8");
    return true;