Velocity sensitive keys

id like to work on say a piano app that would make use of apples same velocity sensitive technology as garageband for the ipad but i have no idea how to use the accelerometer to do so any advice on this issue would be greately appreciated