So a while ago I bought the 2nd speaker add-on for my Pirate Radio to move it up to Stereo. Today I finally replaced the original Pi Zero W with a Zero 2 Wand the performance is so much better. As such I’d like to finally sort out one of the things thats always anoyed me, the VU meter seems to just relate to volume not the rise and fall of the music (if thats clear?) As I use it in a small room, the volume is always low and as such the VU meter just shows the first 2 lights lit up at most.
I’d like it to show the vu meter for the music (regardless of volume) for both channels and say have the brightness of the LEDs increase as the volume increases.
Has anyone done this or know what I can do to implement this? (but be aware my python skills are limited).
The sensitivity of the VU meter can be adjusted. Another forum member Scott posted this in thread I had on it.
You can increase the sensitivity on the Phat Beat VU Meter by doing the following:
cd Pimoroni/pivumeter
nano src/devices/phat-beat.c
Change line 88 to: int bar = (meter_level * (meter_level / 8) / 131071.0f) * (brightness * (NUM_PIXELS/2));
Recompile the library: sudo make sudo make install sudo reboot
Now your VU meter is more sensitive! Tweak the values to your liking.
The following is I believe what i ended up with.
int bar = (meter_level * (meter_level / 8) / 1200000.0f) * (brightness * (NUM_PIXELS/2));
Can you tell me how you got the zero 2 to work? What version OS are you using. I can’t get the buttons nor the VU meter working although the radio plays and can be controlled from my phone. I am using Buster Legacy.
Hi, I used the ‘Legacy OS’ version of raspbain then followed the install instructions. I think if you go with the current (32bit) version of raspbain then you must run apt update before running the install script so that it correctly updates the repos.
I thank Scott and Alphanumeric for this! I’m ashamed to admit how entertaining I find the LEDs zooming up and down on my low volume setup- I’m mostly listening to voice on the BBC and NPR in the US, so I also just had the two lowest green LEDs varying in brightness. I have now adjusted the above described parameter to 150000.0f so on stereo plays and so on I can distinguish the two channels (aren’t we all childish?!). Of course, it tops out easily on orchestral music- but what the hell. I’ll pay for lighting up those red LEDs.