BSE Interface Reference

/opt/src/beast/bse/bsemathsignal.h

SYNOPSIS

DESCRIPTION

BseFrequencyModulator

/opt/src/beast/bse/bsemathsignal.h:90
struct BseFrequencyModulator
{
  gfloat fm_strength;
  guint  exponential_fm;
  gfloat signal_freq;
  gint   fine_tune;
};

_bse_init_signal

/opt/src/beast/bse/bsemathsignal.h:706

bse_approx2_exp2

/opt/src/beast/bse/bsemathsignal.h:192
Fast approximation of 2 raised to the power of ex. Within -1..+1, the error stays below 0.01275 which corresponds to a sample precision of 6.2 bit, the average error amounts to 0.001914. For integer values of ex (i.e. ex - floor (ex) -> 0), the error approaches zero. On a 2GHz machine, execution takes roughly 12.81 ns.
ex: exponent within [-127..+127]
RETURNS: y approximating 2^ex

bse_approx2_tanh

/opt/src/beast/bse/bsemathsignal.h:289
Fast approximation of the hyperbolic tangent of x. Within -1..+1, the error stays below 0.00436 which corresponds to a sample precision of 7.8 bit, the average error amounts to 0.00069220. On a 2GHz machine, execution takes roughly 24.48 ns.
x: exponent within [-127..+127]
RETURNS: y approximating tanh(x)

bse_approx3_exp2

/opt/src/beast/bse/bsemathsignal.h:204
Fast approximation of 2 raised to the power of ex. Within -1..+1, the error stays below 0.001123415 which corresponds to a sample precision of 9.7 bit, the average error amounts to 0.000133. For integer values of ex (i.e. ex - floor (ex) -> 0), the error approaches zero. On a 2GHz machine, execution takes roughly 13.74 ns.
ex: exponent within [-127..+127]
RETURNS: y approximating 2^ex

bse_approx3_tanh

/opt/src/beast/bse/bsemathsignal.h:300
Fast approximation of the hyperbolic tangent of x. Within -1..+1, the error stays below 0.0003857 which corresponds to a sample precision of 7.8 bit, the average error amounts to 0.00004827. On a 2GHz machine, execution takes roughly 25.78 ns.
x: exponent within [-127..+127]
RETURNS: y approximating tanh(x)

bse_approx4_exp2

/opt/src/beast/bse/bsemathsignal.h:216
Fast approximation of 2 raised to the power of ex. Within -1..+1, the error stays below 7.876055e-05 which corresponds to a sample precision of 13.6 bit, the average error amounts to 7.7012792e-06. For integer values of ex (i.e. ex - floor (ex) -> 0), the error approaches zero. On a 2GHz machine, execution takes roughly 16.46 ns.
ex: exponent within [-127..+127]
RETURNS: y approximating 2^ex

bse_approx4_tanh

/opt/src/beast/bse/bsemathsignal.h:311
Fast approximation of the hyperbolic tangent of x. Within -1..+1, the error stays below 2.7017507e-05 which corresponds to a sample precision of 15.1 bit, the average error amounts to 2.799594e-06. On a 2GHz machine, execution takes roughly 28.41 ns.
x: exponent within [-127..+127]
RETURNS: y approximating tanh(x)

bse_approx5_exp2

/opt/src/beast/bse/bsemathsignal.h:228
Fast approximation of 2 raised to the power of ex. Within -1..+1, the error stays below 4.60807023e-06 which corresponds to a sample precision of 17.7 bit, the average error amounts to 3.842199e-07. For integer values of ex (i.e. ex - floor (ex) -> 0), the error approaches zero. On a 2GHz machine, execution takes roughly 18.51 ns.
ex: exponent within [-127..+127]
RETURNS: y approximating 2^ex

bse_approx5_tanh

/opt/src/beast/bse/bsemathsignal.h:322
Fast approximation of the hyperbolic tangent of x. Within -1..+1, the error stays below 1.582042006e-06 which corresponds to a sample precision of 19.2 bit, the average error amounts to 1.42780810e-07. On a 2GHz machine, execution takes roughly 30.35 ns.
x: exponent within [-127..+127]
RETURNS: y approximating tanh(x)

bse_approx6_exp2

