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

FM or heavy PM in TripleOscillator makes outputs odd for some target waveforms #3816

Closed
PhysSong opened this issue Sep 21, 2017 · 3 comments · Fixed by #5651
Closed

FM or heavy PM in TripleOscillator makes outputs odd for some target waveforms #3816

PhysSong opened this issue Sep 21, 2017 · 3 comments · Fixed by #5651

Comments

@PhysSong
Copy link
Member

Step to reproduce:

  1. Add a TripleOscillator.
  2. Set Osc 1 waveform to one of triangle/saw/moog saw/exponential.
  3. Set Osc1 + Osc2 to FM.
  4. Peak amplitude is larger than one without FM(Osc2 and Osc3 volume is zero).

Example: oscbug.mmp.zip

@PhysSong
Copy link
Member Author

I think it is an issue of Oscillator class.
Most of other instrument don't behave like our 3osc does.

@musikBear
Copy link

Could this be related to the 3oc problem here?
#2047
As written here #2047 (comment)
The fix had to be omitted, because of #3292.
A follow up question would be: Should 3oc be changed? What about backward issues?
I think this issue could be compared to FLs 3oc versus the Wasp. Wasp is in essence a 3oc too, so imho it would not be completely crazy to have current 3oc preserved, but add a new '3oc-2000', where all oddities in current 3oc are omitted. Opinions?

@SecondFlight
Copy link
Member

I think this should be closed or at least revisited per #4397.

DigArtRoks added a commit to DigArtRoks/lmms that referenced this issue Aug 22, 2020
…tputs odd for some target waveforms.

The internal waveforms of the class Oscillator produces the wrong amplitude when the input is a
negative phase. When doing PM or FM, negative phases may occur. When a negative phase is e.g. passed
to the the saw sample, it produces values less than -1.0, hence going out of range.

Converted all fraction calls to absFraction calls.

Removed the +2 in the function Oscillator::recalcPhase. The comment here was that it was needed to avoid
negative phases in case of PM. But by converting fraction to absFraction in the waveforms, negative phases
are not an issue anymore. On top of that the m_phase variable gains about 2 extra bits in precision.
As side effect of that, it improves the behaviour of the issue LMMS#2047 - TripleOscillator: Oscillators are getting out of sync.
Though I did not investigate it thoroughly over different notes and samplerates.

Add documentation to the fraction and absFraction functions in lmms_math.h as it was not immediately clear by the name what the
functions do. Correct the implementation of the functions in case the flag __INTEL_COMPILER is set. (floorf rounds always down).
Spekular pushed a commit that referenced this issue Sep 10, 2020
…s odd for some target waveforms. (#5651)

The internal waveforms of the class Oscillator produces the wrong amplitude when the input is a
negative phase. When doing PM or FM, negative phases may occur. When a negative phase is e.g. passed
to the the saw sample, it produces values less than -1.0, hence going out of range.

Converted all fraction calls to absFraction calls.

Removed the +2 in the function Oscillator::recalcPhase. The comment here was that it was needed to avoid
negative phases in case of PM. But by converting fraction to absFraction in the waveforms, negative phases
are not an issue anymore. On top of that the m_phase variable gains about 2 extra bits in precision.
As side effect of that, it improves the behaviour of the issue #2047 - TripleOscillator: Oscillators are getting out of sync.
Though I did not investigate it thoroughly over different notes and samplerates.

Add documentation to the fraction and absFraction functions in lmms_math.h as it was not immediately clear by the name what the
functions do. Correct the implementation of the functions in case the flag __INTEL_COMPILER is set. (floorf rounds always down).
sdasda7777 pushed a commit to sdasda7777/lmms that referenced this issue Jun 28, 2022
…tputs odd for some target waveforms. (LMMS#5651)

The internal waveforms of the class Oscillator produces the wrong amplitude when the input is a
negative phase. When doing PM or FM, negative phases may occur. When a negative phase is e.g. passed
to the the saw sample, it produces values less than -1.0, hence going out of range.

Converted all fraction calls to absFraction calls.

Removed the +2 in the function Oscillator::recalcPhase. The comment here was that it was needed to avoid
negative phases in case of PM. But by converting fraction to absFraction in the waveforms, negative phases
are not an issue anymore. On top of that the m_phase variable gains about 2 extra bits in precision.
As side effect of that, it improves the behaviour of the issue LMMS#2047 - TripleOscillator: Oscillators are getting out of sync.
Though I did not investigate it thoroughly over different notes and samplerates.

Add documentation to the fraction and absFraction functions in lmms_math.h as it was not immediately clear by the name what the
functions do. Correct the implementation of the functions in case the flag __INTEL_COMPILER is set. (floorf rounds always down).
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 a pull request may close this issue.

3 participants