Increasing the pitch (as an example, decreasing pitch will just be the same data backwards) basically means the frequency needs to be increasing as the file is played. Most likely you would want a sin-wave for your audio as it sounds a bit nicer, but if you just want really simple code, stick to square wave.

So loop over the length of your wave file data buffer.

Typially you would use

`sin(x * <frequencydefiningconstant>) * <amplitude>`

where x is the position in the audio buffer. If you change the value in sin to a non-linier expression, you will get variation in the pitch. so try `sin(x^y * <frequencydefiningconstant>) * <amplitude>`

(y should be really close to 1, as samples come pretty fast in a wave file). Not sure this is the best result, you can play with other non-linier functions... or wait and hope someone comes with a better answer.I would expect a Fourier transforms is the mathematical right way to do it as it can transform between the frequency domain (where you can specify a linier increase/decrease) and the time domain (your sample index in the wave file). If this is the right approach for your paper probably depends on the audience.