Detecting movement (punches) using MPU6050 and playing tones upon that

Hi this is my first post here.

We're doing a project using a boxing glove with an MPU6050 inside.
The goal is to detect certain punches, perhaps just the power in a normal punch, and then playing a sound corresponding to the movement.

We're using the accelerometer inside the mpu to get values, and then we're trying to convert the values into tones.

Our problem is, that we find it really hard to write functional code for the mpu, and after reading several articles and forum posts about it, we decided to ask for ourselves.
Do anyone in here have some ideas or examples from other projects? This is our example code right now, just playing two tones upon movement in to different directions, which is not ideal.

#include <Wire.h>
#include <I2Cdev.h>
#include <MPU6050.h>

MPU6050 mpu;

int16_t ax, ay, az;
int16_t gx, gy, gz;
float x_acc, gyro;

void setup() {
  Serial.println("Initialize MPU");
  if(!mpu.testConnection()==true) {
    Serial.println("MPU init failed");

void loop(){
  mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
  Serial.print("ax= "); 
  Serial.print("ay= "); 
  Serial.print("az= "); 

  if(ax>15000) {
    tone(9, 200,100);
  if(ay>15000) {
    tone(9, 2000,100);

Hope you guys have some ideas, best regards

So....what’s the problem here? Does you sketch work as intended? What else do you want it to do?

Yea my sketch work, but i guess i would like the detection to be a bit more sophisticated you know..
Like detecting an uppercut or a hook.

And therefore i'm asking for people who has ideas or has made something similar.
Hope it makes sense now