pub_123 | Posted: 30 Aug 2021, 10:09 AM |
---|---|
Member Posts: 5 Joined: 30-August 21 |
I'm currently building my own software synthesizer and it's all well and good, except one small problem. When performing fm synthesis after some time it begins to crackle and pitch out slightly. After some experimentation i determined that this function is a culprit.
w() calculates angular velocity and dTime is determined by a counter with something like this:
Could someone please help me with this. Thanks in advance. ------------- |
[top] | |
mit | Posted: 30 Aug 2021, 10:21 AM |
yeah whatever Admin Posts: 566 Joined: 4-May 16 |
QUOTE (pub_123)
When you have a problem like that it's almost always the limit of the floating point precision catching up with you. It's imperative to keep those doubles in the usable range by wrapping them when they get too big.after some time it begins to crackle and pitch out slightly Something like should do it. In the case of FM synthesis, sometimes you have to wrap in both directions. Last edit by mit at 30 Aug 2021, 10:22 AM ------------- |
[top] | |
pub_123 | Posted: 30 Aug 2021, 01:24 PM |
Member Posts: 5 Joined: 30-August 21 |
Well i attempted to wrap them from both dirrection. However all it does is increase ammount of time before the crackling starts. https://mega.nz/file/nuwwSI5K#oESTuPW3__IMJv5Mr4VgqRJqX6zk9Z_ESuxhbYdVhLQ ------------- |
[top] | |
mit | Posted: 1 Sep 2021, 09:13 AM |
yeah whatever Admin Posts: 566 Joined: 4-May 16 |
Where did you put the wrap code? It would need to go right after wherever dTime is increased. And any other angular variables will need to be wrapped also. In my synths I usually have a separate phase variable for each oscillator instead. In the case of FM, the modulated oscillator's phase is increased by the output of the previous oscillator, and that's when it's possible for phase to go backwards and needs wrapping in both directions. Technically that's "phase modulation" but virtually all digital FM synthesis is technically phase modulation. ------------- |
[top] | |
pub_123 | Posted: 5 Sep 2021, 07:05 PM |
Member Posts: 5 Joined: 30-August 21 |
I looked into it some more and i found that i need to cap both of the phases separately because both of these run at different frequencies. It makes much more sense to store them as seperate variables for phase and cap them that way. ------------- |
[top] | |
Sign in to post a reply.