synth sine with an exponentially swept frequency doesn't start at zero #647
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
synth sine with a exponentially swept frequency doesn't start at zero
Description
If you run
synth sineat a fixed frequency, the generated wave startsat sample value zero. However, if you use a exponential swept frequency range
like
440/441, it starts at an apparently random offset into the wave,creating a delayed initial click with
chorus,flangerandphaser.The other sweep operators,
:for linear,+for time squared,and
-for the stepped exponential starting at phase 0, all seemto start at the zero-valued start of a cycle.
Analysis
For sweep type Exp, it does
and when
elapsed_time_sis zero,exp()of it is 1 so phase ends up asfmod(chan->freq, 1.0).For the other three wave types, in flow
phaseis 0 whenelapsed_time_sis zero, but for
/it is1.9382e+06which,fmod 1.0, is 0.167612Why it divides
chan->freqbychan->multis unclearThe existence of
-, "a stepped exponential sweep type that starts at phase 0",suggests that the developers were aware of this anomaly.
Conclusion
See if the code can be reworked to give the same exponential frequency sweep
but with the output starting at phase 0.