-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFT data seems strange (vastly different to shadertoy.com) #35
Comments
We'll want to compare internal vs. external here, also Mac/Win/Linux. I tested on Mac back in the day as Windows & Linux seemed much more difficult to get running. It may be a couple weeks before I can get setup, so anyone else out there who could help--please do. A test audio pattern with known frequency values (sin 440, or square wave, etc) would make the test easier to judge as to which is truly correct. |
Good idea, i will give it a try if I find some time. |
So it's been a while but I finally had some time to do some more testing! video: https://youtu.be/TAUCjgb8mQQ this is with the following frequencies (as visible in the SuperCollider
ScreenshotsConclusions
I'm honestly not sure if I'm interpreting things correctly here so if you see something differently please let me know 🙂 |
note to self: should try this with internal server. there we might not have this issue |
Edit: nevermind, I forgot it cuts off at 12k, not 24. could still be related though maybe. |
They may be doing a cutoff at 12k just because most interesting-for-graphics audio data is below 12k. Above 12k is not that nice sounding. The highest keys on the piano are just 4kHz. I thought this matched shadertone way-back-when. This could be a change by them? If you scale the lookup into that texture by 1/2, I think you could line them up. Alternatively, feel free to hack away at the code in here: https://github.com/overtone/shadertone/blob/master/src/shadertone/tone.clj#L74-L92 I think I just got it to look "good enough" and moved on. my |
Yeah I tried replicating this here: https://github.com/supercollider/supercollider/blob/f65a1ef7bfb100f4ccb7dcab3a6dff6826be4344/SCClassLibrary/Common/GUI/PlusGUI/Control/FreqScope.sc#L24-L37 but without any luck. whenever I change something it just breaks the whole thing or makes it much much worse. and I guess it doesn't help that I have (for the most part) absolutely no clue about what those calculations do. |
but I will give it another go at some point 😄 |
If it makes you feel any better, I had to study it line-by-line and lookup every single function when I worked on it. FFT is not a basic concept and the docs seem to be super-basic and expect you to be an expert. If FFT details are not familiar, suggest taking your time... |
Thanks, I will try to do that 🙂 |
just a note: after some more investigation it seems like the/(a?) issue would be the lack of |
PV_MagSmear should be equivalent to what is supposed to be just a faster version of it at: https://github.com/overtone/shadertone/blob/master/src/shadertone/tone.clj#L88-L91 If you find that is not the case, that would be a bug. |
I was having trouble porting some shaders from shadertoy.com and after some investigating it looks like the FFT part of :overtone-audio is either incorrect or just somehow quite different to shaertoy.com
This video contains a short demo of what I found: https://www.youtube.com/watch?v=3HWCf0sXXtg
Some observations:
no issues with the waveform 👍-> waveform is from -1 to 1 instead of 0 to 1 (or was it the other way around? - either way, shadertoy.com is one and shadertone is the other)Unfortunately this makes most shaders I found useless since they don't work that well as is (very 'jumpy'/ jittery).
Maybe this is also an issue with my setup as I didn't see anyone else having this kind of problem here (maybe related to #34 / external SC).
This is my current setup on Ubuntu with Jack and external SC:
Edit: the red bar to the right made me curious, so I tried using 1024 as width:
It's sort of strange that the waveform falls to the bottom on shadertoy.com but just continues straight with shadertone - but I'm not exactly sure what to make of it.
The text was updated successfully, but these errors were encountered: