AudioSynthWaveformModulated pk-pk values?

tigger

Active member
with amplitude(1.0), what is the pk-to-pk limits of the various waveforms?
WAVEFORM_BANDLIMIT_SAWTOOTH
WAVEFORM_BANDLIMIT_PULSE
WAVEFORM_TRIANGLE_VARIABLE

It looks like the levels for the flat parts of WAVEFORM_BANDLIMIT_PULSE lower than for WAVEFORM_PULSE because of there is more head room needed to band limit the waveform, for example. If so, how much different is the "flat part" of the pulse waveform for the band limited version vs. the regular?

I found this in synth_waveform.cpp...
int16_t BandLimitedWaveform::generate_pulse (uint32_t new_phase, uint32_t pulse_width, int i)
{
...
return (int16_t) ((sample >> 1) - (sample >> 5)) ; // scale down to avoid overflow on narrow pulses, where the DC shift is big
}

and this...
#define BASE_AMPLITUDE 0x6000 // 0x7fff won't work due to Gibb's phenomenon, so use 3/4 of full range.

but I'm not sure how much the overall amplitude of the pulse waveform is decreased for the WAVEFORM_BANDLIMIT_PULSE compared to the WAVEFORM_PULSE which seems to just set the value to max or min ( + or - magnitude15).
 
Back
Top