Hey everyone. I am racking my brain trying to figure this out on my own and had hoped maybe someone can point me in the right direction. I think I am over complicating what I am trying to do.
I was using buzzandy's code to run the animation he has here. Worked great for years with the potentiometer.
I am doing away with the pot in the new board design and going with an INMP441 mic. I am having trouble wrapping my head around the loud audio. If I get to close to a loud source, I want to just normalize that audio.
I do not want to boost low volume, just simple tone down loud audio to not drive the leds at max brightness.
Am I over complicating it? Is it just an if-statement of , if over this value, divide by half? or something like that. I think I need to set a cap for my data and if above that cap, take the capped value instead?
I am not the best at FFT and audio processing so I cant seem to get to the road I need.
My pastebin of just my simple audio processing code. pastebin code
There is no need to use an FFT at all. The audio function you are looking for is called a compressor. Search the web to find out how to implement one.
Well you could do that or similar but you would here the compressor kick in, as if someone just turned down the volume. Is that acceptable?
If it is then it is a slight bit more complex that a divide by two, because you have to take into account the DC offset of the signal, which normally should be half way. So you have to subtract the DC offset value then half it and then add the DC offset value back into it.
You might want to look at this How to get the best from this from this Forum before you proceed any further.
It tells you things like how to post code here, external links to code are not normally acceptable.
I have never complained about too much code.
All I ask you is to do is follow the rules. I didn't make them up.
What others?
As I seem to annoy you, then I have no other option but to consider it mutual.
Welcome to my banned list. You should not here from me again.
Fantastic. You absolutely annoy me with your responses to everyone on this forum. I'm glad you are knowledgeable but you do come off as an Internet a$$ most of the time..
I proudly accept being on your "ban list". Gate keeper of the rules. The fact that you have a list speaks loudly.