HISE Logo Forum
    • Categories
    • Register
    • Login

    Meters linearity...

    Scheduled Pinned Locked Moved Feature Requests
    1 Posts 1 Posters 96 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ustkU
      ustk
      last edited by ustk

      @Christoph-Hart I always found the behaviour of the meters weird. They are linear... Is that intentional?
      I had a glance at the source, and while the meter class setPeak function has a forcelinear option, it is apparently not used in the processor headers.
      Rather, they seem to be directly constructed using the drawStereoMeter method, and this one linearises the values like so:

      void VuMeter::drawStereoMeter(Graphics &g)
      {
      	const float vL = jmin(1.0f, (l + 100.0f) / 100.0f);
      	const float vR = jmin(1.0f, (r + 100.0f) / 100.0f);
      
      	getLaf()->drawStereoMeter2(g, *this, type, vL, vR);
      }
      

      shouldn't it be instead:

      void VuMeter::drawStereoMeter(Graphics &g)
      {
      	const float vL = jmin(1.0f, Decibels::decibelsToGain(l));
      	const float vR = jmin(1.0f, Decibels::decibelsToGain(r));
      
      	getLaf()->drawStereoMeter2(g, *this, type, vL, vR);
      }
      

      Can't help pressing F5 in the forum...

      1 Reply Last reply Reply Quote 1
      • First post
        Last post

      19

      Online

      1.8k

      Users

      12.1k

      Topics

      105.4k

      Posts