Spectrum

The Spectrum System

  • The Spectrum System take an audio source and convert it into a frequency texture.

  • The frequency texture is a 64x64 texture of 2 channel (Red and Green)

  • The texture is global and can be accessed by any shader just by name.

Technology used

We didn't invent anything, the Spectrum System use the Unity build in function "AudioSource.GetSpectrumData(...)". With this function, we extract 512 frequencies 60 time per seconds. Then we apply some logic to convert to our 62x62 texture.

Reminder about texture

  • You can see a texture like a grid where the start is the (0, 0) coordinate at the lower left corner.

  • From left to right, the coordinate is called "U" from 0.0 to 1.0

  • From Bottom to top, the coordinate is called "V" from 0.0 to 1.0

Spectrum Global Texture

The global texture resolution is 64x64 and have 2 channel (Red and Green)

Red Channel: Histogram of previous frequencies

  • On the U axis, you have the frequencies from ~80hz to ~20khz,

  • On the V axis, you have the time from 0 to ~1.0 second.

Green Channel: dampened frequencies

  • On the U axis, you have the frequencies from ~80hz to ~20khz,

  • On the V axis, you have the "average" frequency in time. The closer you are to 0 the more reactive will be the frequencies variation, the closer to 1.0 you are, the smoother will be the reactivity.

Make your own shader (Amplify Shader Editor)

  • The only thing you need to make your own Spectrum shader is to use the Global "IWO_FFT_FT" texture.

  • Set the Type to Global and set the name to "IWO_FFT_FT".

  • Then use the R and G channel as you like !

  • For testing an avatar, just upload it to your space.

Last updated