[LAD] meterbridge 0.9.2 IEC-scale bug & fix

From: Robin Gareus <robin@email-addr-hidden>
Date: Mon Jun 11 2012 - 20:47:17 EEST

Hi there,

Does anyone have Steve Harris' new email address? steve@email-addr-hidden
fails with "550 5.1.2 Bad destination system address".

Anyway, some of you who package or copied code from meterbridge may be
interested in this as well.

-=-=-=-=-
Hi Steve,

Haven't seen you around much on LAD. I hope this email finds you well.

Are you still maintaining meterbridge? I've stumbled over a bug in 0.9.2
The IEC scale is not continuous. Attached patch resolves the issue.

I don't have access to the IEC-268-18 specs, so I can't tell if the
patch is correct, but it does fix the discontinuity between -60db and
-50db. To make it obvious, here's the annotated iec_scale(float db):

   if (db < -70.0f) {
     def = 0.0f;
   } else if (db < -60.0f) {
     def = (db + 70.0f) * 0.25f; // 0.0 .. 2.5
   } else if (db < -50.0f) {
// def = (db + 60.0f) * 0.5f + 5.0f; // 5.0 .. 10.0 // bug? v0.9.2
     def = (db + 60.0f) * 0.5f + 2.5f; // 2.5 .. 7.5 // fix!
   } else if (db < -40.0f) {
     def = (db + 50.0f) * 0.75f + 7.5; // 7.5 .. 15.0
   } else if (db < -30.0f) {
     def = (db + 40.0f) * 1.5f + 15.0f; // 15.0 .. 30.0
   } else if (db < -20.0f) {
     def = (db + 30.0f) * 2.0f + 30.0f; // 30.0 .. 50.0
   } else if (db < 0.0f) {
     def = (db + 20.0f) * 2.5f + 50.0f; // 50.0 .. 100.0
   } else {
     def = 100.0f;
   }

Furthermore, the DPM image has a couple of problems:
The markers at -10, -19, -20, -25, -30, -35, -55 are off by one pixel
(they need to be moved 1px down), the -45db marker is correct.

The marks for -40, and -50 are missing and it's easy to mistake the
-45db and -55db marks to correspond to the -40db, -50db annotations.

Last but not least, the minus-signs of all annotation does not align
with the marks and the font used for the annotation text is somewhat
blurry..

All fixed in attached image.

Cheers!
robin

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev

iec268-scale.png
Received on Tue Jun 12 00:15:01 2012

This archive was generated by hypermail 2.1.8 : Tue Jun 12 2012 - 00:15:02 EEST