hey guys,
i was analysing the teensy 4.0 arduino audio examples yesterday. As you can see below, there are some waveforms implemented in this example and i would like to understand what's happening here:
I really don't get how those signed_multiply_ / signed_shift_ functions work... Which value has *bp after every process?
Is there a possibility to avoid those functions? I want to write my own sawtooth synth code with my own increment function and adding those values to the *bp series, but so far i failed terribly...
i was analysing the teensy 4.0 arduino audio examples yesterday. As you can see below, there are some waveforms implemented in this example and i would like to understand what's happening here:
Code:
case WAVEFORM_SQUARE:
magnitude15 = signed_saturate_rshift(magnitude, 16, 1);
for (i=0; i < AUDIO_BLOCK_SAMPLES; i++) {
if (ph & 0x80000000) {
*bp++ = -magnitude15;
} else {
*bp++ = magnitude15;
}
ph += inc;
}
break;
case WAVEFORM_SAWTOOTH:
for (i=0; i < AUDIO_BLOCK_SAMPLES; i++) {
*bp++ = signed_multiply_32x16t(magnitude, ph);
ph += inc;
}
break;
I really don't get how those signed_multiply_ / signed_shift_ functions work... Which value has *bp after every process?
Is there a possibility to avoid those functions? I want to write my own sawtooth synth code with my own increment function and adding those values to the *bp series, but so far i failed terribly...