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 #define max(x, y) (((x) > (y)) ? (x) : (y))
6 #define min(x, y) (((x) < (y)) ? (x) : (y))
7 
8 template <int N> inline float faustpower(float x) {return powf(x, N);}
9 template <int N> inline double faustpower(double x) {return pow(x, N);}
10 template <int N> inline int faustpower(int x) {return faustpower<N/2>(x) * faustpower<N-N/2>(x);}
11 template <> inline int faustpower<0>(int x) {return 1;}
12 template <> inline int faustpower<1>(int x) {return x;}
13 
14 
15 template<class T> inline T mydsp_faustpower2_f(T x) {return (x * x);}
16 template<class T> inline T mydsp_faustpower3_f(T x) {return ((x * x) * x);}
17 template<class T> inline T mydsp_faustpower4_f(T x) {return (((x * x) * x) * x);}
18 template<class T> inline T mydsp_faustpower5_f(T x) {return ((((x * x) * x) * x) * x);}
19 template<class T> inline T mydsp_faustpower6_f(T x) {return (((((x * x) * x) * x) * x) * x);}
20 
21 #define FAUSTFLOAT float
22 #ifndef N_
23 #define N_(String) (String)
24 #endif
25 #ifndef NC_
26 #define NC_(Context, String) (String)
27 #endif
28 
29 #define always_inline inline __attribute__((__always_inline__))
faustpower< 1 >
int faustpower< 1 >(int x)
Definition: gx_faust_support.h:12
mydsp_faustpower2_f
T mydsp_faustpower2_f(T x)
Definition: gx_faust_support.h:15
faustpower
float faustpower(float x)
Definition: gx_faust_support.h:8
mydsp_faustpower6_f
T mydsp_faustpower6_f(T x)
Definition: gx_faust_support.h:19
mydsp_faustpower3_f
T mydsp_faustpower3_f(T x)
Definition: gx_faust_support.h:16
mydsp_faustpower4_f
T mydsp_faustpower4_f(T x)
Definition: gx_faust_support.h:17
faustpower< 0 >
int faustpower< 0 >(int x)
Definition: gx_faust_support.h:11
mydsp_faustpower5_f
T mydsp_faustpower5_f(T x)
Definition: gx_faust_support.h:18
gx_resampler.h