/opt/src/beast/bse/bsemathsignal.h:240
Fast approximation of 2 raised to the power of ex. Within -1..+1, the error stays below 2.5505813e-07 which corresponds to a sample precision of 21.9 bit, the average error amounts to 2.1028377e-08. For integer values of ex (i.e. ex - floor (ex) -> 0), the error approaches zero. On a 2GHz machine, execution takes roughly 21.84 ns.
ex: exponent within [-127..+127]
RETURNS: y approximating 2^ex

bse_approx6_tanh

/opt/src/beast/bse/bsemathsignal.h:333
Fast approximation of the hyperbolic tangent of x. Within -1..+1, the error stays below 9.7878796e-08 which corresponds to a sample precision of 23.2 bit, the average error amounts to 1.3016999e-08. On a 2GHz machine, execution takes roughly 34.29 ns.
x: exponent within [-127..+127]
RETURNS: y approximating tanh(x)

bse_approx7_exp2

/opt/src/beast/bse/bsemathsignal.h:252
Fast approximation of 2 raised to the power of ex. Within -1..+1, the error stays below 4.1074325e-08 which corresponds to a sample precision of 24.5 bit, the average error amounts to 7.7448985e-09. For integer values of ex (i.e. ex - floor (ex) -> 0), the error approaches zero. On a 2GHz machine, execution takes roughly 23.79 ns.
ex: exponent within [-127..+127]
RETURNS: y approximating 2^ex

bse_approx7_tanh

/opt/src/beast/bse/bsemathsignal.h:344
Fast approximation of the hyperbolic tangent of x. Within -1..+1, the error stays below 4.4375671e-08 which corresponds to a sample precision of 24.4 bit, the average error amounts to 9.5028421e-09. On a 2GHz machine, execution takes roughly 36.86 ns.
x: exponent within [-127..+127]
RETURNS: y approximating tanh(x)

bse_approx8_exp2

/opt/src/beast/bse/bsemathsignal.h:265
Fast approximation of 2 raised to the power of ex. Within -1..+1, the error stays below 4.1074325e-08 which corresponds to a sample precision of 24.5 bit, the average error amounts to 7.6776048e-09. Note that there is no significant precision increment over bse_approx7_exp2(). For integer values of ex (i.e. ex - floor (ex) -> 0), the error approaches zero. On a 2GHz machine, execution takes roughly 26.59 ns.
ex: exponent within [-127..+127]
RETURNS: y approximating 2^ex

bse_approx8_tanh

/opt/src/beast/bse/bsemathsignal.h:356
Fast approximation of the hyperbolic tangent of x. Within -1..+1, the error stays below 4.4375671e-08 which corresponds to a sample precision of 24.4 bit, the average error amounts to 9.49155722e-09. Note that there is no significant precision increment over bse_approx7_tanh(). On a 2GHz machine, execution takes roughly 42.03 ns.
x: exponent within [-127..+127]
RETURNS: y approximating tanh(x)

bse_approx9_exp2

/opt/src/beast/bse/bsemathsignal.h:278
Fast approximation of 2 raised to the power of ex. Within -1..+1, the error stays below 4.1074325e-08 which corresponds to a sample precision of 24.5 bit, the average error amounts to 7.677515903e-09. Note that there is no significant precision increment over bse_approx7_exp2(). For integer values of ex (i.e. ex - floor (ex) -> 0), the error approaches zero. On a 2GHz machine, execution takes roughly 29.40 ns.
ex: exponent within [-127..+127]
RETURNS: y approximating 2^ex

bse_approx9_tanh

/opt/src/beast/bse/bsemathsignal.h:368
Fast approximation of the hyperbolic tangent of x. Within -1..+1, the error stays below 4.4375671e-08 which corresponds to a sample precision of 24.4 bit, the average error amounts to 9.49141881e-09. Note that there is no significant precision increment over bse_approx7_tanh(). On a 2GHz machine, execution takes roughly 43.83 ns.
x: exponent within [-127..+127]
RETURNS: y approximating tanh(x)

bse_approx_atan1

