Sonogram with Jitter

Guillaume's icon

Hello all,

I would like to create a real time scrolling sonogram (as in the foobar's audio player for those who knows) with jitter for a performance.
I sought on the forum without succes but I have a plan, let me explain.

1, I catch one fft frame of the sound and put it in a matrix (pfft+jit.poke~) >>done
2, I put the content of this frame in the last column of a new matrix >> I don't know how to do this, any advices are welcome
3, I shift this new matrix to the left with jit.rota with the offset_x param
4, I restart the process.

Is it for you the best way to do ? Or have you other ideas? There is a way to do the step 2 and 3 in a jit.gl.pix directly? It seems there is no way to store data in a jit.gl.pix.

Thank you for your help, and sorry if I'm not clear, english is not my native language :)

Have a nice day

Guillaume

Federico-AmazingMaxStuff's icon

Hey Guillame, Tadej Troljc wrote extensively about this. Here's an article from him:
http://www.tadej-droljc.org/portfolio/sonographic-sound-processing-article/gallery/max-related-articles/
but I remember that he also published a long work on that in pdf form somewhere. You can have luck googling for it.
Just if you didn't know about it

Guillaume's icon

Hey thank you very much Federico (by the way your patreon is fantastic thanks :) )
Yes I already saw his work, and the video demonstration of gpu manipulation on sonogram are insane, one day I will try to do that.

I achieve my sonogram project V1, so I share it here. But I'm sure there are some optimisation to finalize it. Like if I want to increase the resolution of my matrix to 1080, it's drastically decreasing the framerate, obvious you will say, but I'm sure there is a way to display an HD sonogram in real time and in 60fps.
In the list of things to do, I'm think also on some shaders to esthetise the sonogram (brcosa, blur...). Also I think is better if the sonogram scroll horinzontally.

You can help me on one point more I think, in the foobar sonogram visualizer the frequency axis is displayed in a logarithmic way, I try to achieve this in the pfft abstration, puting a scale~ after the last fftin outlet (fft Bin Index). But it's not affecting something... Some ideas?

Thank you very much, and have a nice sunny day (for me at least)

sonogram.zip
application/x-zip-compressed 4.34 KB

Guillaume's icon

on the top, my MaxMsp sonogram (22%CPU, 19%GPU), the other one is foobar in stereo (1%CPU and GPU)... okay that's a (sad) thing, but maybe the foobar sonogram is taking data from the buffer, and not in realtime. but even with that mine could be a little less greedy I suppose.

There is still this frequency display thing. On the second sonogram we can easily see the bass line, It's because on the first half of the diagram we see frequencies from 60Hz to 500Hz more or less, and all the rest of the frequencies are concentrated on the second half of the diagram, and maybe the diagram stop to analy freqs at 10kHZ I don't know. But I really want to know how to do that in pfft... if someone pass his way here and know how to do, thanks :)