|
|
|
|
|
|
|
|
val2 = AudioWaveformSine[index+1]; |
|
|
val2 = AudioWaveformSine[index+1]; |
|
|
scale = (ph >> 8) & 0xFFFF; |
|
|
scale = (ph >> 8) & 0xFFFF; |
|
|
val2 *= scale; |
|
|
val2 *= scale; |
|
|
val1 *= 0xFFFF - scale; |
|
|
|
|
|
|
|
|
val1 *= 0x10000 - scale; |
|
|
#if defined(KINETISK) |
|
|
#if defined(KINETISK) |
|
|
block->data[i] = multiply_32x32_rshift32(val1 + val2, magnitude); |
|
|
block->data[i] = multiply_32x32_rshift32(val1 + val2, magnitude); |
|
|
#elif defined(KINETISL) |
|
|
#elif defined(KINETISL) |
|
|
|
|
|
|
|
|
val2 = AudioWaveformSine[index+1]; |
|
|
val2 = AudioWaveformSine[index+1]; |
|
|
scale = (ph >> 8) & 0xFFFF; |
|
|
scale = (ph >> 8) & 0xFFFF; |
|
|
val2 *= scale; |
|
|
val2 *= scale; |
|
|
val1 *= 0xFFFF - scale; |
|
|
|
|
|
|
|
|
val1 *= 0x10000 - scale; |
|
|
//block->data[i] = (((val1 + val2) >> 16) * magnitude) >> 16; |
|
|
//block->data[i] = (((val1 + val2) >> 16) * magnitude) >> 16; |
|
|
block->data[i] = multiply_32x32_rshift32(val1 + val2, magnitude); |
|
|
block->data[i] = multiply_32x32_rshift32(val1 + val2, magnitude); |
|
|
// -32768 = no phase increment |
|
|
// -32768 = no phase increment |
|
|
|
|
|
|
|
|
val2 = AudioWaveformSine[index+1]; |
|
|
val2 = AudioWaveformSine[index+1]; |
|
|
scale = (ph >> 8) & 0xFFFF; |
|
|
scale = (ph >> 8) & 0xFFFF; |
|
|
val2 *= scale; |
|
|
val2 *= scale; |
|
|
val1 *= 0xFFFF - scale; |
|
|
|
|
|
|
|
|
val1 *= 0x10000 - scale; |
|
|
block->data[i] = (val1 + val2) >> 16; |
|
|
block->data[i] = (val1 + val2) >> 16; |
|
|
ph += inc; |
|
|
ph += inc; |
|
|
} |
|
|
} |