ShakeMidi: A Wireless MIDI Controller That You Can Shake

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:

How a wireless MIDI app can make 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's hands-free, portrait, dancer mode

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:

Zero latency sending MIDI over WiFi

ShakeMidi auto-connects to nearby Core Midi enabled devices

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:

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!

Comments

Leave a Reply


nine + = 16

Subscribe via email

Subscribe in a reader


iPhone Game Creation for Beginners

A hands-on introduction to all the tools you need to develop an iPhone game. It includes source code to a simple board game built with Cocos2d and a comprehensive book that will teach you Xcode, Objective C and the Cocos2d framework. Plus, you get documentation, support and a ton of artwork to start your own creation.
More info…


Action-RPG Engine Code & Tutorial

Create your own action, RPG, adventure or RTS game with this starter kit. Learn how to manage tilemaps, characters, AI and more. This Starter Kit includes a flexible RPG engine built on Cocos2d, along with a sample RPG project that will teach you everything you need to know. Also included is a helpful ebook tutorial and a gigantic royalty-free art package!
More info…

Featured Posts

Cocos2d 2.0, iOS 6 & iPhone 5 Updates - 9/24/12

Making Cross-Platform iPhone & Android Games – Don’t Get Left Behind! (Part 3) - 7/11/12

5 Cocos2D iPhone Game Source Code Kits to Revolutionize Your Game Development - 4/5/12

How to Make Games With the iPhone Game Kit 5.0 - 2/19/12

Learn to Make iPhone Games with the iPhone Game Kit 4.0 - 12/10/11

The Cocos2D Family of Game Engines, Their Platforms & Languages - 11/2/11

Game Design Lessons: Introducing Flow - 9/23/11

What is Cocos2D and Why is it One of the Best iPhone Game Engines? - 6/3/11

Community RPG Developer’s Diary, Part One - 1/20/11

CCZSprite and HudLevelSprite, Two Cocos2D Extensions You Need to Know About - 8/10/10

How to Program Dpad Joystick Touch Controls for iPhone Games - 6/7/10

Other Posts

Awesome Heroes Arena! - 3/13/13

Making Cross-Platform iPhone & Android Games – Don’t Get Left Behind! (Part 2) - 5/26/12

An Awesome Review of our RPG Engine from a Customer - 4/26/12

Making Cross-Platform iPhone & Android Games – Don’t Get Left Behind! - 4/16/12

ShakeMidi: A Wireless MIDI Controller That You Can Shake - 12/1/11

Download Monster Checkers Updated Source Code Soon - 7/29/11

iPhone Game Kit Discussed on the Cocos2D Podcast - 7/8/11

New iPhone Game Kit 3.4 Update - 4/28/11

Quexlor LoF Hits the App Store - 4/8/11

The iPhone Game Kit Community Project – A Newcomer’s Perspective - 3/29/11

AI: What Cocos2D Cannot Do - 2/9/11

Cocos2D Community Game, Developer’s Diary, Part Two - 1/28/11

3.2 Kit is Out, Cocos2D 0.99.5 Compatible - 1/13/11

3.1 Kit is Out! Let’s Start the Community RPG - 12/9/10

Develop the Game Kit’s Community RPG and be a part of gaming history! - 11/23/10

iPhone Game Kit 3.0 Released - 10/14/10

New Game Added to the iPhone Game Kit! - 9/21/10

New Tiled Map Editor 0.5.1 Works Like a Charm! - 9/10/10

Four Interesting Things We Are Working To Improve The iPhone Game Kit - 8/25/10

iOS4 Compatible iPhone or iPad Game Source Code - 8/2/10

Making High Resolution Graphics For iPad and iPhone4 Games - 7/16/10

Game Source Code & Tutorials



iPhone Game Creation for Beginners

A hands-on introduction to all the tools you need to develop an iPhone game. It includes source code to a simple board game built with Cocos2d and a comprehensive book that will teach you Xcode, Objective C and the Cocos2d framework. Plus, you get documentation, support and a ton of artwork to start your own creation.
More Info...


Action-RPG Engine Code & Tutorial

Create your own action, RPG, adventure or RTS game with this starter kit. Learn how to manage tilemaps, characters, AI and more. This Starter Kit includes a flexible RPG engine built on Cocos2d, along with a sample RPG project that will teach you everything you need to know. Also included is a helpful ebook tutorial and a gigantic royalty-free art package!
More Info...