# Prevent running out of memory when doing SpectrogramArray?

I was using SpectrogramArray[Import@"myFile", 22050, 22050]to transfrom a piano mp3 file so that I can (probably?) generate a midi file from that mp3. The step size and interval length should be something like 22050 since it is a 44100-sample-rate mp3 while each note is somewhere around half second long. Since the mp3 files lasts for around four minutes, mathematica would run out of my 6G of memory and abort.

But because fourier transform of each interval is independent (as I understand), how can I somehow get the rows in the output table one by one? So that the memory will not run out? Is there a specific solution to this problem, or is there a general solution to all situations where output should be progressive?

Thank you!

• Can you upload your *.mp3 file somewhere? – J. M. is away Nov 4 '17 at 19:45
• @J.M. It's actually youtube.com/watch?v=3PO_ad80Ld0, converted to mp3 – ZisIsNotZis Nov 4 '17 at 19:49
• You are not going to be able to extract MIDI notes from a performance like that. Just try on the first 30 seconds, and you will see. You can make some progress using AudioMeasurements and/or AudioLocalMeasurements (see "fundamental frequency"). – bill s Nov 4 '17 at 20:10