# Can I take derivative of a function that represents a piece of music?

Can I take the derivative of a function that represents a piece of music? The music is given in .mp3, .midi or whatever comes in handy.

-
Could you be a bit more specific? Do you want to take the derivative of a discrete-time sampled waveform? – Mr.Wizard Jun 9 '13 at 12:35
@Mr.Wizard sorry, forgot that mp3 is not continuous waveform. Is the waveform of MIDI continuous/is there a simple way to perform fourier transform on a MIDI input? – arax Jun 9 '13 at 12:42
Midi is like sheet music. If you want a waveform, convert mp3->wav with any external tool (this is easy to do) and then import the wav and work on it as bill sugested – Rojo Jun 9 '13 at 12:51
If the input is a MIDI, the following is relevant: stackoverflow.com/questions/7592596/… – Corey Kelly Jun 9 '13 at 14:52

In Mathematica, you can read in .wav files using Import. Since the data is then a discrete data sequence, you can't take a real calculus-style derivative, but you can take the derivative numerically, for instance, using functions like Differences and DerivativeFilter (thanks Jens). In fact, the derivative operation is a kind of high-pass filter, which will augment the noise and remove the low frequencies. You can listen to the changed sound using SampledSoundFunction or by saving the result out to a .wav file using Export. There are plenty of other ways you can manipulate the sound: LowpassFilter and HighpassFilter come to mind.
Don't forget DerivativeFilter for lists. – Jens Jun 9 '13 at 16:22