elanhickler

Untitled

Jul 14th, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1.     if (args.numArguments == 1)
  2.     {
  3.         // standard dB to kontakt dB
  4.         double db = args.arguments[0];
  5.         db *= 1.0034333188799371111111111111111;
  6.         db = -db;
  7.  
  8.         // kontakt dB to kontakt amplitude
  9.         double amplitude = pow(10, (db / 20));
  10.         amplitude = round(amplitude*1000000)/1000000;
  11.  
  12.         if (amplitude < 0.015625 || amplitude > 64.0)
  13.             throw SaltJavascriptFatalError(obj, __FUNCTION__, args, "amplitude `"+String(amplitude)+"` is outside of range: 0.015625 to 64.");
  14.  
  15.         return amplitude;
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment