[LAD] meterbridge 0.9.2 IEC-scale bug & fix

Robin Gareus robin at gareus.org
Mon Jun 11 17:47:17 UTC 2012


Hi there,

Does anyone have Steve Harris' new email address? steve at plugin.org.uk
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: meterbridge-0.9.2-iec_fix.diff
Type: text/x-patch
Size: 516 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20120611/36e2d788/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iec268-scale.png
Type: image/png
Size: 1389 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20120611/36e2d788/attachment.png>


More information about the Linux-audio-dev mailing list