Linear Volume control

  • I have a control bar that return a value between 0 and 1 (0 = lowest volume (aka : mute), and 1 = highest volume; We'll call this value V), but C2 uses decibels (we'll call it G);

    I did the formula:

    G = x*10*log(V)

    I found out that x ~= 10/3 ; but I don't understand if this is normal that x is different from 1, is that normal that there is a coefficient?

    EDIT: of course, if V = 0, the action will not occur, I don't want a math error because of -infinity

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Would this formula help to calculate your output based on your input?

    (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min

  • Would this formula help to calculate your output based on your input?

    (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min

    LittleStain : I already have a working bar that returns an output in a workable value (from 0 to 1)

    And the formula between output in dB and input in % is not linear (so it is not as simple), I found the result as I said, the problem is I don't fully understand it (I found it because I know how it works, which is not really simple to know I must say)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)