iPhone Push Notifications with JavaPNS on Google App Engine

There have been several issues with getting JavaPNS working on Google App Engine. These included:
1) GAE didn’t support sockets or SSL
2) GAE doesn’t support signed jars, the BouncyCastle cryptography library is signed
3) GAE is transitioning to Java 7, and Java 7 has issues reading .p12 certificates

These instructions are for JavaPNS 2.2 and GAE 1.7.7, things may change on both fronts to make things either easier or harder.

1) GAE didn’t support sockets or SSL

With the arrival of GAE 1.7.7 sockets and SSL are now fully supported:
http://googleappengine.blogspot.com/2013/04/app-engine-177-released.html

2) GAE doesn’t support signed jars

Remove META-INF/MANIFEST.MF from the latest BouncyCastle jar or download my modified jar of BouncyCastle 1.48

3) Java 7 has issues reading .p12 certificates

a) Generate your .p12 certificate as per Apple’s instructions

b) Install Java 6 JDK

c) Use Java 6’s keytool to convert the .p12 to a .jks

keytool -importkeystore -destkeystore CERTIFICATES.jks -srckeystore CERTIFICATES.p12 -srcstoretype PKCS12

d) Configure JavaPNS to use the .jks format instead of .p12

boolean production = false;
String device = "DEVICE_ID";
String keystore = "CERTIFICATES.jks";
String password = "PASSWORD";
String message = "Hello JKS";

AppleNotificationServer jksServer = new AppleNotificationServerBasicImpl(keystore, password, ConnectionToAppleServer.KEYSTORE_TYPE_JKS, production);
PushNotificationPayload payload = PushNotificationPayload.alert(message);
PushNotificationManager pushManager = new PushNotificationManager();
pushManager.initializeConnection(jksServer);
List<PushedNotification> notifications = pushManager.sendNotifications(payload, Devices.asDevices(device));

Thanks to Palomino Labs Blog for the hints about Java and .p12 files:
http://blog.palominolabs.com/2011/10/18/java-2-way-tlsssl-client-certificates-and-pkcs12-vs-jks-keystores/

Midi Keyboard Velocity Curve Calibration With Pianoteq

I’ve dabbled on piano since I was about 6, and even though I’m still not very good, I do know that you simply can’t match the feel of a real live grand piano.

But…after 26 years of playing, I’ve finally found something that comes close. There are lots of great sounding piano modules / samplers out there, but Pianoteq with their velocity curve calibration, simply feels amazing.

Some of the sample based plugins like Imperfect Samples might sound more realistic, but without calibrating the velocity curve I can’t imaging getting the same feel as Pianoteq. (Pianoteq is great for live too with its low memory/cpu usage.)

You’ll see from the difference in my calibrated and original curve below, I wasn’t even able to get close to playing a sensitive quiet note until I calibrated:

pianoteqcalibrated

pianoteq