Changeset 2475:6bace8656151 in roaraudio for libroardsp
- Timestamp:
- 08/22/09 15:08:57 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroardsp/synth.c
r2474 r2475 88 88 float t_cur; 89 89 float freq; 90 #ifdef DEBUG 91 float cv0, cv1; 92 #endif 90 93 int i; 91 94 … … 96 99 ROAR_DBG("roar_synth_pcmout_i161(*): state->pcmoffset=%lu", (unsigned long)state->pcmoffset); 97 100 98 t_cur = t_step * (float)state->pcmoffset;101 t_cur = (float)state->pcmoffset/(float)state->rate; 99 102 100 103 freq = state->note->freq; 101 104 105 ROAR_DBG("roar_synth_pcmout_i161(*): t_cur=%f, freq=%f", t_cur, freq); 106 107 #ifdef DEBUG 108 cv0 = 2.0*M_PI*freq*t_cur; 109 #endif 102 110 for (i = 0; i < frames; i++, t_cur += t_step) { 103 111 out[i] = 32767.0*state->volume*state->func(2.0*M_PI*freq*t_cur, state); 104 112 } 113 #ifdef DEBUG 114 cv1 = 2.0*M_PI*freq*t_cur; 115 #endif 116 117 #ifdef DEBUG 118 ROAR_DBG("roar_synth_pcmout_i161(*): cv0=%f, cv1=%f, cv1-cv0=%f", cv0, cv1, cv1-cv0); 119 #endif 105 120 106 121 state->pcmoffset += frames;
Note: See TracChangeset
for help on using the changeset viewer.