Math

A collection of plugins that implement most of the functions and constants in the standard C header <math.h>. For the functions, the input ports are the parameters to the function and the output ports are the returned values. For the constants, the output ports will always contain the constant's value. All functions are available as audio rate and control rate plugins, the constants are only available as control rate plugins.

Functions

acos
Computes the arc cosine of the value in the input port and writes the result to the output port in radians. The output will be in the range [0, π].

asin
Computes the arc sine of the value in the input port and writes the result to the output port in radians. The output will be in the range [-π/2, π/2].

atan
Computes the arc tangent of the value in the input port and writes the result to the output port in radians. The output will be in the range [-π/2, π/2].

atan2(x,y)
Computes the arc tangent of y / x and writes the result to the output port in radians. The signs of the input values are used to determine the quadrant of the result. The output will be in the range [-π, π].

ceil
Computes the smallest integer that is larger than or equal to the value in the input port and writes it to the output port.

cos
Computes the cosine of the value in the input port, in radians, and writes the result to the output port. The output will be in the range [-1, 1].

cosh
Computes the hyperbolic cosine of the value in the input port, in radians, and writes the result to the output port.

exp
Computes ex where x is the value in the input port and writes the result to the output port.

abs
Computes the absolute value of the value in the input port and writes the result to the output port.

floor
Computes the largest integer that is smaller than or equal to the value in the input port and writes it to the output port.

fmod(x,y)
Computes the remainder of the division x / y, where x and y are the values in the input ports, and writes the result to the output port.

log
Computes the natural logarithm of the value in the input port and writes the result to the output port.

log10
Computes the base 10 logarithm of the value in the input port and writes the result to the output port.

modf
Breaks the value in the input port into an integer part and a fractional part and writes the two values to the output ports.

pow(x,y)
Computes xy, where x and y are the values in the input ports, and writes the result to the output port.

sin
Computes the sine of the value in the input port, in radians, and writes the result to the output port. The output will be in the range [-1, 1].

sinh
Computes the hyperbolic sine of the value in the input port, in radians, and writes the result to the output port.

sqrt
Computes the square root of the value in the input port and writes the result to the output port.

tan
Computes the tangent of the value in the input port, in radians, and writes the result to the output port.

tanh
Computes the hyperbolic tangent of the value in the input port, in radians, and writes the result to the output port.

Constants

e
The base of the natural logarithm. The numerical value is approximately 2.7183.

log2(e)
The base 2 logarithm of the base of the natural logarithm. Useful for converting between base 2 logarithms and natural logarithms. The numerical value is approximately 1.4427.

log10(e)
The base 10 logarithm of the base of the natural logarithm. Useful for converting between base 10 logarithms and natural logarithms. The numerical value is approximately 0.43429.

ln(2)
The natural logarithm of 2. Useful for converting between base 2 logarithms and natural logarithms. The numerical value is approximately 0.6931.

ln(10)
The natural logarithm of 10. Useful for converting between base 10 logarithms and natural logarithms. The numerical value is approximately 2.3026.

pi
π. The numerical value is approximately 3.1416.

pi/2
π/2. The numerical value is approximately 1.5708.

pi/4
π/4. The numerical value is approximately 0.7854.

1/pi
1/π. The numerical value is approximately 0.3183.

2/pi
2/π. The numerical value is approximately 0.6366.

2/sqrt(pi)
2/sqrt(π). The numerical value is approximately 1.1284.

sqrt(2)
The square root of 2. The numerical value is approximately 1.4142.

sqrt(1/2)
The square root of 1/2. The numerical value is approximately 0.7071.