Sound analysis shaders

Hello to all creators

How to convert the shaders related to sound analysis that are available in shadertoy to sparksl?

Because in all the examples in shadertoy, the sound input is as a texture, which is called music map.

Thank you for your help and if you can send me a converted sample so that I can fully understand

This is an example that was recently uploaded and unfortunately I don’t know how to convert it

iChannel0 is actually just a texture that is generated from the audio input. Once you have that, you can apply this shader to it and get the same results.

The main problem is that spark doesn’t give use that many bands. If I was going to try to recreate it, I would do some interpolation (non-linear) between the 8 bands so I could get more bars on the graph. Then I’d use those values to draw some sdf rects.

Yes, I understand that the sound input is in the form of a texture in shadertoy, but my question was about the same issue, how can I make a similar texture in spark ar? Because the size, color, length, width and number of bars are not known
That’s why I can’t make the same texture

Maybe it won’t be the same texture, but I think we can make something very similar.

The colors in the viz texture seem to be changing hue based on the amplitude of the band… but then the shader is changing the hue anyway, so that value gets discarded. Anyway, you can use a color space patch to apply some hue shift to your bands.

Here’s what the interpolation looks like.

If you want to interpolate between each band twice, you’ll end up with 8 original bands with two segments between each, for a total of 22. I’m too lazy to count the number of band in the shadertoy viz, but you can add or omit interpolations based on your goal number.

I did the first two bands as an example. You should probably create patch assets if you want to expand on this, but I wanted to leave it open so you can see how it works. It’s taking those band + interpolation values and drawing some sdf rects.

spark-band-interpolation.arprojpkg (55.7 KB)

1 Like