Spectrogram from Buffer
Is there a way to generate a spectrogram (using LCD in my case) by analysing the content of a buffer (it means creating the spectrogram in non realtime).
The idea would be to use the generated spectrogram in conjunction with the waveform (generated by the patch below) and have the spectrogram of the corresponding waveform.
I hope this is clear, and that it's possible.
"Jitter Pvoc 2D" example is really nice but it isn't what I try to get.
Here, we get the Spectrogram in realtime, corresponding to what is currently playing.
What I want to do is to get the Spectrogram from a buffer, like the Spectrogram in a lot of editing software.
1) You load a file in a buffer
2) You click on a button
3) You see the spectrogram of the buffer's content (with LCD or whatever)
I don't see any starting point to do that.
By chance I was working on this recently, although not entirely in the manner you describe. I allow the system to take time to perform an analysis using (p)fft on live recorded material, and have an lcd draw the result as the proces goes on. So it takes realtime to do it.
By the way, as my screen, and therefor the lcd, is not wide enough to draw all frames, I select maximum values for each bin that occur over a number of frames. This method would work well for your waveform drawing method. Rather then drawing specific samples that happen to be at the index you're at, selecting the maximum amplitude over a range (or it's energy content) would result in a better looking waveform.
Maybe there's something in Java that does all this in non-real time.
_
johan
In fact, I would like to actualise the spectrogram every let's say 50 milliseconds for example, to have a similar drawing to what we can get with the [waveform~] but concerning the frequency and not only the amplitude.
To be able to know if I make a loop on a melodic sound or a noisy one.
But thinking about it, it should be pretty hard on the CPU, I'll continue to use the good old amplitude waveform.
But if one day, you come up with what you are talking about, which seems really cool, don't hesitate to show...
Thanks again Johan.