Changeset 2424:ebf8be51199e in roaraudio for libroardsp
- Timestamp:
- 08/19/09 04:55:29 (15 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroardsp/midi.c
r1880 r2424 146 146 int i, c; 147 147 float ct; 148 float step = M_PI*2*note->freq/rate;148 float step = 1.0/rate; 149 149 int16_t s; 150 150 float (*op)(float x) = NULL; … … 166 166 return -1; 167 167 168 ROAR_DBG("roar_midi_gen_tone(*): t=%f", t); 169 168 170 for (ct = 0, i = 0; ct <= t; ct += step, i += channels) { 169 s = 32767*op(ct); 171 s = 32767*op(2.0*M_PI*note->freq*ct); 172 173 // ROAR_DBG("roar_midi_gen_tone(*): t=%f, ct=%f, i=%i", t, ct, i); 170 174 171 175 for (c = 0; c < channels; c++) 172 176 samples[i+c] = s; 173 177 } 178 179 ROAR_DBG("roar_midi_gen_tone(*): t=%f, ct=%f, i=%i", t, ct, i); 174 180 175 181 return 0;
Note: See TracChangeset
for help on using the changeset viewer.