Have you ever wanted to turn your dancing or body motion into music? We made a MIDI app that does just that!
ShakeMidi is a wireless MIDI controller that you can shake. You just customize your own pattern of notes, then shake your device to send the notes wirelessly to another device or computer. The other device then translates the notes into sound:

ShakeMidi has two main views: a portrait mode with no touch controls built for dancing and a landscape mode with a pattern editor that you can think of like a MIDI sequencer or MIDI keyboard.
After programming your pattern of notes, you can lock your device in portrait mode for complete hands-free, wireless MIDI control:

ShakeMidi auto-connects to nearby devices, including iPhones, iPads, iPod Touches, as well as Mac, Windows and Linux computers. It can quantize your notes so your rhythm stays perfectly in sync. When the quantize feature is on, you can achieve zero millisecond latency thanks to Core Midi’s time stamps:


Highlights
ShakeMidi is an innovative MIDI app. As far as we know, ShakeMidi is the first app to accomplish the following:
- First app to singularly use your device’s accelerometer as a MIDI note on/off instrument
- First MIDI app to auto-connect to nearby Core MIDI enabled devices
- First MIDI app to have a quantize feature
- First wireless MIDI controller to achieve zero millisecond latency over WiFi
Contest
To help launch the app, we are running a little video contest until the end of the year. Just film yourself using ShakeMidi in your own way and drop us a line. The winner gets a $100 collector’s edition iTunes gift card!
Development
At first, we thought ShakeMidi would take about 2 to 4 weeks to complete. It turns out we spent that long just developing the three-dimensional math algorithm to translate your device’s accelerometer vectors into what constitutes a “shake.”
After finishing the algorithm, we spent about four months refining the app. The user interface went through several iterations. We kept adding features that seemed cool, and Core MIDI support turned out to be a lot more involved than we originally thought. In the end, all that polishing paid off!
A UIWebView Class
Along the way we developed a few classes that can be reused in other projects.
One such class is our UIWebView helper class, which we use in a popover view to display ShakeMidi’s built-in HTML help files. We are using Cocos2D to draw the user interface, so consider this WebView to be Cocos2D-friendly. It’s meant to work in landscape mode. Here’s the Objective C classes and an example CCLayer to put it together:
- MyNavigationControllerLayer.h
- MyNavigationControllerLayer.m
- MyWebViewController.h
- MyWebViewController.m
- HelpLayer.h
- HelpLayer.m
One more thing you need to make that work is a few category extensions to UIView. These help to orient and center the UIWebView while using Cocos2D:
// put this in a .h, for example Categories.h
@interface UIView (Extended)
-(void) reorient;
-(void) recenter;
@end
// this goes in a .m, like Categories.m
@implementation UIView (Extended)
-(void) reorient
{
ccDeviceOrientation orientation = [[CCDirector sharedDirector] deviceOrientation];
if( orientation == kCCDeviceOrientationLandscapeLeft || orientation == kCCDeviceOrientationLandscapeRight )
{
if( orientation == kCCDeviceOrientationLandscapeLeft )
self.transform = CGAffineTransformMakeRotation(M_PI_2);
else
self.transform = CGAffineTransformMakeRotation(M_PI + M_PI_2);
}
else
{
if( orientation == UIDeviceOrientationPortraitUpsideDown )
self.transform = CGAffineTransformMakeRotation(M_PI);
else
self.transform = CGAffineTransformMakeRotation(0.0f);
}
}
-(void) recenter
{
ccDeviceOrientation orientation = [[CCDirector sharedDirector] deviceOrientation];
CGSize iSize = [[CCDirector sharedDirector] winSize];
if( orientation == kCCDeviceOrientationLandscapeLeft || orientation == kCCDeviceOrientationLandscapeRight )
{
self.center = ccp(iSize.height / 2.0f, iSize.width / 2.0f);
}
else
{
self.center = ccp(iSize.width / 2.0f, iSize.height / 2.0f);
}
}
@end
Good luck in your own projects!
That's All
Find out more about ShakeMidi at ShakeMidi.com.
Stay tuned! The iPhone Game Kit 4.0 will be released in about a week!



