Package voltage.core

# Class Values

java.lang.Object
voltage.core.Values

public class Values extends Object
Constants and helpful functions.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final double`
  `HALF_PI`
  The value of PI/2
  `static final double`
  `MsPerSample`
  Milliseconds per sample for audio processing
  `static final double`
  `PI`
  The value of PI
  `static final double`
  `SampleRate`
  Internal sample rate
  `static final double`
  `SamplesPerMs`
  Samples per millisecond for main audio processing

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Values()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static double`
  `DecibelsToPercent(double decibels)`
  Convert a decibel value to a percentage.
  `static double`
  `FastAtan(double x)`
  A Fast Atan Approximation (inverse tangent)
  `static double`
  `FastCos(double x)`
  A fast approximation of cos(x)
  `static float`
  `FastEToTheX(float x)`
  A fast approximation of e to the power of x
  `static double`
  `FastRandom()`
  A fast Random number generator
  `static double`
  `FastRandomInclusive()`
  A fast Random number generator
  `static double`
  `FastSin(double x)`
  A fast approximation of sin(x)
  `static double`
  `FastTanh(double x)`
  A Fast Tanh Approximation (inverse hyperbolic tangent)
  `static float`
  `FastTenToTheX(float x)`
  A fast approximation of 10 to the power of x
  `static float`
  `FastTwoToTheX(float x)`
  A fast approximation of 2 to the power of x
  `static double`
  `LinearToVolumeTransform(double linearVal)`
  Convert a linear volume value to a logarithmic volume curve.
  `static double`
  `ParseStringToDouble(String string)`
  Convert a string to a double.
  `static double`
  `PercentToDecibels(double percent)`
  Convert a percentage to a decibel value.
  `static double`
  `VolumeToLinearTransform(double logValue)`
  Convert a decibel value to a percentage.

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### SampleRate

    public static final double SampleRate
    Internal sample rate
    See Also:
      - Constant Field Values

  - ### MsPerSample

    public static final double MsPerSample
    Milliseconds per sample for audio processing
    See Also:
      - Constant Field Values

  - ### SamplesPerMs

    public static final double SamplesPerMs
    Samples per millisecond for main audio processing
    See Also:
      - Constant Field Values

  - ### PI

    public static final double PI
    The value of PI
    See Also:
      - Constant Field Values

  - ### HALF_PI

    public static final double HALF_PI
    The value of PI/2
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Values

    public Values()

- ## Method Details

  - ### LinearToVolumeTransform

    public static double LinearToVolumeTransform(double linearVal)
    Convert a linear volume value to a logarithmic volume curve.
    Parameters:
      `linearVal` - a linear value.
    Returns:
      the value on a logarithmic curve.

  - ### VolumeToLinearTransform

    public static double VolumeToLinearTransform(double logValue)
    Convert a decibel value to a percentage.
    Parameters:
      `logValue` - value on a logarithmic curve.
    Returns:
      a linear value.

  - ### PercentToDecibels

    public static double PercentToDecibels(double percent)
    Convert a percentage to a decibel value.
    Parameters:
      `percent` - a volume percentage.
    Returns:
      a decibel level.

  - ### DecibelsToPercent

    public static double DecibelsToPercent(double decibels)
    Convert a decibel value to a percentage.
    Parameters:
      `decibels` - a decibel level.
    Returns:
      a percentage equivalent of the decibels.

  - ### ParseStringToDouble

    public static double ParseStringToDouble(String string)
    Convert a string to a double.
    Parameters:
      `string` - a string containing a double value.
    Returns:
      a double.

  - ### FastAtan

    public static double FastAtan(double x)
    A Fast Atan Approximation (inverse tangent)
    Parameters:
      `x` - in radians.
    Returns:
      the result in radians

  - ### FastTanh

    public static double FastTanh(double x)
    A Fast Tanh Approximation (inverse hyperbolic tangent)
    Parameters:
      `x` - in radians.
    Returns:
      the result in radians

  - ### FastRandom

    public static double FastRandom()
    A fast Random number generator
    Returns:
      Pseduo-random number, from 0 to 1.0, exclusive

  - ### FastRandomInclusive

    public static double FastRandomInclusive()
    A fast Random number generator
    Returns:
      Pseduo-random number, from 0 to 1.0, inclusive

  - ### FastTwoToTheX

    public static float FastTwoToTheX(float x)
    A fast approximation of 2 to the power of x
    Returns:
      Approximation of 2 to the power of x

  - ### FastTenToTheX

    public static float FastTenToTheX(float x)
    A fast approximation of 10 to the power of x
    Returns:
      Approximation of 10 to the power of x

  - ### FastEToTheX

    public static float FastEToTheX(float x)
    A fast approximation of e to the power of x
    Returns:
      Approximation of e to the power of x

  - ### FastSin

    public static double FastSin(double x)
    A fast approximation of sin(x)
    Returns:
      Approximation of sin(x)

  - ### FastCos

    public static double FastCos(double x)
    A fast approximation of cos(x)
    Returns:
      Approximation of cos(x)