/opt/src/beast/bse/bsemathsignal.h:126
double  bse_approx_atan1 
(register double x);
Fast atan(x)/(PI/2) approximation, with maximum error < 0.01 and bse_approx_atan1(0)==0, according to the formula: n1 = -0.41156875521951602506487246309908; n2 = -1.0091272542790025586079663559158; d1 = 0.81901156857081841441890603235599; d2 = 1.0091272542790025586079663559158; positive_atan1(x) = 1 + (n1 * x + n2) / ((1 + d1 * x) * x + d2);
x: x as in atan(x)

bse_approx_atan1_prescale

/opt/src/beast/bse/bsemathsignal.h:136
Calculate the prescale factor for bse_approx_atan1(x*prescale) from a linear boost factor, where 0.5 amounts to prescale=1.0, 1.0 results in maximum boost and 0.0 results in maximum attenuation.
boost_amount: boost amount between [0..1]
RETURNS: prescale factor for bse_approx_atan1()

bse_approx_qcircle1

/opt/src/beast/bse/bsemathsignal.h:147
double  bse_approx_qcircle1 
(register double x);
Fast approximation of the upper right quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092.
x: x within [0..1]
RETURNS: y for circle approximation within [0..1]

bse_approx_qcircle2

/opt/src/beast/bse/bsemathsignal.h:158
double  bse_approx_qcircle2 
(register double x);
Fast approximation of the upper left quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092.
x: x within [0..1]
RETURNS: y for circle approximation within [0..1]

bse_approx_qcircle3

/opt/src/beast/bse/bsemathsignal.h:169
double  bse_approx_qcircle3 
(register double x);
Fast approximation of the lower left quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092.
x: x within [0..1]
RETURNS: y for circle approximation within [0..1]

bse_approx_qcircle4

/opt/src/beast/bse/bsemathsignal.h:180
double  bse_approx_qcircle4 
(register double x);
Fast approximation of the lower right quadrant of a circle. Errors at x=0 and x=1 are zero, for the rest of the curve, the error wasn't minimized, but distributed to best fit the curverture of a quarter circle. The maximum error is below 0.092.
x: x within [0..1]
RETURNS: y for circle approximation within [0..1]

bse_frequency_modulator

/opt/src/beast/bse/bsemathsignal.h:101
void  bse_frequency_modulator 
(const BseFrequencyModulator *fm,
 guint                        n_values,
 const gfloat                *ifreq,
 const gfloat                *ifmod,
 gfloat                      *fm_buffer);

bse_saturate_branching

/opt/src/beast/bse/bsemathsignal.h:394
Clamp value within -limit and +limit. Limiting is performed by executing conditions and branches, so it will probably run slower than bse_saturate_hard() on many machines. On a 2GHz machine, execution takes roughly 8.29 ns.
value: value to saturate
limit: limit not to be exceeded by value
RETURNS: value bounded by -limit and limit

bse_saturate_hard

/opt/src/beast/bse/bsemathsignal.h:381
double  bse_saturate_hard 
(double value,
 double limit);
Clamp value within -limit and +limit. Limiting is performed by floating point operations only, thus executing faster than condition based branching code on most modern architectures. On a 2GHz machine, execution takes roughly 6.86 ns.
value: value to saturate
limit: limit not to be exceeded by value
RETURNS: value bounded by -limit and limit

bse_semitone_table_from_tuning

/opt/src/beast/bse/bsemathsignal.h:397
const double*  bse_semitone_table_from_tuning 
(BseMusicalTuningType musical_tuning);

bse_signal_value_clip

/opt/src/beast/bse/bsemathsignal.h:77
double  bse_signal_value_clip 
(register double x);

bse_transpose_factor

/opt/src/beast/bse/bsemathsignal.h:399
double  bse_transpose_factor 
(BseMusicalTuningType musical_tuning,
 int                  index);

bse_window_bartlett

/opt/src/beast/bse/bsemathsignal.h:105

bse_window_blackman

/opt/src/beast/bse/bsemathsignal.h:106

bse_window_cos

/opt/src/beast/bse/bsemathsignal.h:107

bse_window_hamming

/opt/src/beast/bse/bsemathsignal.h:108

bse_window_rect

/opt/src/beast/bse/bsemathsignal.h:110

bse_window_sinc

/opt/src/beast/bse/bsemathsignal.h:109