Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static void effecte_karplus_strong(mod_channel *ch)
- {
- if (mod_tick == 0)
- {
- if (ch->sample > 0)
- {
- MODULE_SAMPLE *s = &source->samples[ch->sample - 1];
- signed char *sample_loop_data = &source->sample_data[s->offset + s->loop_start];
- unsigned int loop_length = s->loop_length - 2;
- unsigned int loop_length_counter = loop_length;
- /* interpolate whole sample loop each row */
- while (loop_length_counter--)
- {
- *sample_loop_data = (*sample_loop_data + *(sample_loop_data + 1)) / 2;
- sample_loop_data++;
- }
- /* interpolate with: last sample in loop + first sample in loop */
- *sample_loop_data = (*sample_loop_data + *(sample_loop_data - loop_length)) / 2;
- }
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement