- Timestamp:
- Oct 27, 2013, 11:36:06 PM (11 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 650cae3
- Parents:
- dc467b5d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/synth/wavetable.c
rdc467b5d r8247249 86 86 smpl_t pos = s->last_pos; 87 87 for (i = 0; i < output->length; i++) { 88 if ( s->freq != s->target_freq)88 if ( ABS(s->freq - s->target_freq) > ABS(s->inc_freq) ) 89 89 s->freq += s->inc_freq; 90 else 91 s->freq = s->target_freq; 90 92 smpl_t inc = s->freq * (smpl_t)(s->wavetable_length) / (smpl_t) (s->samplerate); 91 93 pos += inc; … … 117 119 smpl_t pos = s->last_pos; 118 120 for (j = 0; j < output->length; j++) { 119 if ( s->freq != s->target_freq)121 if ( ABS(s->freq - s->target_freq) > ABS(s->inc_freq) ) 120 122 s->freq += s->inc_freq; 123 else 124 s->freq = s->target_freq; 121 125 smpl_t inc = s->freq * (smpl_t)(s->wavetable_length) / (smpl_t) (s->samplerate); 122 126 pos += inc; … … 124 128 pos -= s->wavetable_length; 125 129 } 130 if ( ABS(s->amp - s->target_amp) > ABS(s->inc_amp) ) 131 s->amp += s->inc_amp; 132 else 133 s->amp = s->target_amp; 126 134 for (i = 0; i < output->height; i++) { 127 output->data[i][j] = interp_2(s->wavetable, pos);135 output->data[i][j] = s->amp * interp_2(s->wavetable, pos); 128 136 } 129 137 }
Note: See TracChangeset
for help on using the changeset viewer.