The pitch of a sound, when looking at the raw data, is determined by the length of the periods of its waves.
To alter pitch you need to alter the period. To alter the period is also to alter the speed at which it plays (GM should have this function). If you wish to alter the pitch and NOT the speed then you'll be getting into the non-trivial idea of "pitch shifting" (GM does NOT have this function and it would need to be calculated manually).
I am not positive but you may need the Fourier Transform to determine pitch (which is also used in pitch shifting) since it can help determine individual frequencies.
Use this info if its helpful.