Guitarix
gx_faust_support.h
Go to the documentation of this file.
1 #include <cmath>
2 #include <algorithm>
3 #include "gx_resampler.h"
4 
5 using std::signbit;
6 
7 #define max(x, y) (((x) > (y)) ? (x) : (y))
8 #define min(x, y) (((x) < (y)) ? (x) : (y))
9 
10 template <int N> inline float faustpower(float x) {return powf(x, N);}
11 template <int N> inline double faustpower(double x) {return pow(x, N);}
12 template <int N> inline int faustpower(int x) {return faustpower<N/2>(x) * faustpower<N-N/2>(x);}
13 template <> inline int faustpower<0>(int x) {return 1;}
14 template <> inline int faustpower<1>(int x) {return x;}
15 
16 
17 template<class T> inline T mydsp_faustpower2_f(T x) {return (x * x);}
18 template<class T> inline T mydsp_faustpower3_f(T x) {return ((x * x) * x);}
19 template<class T> inline T mydsp_faustpower4_f(T x) {return (((x * x) * x) * x);}
20 template<class T> inline T mydsp_faustpower5_f(T x) {return ((((x * x) * x) * x) * x);}
21 template<class T> inline T mydsp_faustpower6_f(T x) {return (((((x * x) * x) * x) * x) * x);}
22 
23 #define FAUSTFLOAT float
24 #ifndef N_
25 #define N_(String) (String)
26 #endif
27 #ifndef NC_
28 #define NC_(Context, String) (String)
29 #endif
30 
31 #define always_inline inline __attribute__((__always_inline__))
int faustpower< 1 >(int x)
T mydsp_faustpower4_f(T x)
T mydsp_faustpower2_f(T x)
T mydsp_faustpower3_f(T x)
int faustpower< 0 >(int x)
float faustpower(float x)
T mydsp_faustpower5_f(T x)
T mydsp_faustpower6_f(T x)