Nu:Tekt NTS-1 digital SDK  v1.1-0
Macros
fx_api.h File Reference

Effects runtime API. More...

#include "float_math.h"
#include "int_math.h"
#include "fixed_math.h"

Go to the source code of this file.

Macros

#define __fast_inline   static inline __attribute__((always_inline, optimize("Ofast")))
 

Functions

Noise source
uint32_t _fx_rand (void)
 Random integer. More...
 
__fast_inline uint32_t fx_rand (void)
 
float _fx_white (void)
 Gaussian white noise. More...
 
__fast_inline float fx_white (void)
 

Runtime Environment

const uint32_t k_fx_api_platform
 Current platform.
 
const uint32_t k_fx_api_version
 Current API version.
 
uint32_t _fx_mcu_hash (void)
 Get MCU hash. More...
 
__fast_inline uint32_t fx_mcu_hash (void)
 
uint16_t _fx_get_bpm (void)
 Get current tempo as beats per minute as integer. More...
 
__fast_inline uint16_t fx_get_bpm (void)
 
float _fx_get_bpmf (void)
 Get current tempo as beats per minute as floating point. More...
 
__fast_inline float fx_get_bpmf (void)
 

Sine half-wave

Note
Wrap and negate for phase >= 0.5
#define k_wt_sine_size_exp   (7)
 
#define k_wt_sine_size   (1U<<k_wt_sine_size_exp)
 
#define k_wt_sine_u32shift   (24)
 
#define k_wt_sine_frrecip   (5.96046447753906e-008f)
 
#define k_wt_sine_mask   (k_wt_sine_size-1)
 
#define k_wt_sine_lut_size   (k_wt_sine_size+1)
 
const float wt_sine_lut_f [k_wt_sine_lut_size]
 
__fast_inline float fx_sinf (float x)
 Lookup value of sin(2*pi*x). More...
 
__fast_inline float fx_sinuf (uint32_t x)
 Lookup value of sin(2*pi*x) in [0, 1.0] range. More...
 
__fast_inline float fx_cosf (float x)
 Lookup value of cos(2*pi*x) in [0, 1.0] range. More...
 
__fast_inline float fx_cosuf (uint32_t x)
 Lookup value of cos(2*pi*x) in [0, 1.0] range. More...
 

Various function lookups

#define k_log_size_exp   (8)
 
#define k_log_size   (1U<<k_log_size_exp)
 
#define k_log_mask   (k_log_size-1)
 
#define k_log_lut_size   (k_log_size+1)
 
#define k_tanpi_size_exp   (8)
 
#define k_tanpi_size   (1U<<k_tanpi_size_exp)
 
#define k_tanpi_mask   (k_tanpi_size-1)
 
#define k_tanpi_range_recip   (2.04081632653061f)
 
#define k_tanpi_lut_size   (k_tanpi_size+1)
 
#define k_sqrtm2log_size_exp   (8)
 
#define k_sqrtm2log_size   (1U<<k_sqrtm2log_size_exp)
 
#define k_sqrtm2log_mask   (k_sqrtm2log_size-1)
 
#define k_sqrtm2log_base   (0.005f)
 
#define k_sqrtm2log_range_recip   (1.00502512562814f)
 
#define k_sqrtm2log_lut_size   (k_sqrtm2log_size+1)
 
#define k_pow2_size_exp   (8)
 
#define k_pow2_size   (1U<<k_pow2_size_exp)
 
#define k_pow2_scale   (85.3333333333333f)
 
#define k_pow2_mask   (k_pow2_size-1)
 
#define k_pow2_lut_size   (k_pow2_size+1)
 
const float log_lut_f [k_log_lut_size]
 
const float tanpi_lut_f [k_log_lut_size]
 
const float sqrtm2log_lut_f [k_sqrtm2log_lut_size]
 
const float pow2_lut_f [k_pow2_lut_size]
 
__fast_inline float fx_logf (float x)
 Lookup value of log(x) in [0.00001, 1.0] range. More...
 
__fast_inline float fx_tanpif (float x)
 Lookup value of tan(pi*x) in [0.0001, 0.49] range. More...
 
__fast_inline float fx_sqrtm2logf (float x)
 Lookup value of sqrt(-2*log(x)) in [0.005, 1.0] range. More...
 
__fast_inline float fx_pow2f (float x)
 Lookup value of 2^k for k in [0, 3.0] range. More...
 

Clipping and Saturation.

#define k_cubicsat_size_exp   (7)
 
#define k_cubicsat_size   (1U<<k_cubicsat_size_exp)
 
#define k_cubicsat_mask   (k_cubicsat_size-1)
 
#define k_cubicsat_lut_size   (k_cubicsat_size+1)
 
#define k_schetzen_size_exp   (7)
 
#define k_schetzen_size   (1U<<k_schetzen_size_exp)
 
#define k_schetzen_mask   (k_schetzen_size-1)
 
#define k_schetzen_lut_size   (k_schetzen_size+1)
 
const float cubicsat_lut_f [k_cubicsat_lut_size]
 
const float schetzen_lut_f [k_schetzen_lut_size]
 
__fast_inline float fx_softclipf (const float c, float x)
 Soft clip. More...
 
__fast_inline float fx_sat_cubicf (float x)
 Cubic saturation. More...
 
__fast_inline float fx_sat_schetzenf (float x)
 Schetzen saturation. More...
 

Bit reduction.

#define k_bitres_size_exp   (7)
 
#define k_bitres_size   (1U<<k_bitres_size_exp)
 
#define k_bitres_mask   (k_bitres_size-1)
 
#define k_bitres_lut_size   (k_bitres_size+1)
 
const float bitres_lut_f [k_bitres_lut_size]
 
__fast_inline float fx_bitresf (float x)
 Bit depth scaling table. More...
 

Detailed Description

Effects runtime API.

Definition in file fx_api.h.