Changeset 2482:98c1836272a8 in roaraudio
- Timestamp:
- 08/23/09 16:07:35 (15 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
include/libroardsp/synth.h
r2433 r2482 42 42 43 43 // SYNF -> Synthesis Function 44 #define ROAR_SYNTH_SYNF_SIN ROAR_SYNTH_FUNC_CAST(sinf)45 44 #define ROAR_SYNTH_SYNF_RECT ROAR_SYNTH_FUNC_CAST(roar_synth_synf_rect) 46 45 #define ROAR_SYNTH_SYNF_SAW ROAR_SYNTH_FUNC_CAST(roar_synth_synf_saw) 47 46 #define ROAR_SYNTH_SYNF_TRI ROAR_SYNTH_FUNC_CAST(roar_synth_synf_tri) 48 47 #define ROAR_SYNTH_SYNF_TRAP ROAR_SYNTH_FUNC_CAST(roar_synth_synf_trap) 48 49 // those use sin*() 50 #ifdef ROAR_HAVE_LIBM 51 #define ROAR_SYNTH_SYNF_SIN ROAR_SYNTH_FUNC_CAST(sinf) 49 52 #define ROAR_SYNTH_SYNF_S2S ROAR_SYNTH_FUNC_CAST(roar_synth_synf_s2s) 53 #endif 50 54 51 55 struct roar_synth_state { … … 70 74 float roar_synth_synf_tri (float t, struct roar_synth_state * state); 71 75 float roar_synth_synf_trap (float t, struct roar_synth_state * state); 76 77 #ifdef ROAR_HAVE_LIBM 72 78 float roar_synth_synf_s2s (float t, struct roar_synth_state * state); 79 #endif 73 80 74 81 #endif -
libroardsp/synth.c
r2475 r2482 24 24 25 25 #include "libroardsp.h" 26 27 #if !defined(ROAR_HAVE_LIBM) && !defined(M_PI) 28 #define M_PI 3.141592 29 #endif 26 30 27 31 #define _CHECK_BASIC() if ( state == NULL ) return -1 … … 169 173 } 170 174 175 #ifdef ROAR_HAVE_LIBM 171 176 float roar_synth_synf_s2s (float t, struct roar_synth_state * state) { 172 177 float sin2 = sinf(t/1.2); … … 174 179 return sin2*sin2 * sin(t*1.2); 175 180 } 181 #endif 176 182 177 183 //ll
Note: See TracChangeset
for help on using the changeset viewer.