Adjust vumeter on Phatbeat?


#1

Hi,

Is there any way to adjust the sensitivity of the two vumeter displays on the front of a a Phatbeat hat? (…currently mounted in a Pirate Radio)

They only seem to come to life when the volume of the Phatbeat is cranked up loud. Obviously, louder is better - but it isn’t alway practical when you need tunes, but also need to get a one month old to sleep.

Yes, I realise this is all purely cosmetic!!

Cheers, Brendon


#2

Yes and no.

I’m actually still in the midst of (slowly, sorry) migrating the VUMeter code over to a version that uses Python for its front-end. With Python in the mix, it’s much easier for anyone to modify the behaviour of the VUMeter and test it pretty much immediately.

You could brave the development version of VUMeter,

or you could modify the pHAT BEAT plugin of your existing version by editing: https://github.com/pimoroni/pivumeter/blob/master/src/devices/phat-beat.c#L88

Then running the installer again (from your edited local copy).

The plugins unfortunately get no information about how loud the music is, so the scaling factor can’t be (easily) adjusted automatically. I had an idea to use a slow moving-average to set the scale, but then instead switched over to using Python for the front-end, which makes it far easier to support long-term.


#3

That sounds…involved. Thanks anyway, G!


#4

It’s easier than I make it sound :D Honest!

git clone https://github.com/pimoroni/pivumeter

Edit that line.

./setup.sh

Done!


#5

Could you suggest an example changed value, I could then set out on my quest of trial and error.
Thanks a lot in advance,


#6

The default max value is the max sample amplitude. Since they’re signed, 16bit samples they range from -32768 to 32767.

In theory halving that value would double the perceived response on the VU meter. But go to far and you will end up “clipping” dynamics at the higher end since anything larger than your scaling value will be adjusted down to the scaling value before being scaled.

16384 would be a good starting point!

I’d highly recommend using the development branch of Pi VU Meter and scaling the VU using the “vu_scale” option in /etc/asound.conf, since you wont have to recompile on every tweak.


#7

Thanks for this, I will try the development branch this evening.