Can SC generate a frequency spectrogram of a given wav file? (and back again)

  1. Is there (an easy) way in Supercollider to generate a frequency spectrogram (image or number matrix) of a given sound/wav file?

  2. Is there (an easy) way in Supercollider to convert it back again? Despite the effect it won’t be equal to the original sound file.

Assuming that you want to see it on NRT, this is the only thing that I’ve seen so far to do this:

http://sccode.org/1-4WU

1 Like

Hello,

Is the sc-code pointed out by @fmiramar still the only way to use spectrogram in SC?
(Anyway, it is already impressive!) Or am I missing something?

There is also a real-time spectrogram Quark:

@fmiramar
Thank you very much! This is better for me for general purposes!

1 Like

Hi,

Is there a way to know if the spectrogram is currently started or stopped?

I added the method isRunning to check its activity, and made the following PR:

Not knowing your use case, you might also check out FluidBufSTFT from the FluCoMa package www.flucoma.org. Maybe the data formatting with be useful there. You can see the spectrogram using the FluidWaveform object.

1 Like

Legendβ€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž β€Ž

Wow, it is amazing. Is there also a real-time spectrogram there?

It is for sure not set up to work that way. It might be possible to hack into it in order to do a page-scroll sort of thing. If you or someone wants to try I’d be happy to try to help!

1 Like

Thank you for your kind reply!

Um…

Spectrogram and SectrogramWindow quoted above show real-time spectrogram. So I think that implementing real-time functionality in FluidBufSTFT is not urgently needed.

If someone needs a more colourful real-time spectrogram, one or both could be updated. It is just an optional thing.

A page scroll for FluidBufSTFT with zoom functionalities would be great!

1 Like