Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix limiting FMmodfreqlo #264

Closed
wants to merge 4 commits into from

Conversation

friedolino78
Copy link
Contributor

@friedolino78 friedolino78 commented Nov 3, 2023

this fix eliminates some spectral discontinuities when raising the fm amount.

@fundamental
Copy link
Member

The first commit feels plausibly correct, the second one feels like it would create possible segfaults (in my mind at least). Removing the fmodf() means that tw[i] shifts from being bounded 0..oscillator-size, to being unbounded. Without that constraint then the integer version (the 'high' variable) is again unbounded, so is the code correct with that bound removed?

Also, since there was a flurry of discussion around the FM modulation, let me know if this PR became out-of-date.

@friedolino78
Copy link
Contributor Author

friedolino78 commented Dec 9, 2023

this PR is meant to fix
#261

the unbounded value goes through this chain:
fmold -> tw[i] -> FMmodfreqhi -> carposhi
where some other values are added,
and is bounded then to the correct boundaries.
carposhi &= (synth.oscilsize - 1);

the bounding of fmold, i want to remove leads to discontinuity in the modulator -> frequency jump

@friedolino78 friedolino78 mentioned this pull request Dec 9, 2023
@fundamental
Copy link
Member

ah, as long as carposhi is bounded, then I think this is fine (assuming it improves the FM issues that were being experienced)

@JohannesLorenz
Copy link
Contributor

That bug that I mention here is already fixed by my Envelope fix (which I thought was part of Friedonlino's PRs, but I cannot find it right now). You remember that fix with the weird constants 0.01 and 0.99, where I also asked Paul Nasca (no reply yet)?

@friedolino78
Copy link
Contributor Author

I think and hope the latest commit fixes the fmamp envelope problem of #261.
it seems to be a typo at the definition of MIN_ENVELOPE_DB that affects only amp envelopes at values around 0.

@friedolino78
Copy link
Contributor Author

i removed the special treatment for small values in amp envelopes because they start with 0 even without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants