Convert acceleration values into proportional sound

Is there any simple code for converting the acceleration value from an accelerometer chip into a sound, proportional to the value ? Similar to how the light sabers sound in Star Wars ? Thanks for any help you can provide !!

Yes, of course. Did you not Google?