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

FM3 Oscillators | Subharmonic and Harmonic Ratio Input #2363

Closed
ghost opened this issue Jul 22, 2020 · 18 comments · Fixed by #3179
Closed

FM3 Oscillators | Subharmonic and Harmonic Ratio Input #2363

ghost opened this issue Jul 22, 2020 · 18 comments · Fixed by #3179
Labels
DSP Issues and feature requests related to sound generation in the synth Feature Request New feature request
Milestone

Comments

@ghost
Copy link

ghost commented Jul 22, 2020

Documenting from Slack discussions, proposed enhancements to the Surge FM2 and FM3 oscillators to permit input a range of both subharmonic and harmonic values.

FM2 Oscillator
Currently the M1 and M2 Ratio sliders of the FM2 oscillator permit specifying harmonics in the range of 1 to 32.

Proposed enhancements:
Have the M1 and M2 Ratio sliders centered in their ranges, with the 1/1 in the center, and allow input of a range of sub/harmonics from -32 to 32.

Optionally, once the sliders are moved, and snapped to a particular ratio selection, offer the ability to typein floating point offset values in the right-click context menu with two decimal places of resolution, for specifying inharmonic ratios, such as 1.99, 3.01, 5.98, etc.

FM3 Oscillator
Currently, the M1 and M2 Ratio slider controls permit input of ratios with two decimal places of floating point resolution in the range of 1 to 32, while the M3 Frequency slider operates exclusively in an absolute-frequency mode within the range of 13.75 to 25,087.71 Hz.

Proposed enhancements:
Add a right-click context menu option that would enable independently switching each of the M1, M2 and M3 sliders between either Ratio or Absolute Frequency.

When any FM3 oscillator M1, M2 and M3 slider is in Ratio mode...
Have the M1, M2 and M3 sliders centered in their ranges with the 1/1 in the center, and permit input of values in the range of -32.00 to 32.00, both using the slider controls, as well as typeins.

When any FM3 oscillator M1, M2 and M3 slider is in Absolute frequency mode...
Basically mirror the current functionality of M3 to both M1 and M2, enabling input of values within the range of 13.75 to 25,087.71 Hz, using either the sliders or right-click typeins.

An additional consideration about switching the FM3 oscillator M1, M2 and M3 slider controls between Ratio and Absolute modes, is that the labels should contextually change as well to reflect their states, such that when any are in Ratio, the label will indicate M1, M2, M3 Ratio, and when in Absolute mode, the slider labels would indicate M1, M2, M2 Frequency.

@ghost ghost added the Feature Request New feature request label Jul 22, 2020
@baconpaul baconpaul added this to the 1.7.1 milestone Jul 22, 2020
@baconpaul baconpaul added the DSP Issues and feature requests related to sound generation in the synth label Jul 22, 2020
@baconpaul
Copy link
Collaborator

Agree with all points and can implement them, with one exception. The 2 decimals on FM2. The primary difference between FM2 and FM3 is that FM2 constrains the ratios to integers, so we can't easily use floats there. The rest of these things (except maybe the label switches but probably even those too) can make it into 1.7.1

@ghost
Copy link
Author

ghost commented Jul 22, 2020

It also occurs that it might be prudent to make the FM2 and FM3 oscillators 'Nyquist aware', such that if during performance any harmonic specified in the M settings exceeds Nyquist, it would be silenced.

Conversely, for subharmonics that might drop below 0 Hz during performance, also disable them during operation.

Another option might be to use modulus calculations to fold intervals that will exceed allowed ranges back into ones that are permitted.

Obviously, there is little that can be done for out-of-range generated FM sidebands, but where the above options might be available, it would offer some method for either disabling (if out of range), or otherwise logically folding their values back into allowed ranges during operation, for less aliasing artifacts.

@ghost
Copy link
Author

ghost commented Jul 22, 2020

Understood on FM2 floats, and intuiting that, I was careful to use "Optionally" in the suggestions above on that detail.

@mkruselj
Copy link
Collaborator

mkruselj commented Jul 22, 2020

But... FM oscillators don't work as an additive synthesizer, so you cannot disable harmonics just like that.

@ghost
Copy link
Author

ghost commented Jul 22, 2020

This was the way the old XA FM synths worked actually: any M that would exceed Nyquist, was silenced.

@mkruselj
Copy link
Collaborator

Ha but then you get a non-functional modulator operator. Dunno. Aliasing is sort of ingrained to FM (unless done in analog realm - which is super hard to do with precision!), it's what gives it its character, I'd say.

@ghost
Copy link
Author

ghost commented Jul 22, 2020

True, one must embrace the inherent realities of aliasing in FM synthesis, so, in agreement, where it occurs, it's just a natural artifact of the synthesis method; entirely expected and normal operation. Just mentioning the above, as food-for-DSP-thought.

@ghost ghost changed the title FM2 and FM3 Oscillators | Subharmonic and Harmonic Ratio Input | Post 1.7 FR FM2 and FM3 Oscillators | Subharmonic and Harmonic Ratio Input Jul 22, 2020
@baconpaul
Copy link
Collaborator

We run all the oscillators at 2x sample rate, also.

As to turnoff above nyquist: Seems like it could run you off a cliff when modulating accidentally also (remember inside the osc, surge can't tell the difference between a modulated value and a entered value).

@j5v
Copy link
Contributor

j5v commented Jul 29, 2020

True, one must embrace the inherent realities of aliasing in FM synthesis, so, in agreement, where it occurs, it's just a natural artifact of the synthesis method; entirely expected and normal operation. Just mentioning the above, as food-for-DSP-thought.

Yes, the characteristic of the resulting noise will depend on the synth sampling rate. Interpolations, multisampling, etc., will help by a small factor, but never really get around the way that sampling a wavetable at high frequency can skip its slopes. Making them Nyquist-aware will be tricky, as you would need to know the context of the whole FM chain to understand how FM3 ends up affecting the power spectrum output by FM1 [1]. I think it comes down to patch designers being aware of the high-frequency content, and throwing a LP filter on it as required, preferably before they say, "Ouch!".

[1] It's most likely to happen with 'true FM', with FM chains, or with simple FM pairs where the modulator ratio*amount is high and the Waves involved are less smooth.

@j5v
Copy link
Contributor

j5v commented Jul 29, 2020

allow input of a range of sub/harmonics from -32 to 32.

I think there's a decision to be made here, about display and input notation for subharmonics.

  1. Do we want:
  • -1 to -32 for exact subharmonics, and 0.01 to 0.99 (to whatever precision) for irrationals,
  • 1/r notation for exact subharmonics, ...
  1. Would we need some UI state to indicate whether the intent was a subharmonic or irrational?

  2. FM ratios are remarkably sensitive to being slightly off-ratio, and some users might want to exploit this by detuning by less than 0.01x. As a stretch goal, should we allow greater precision, or (at the risk of cluttering the interface) have a detune slider for each operator? Is the use case strong enough to warrant this (Yamaha thought so, with a Detune on each operator, units: 0.01 cents)?

@baconpaul
Copy link
Collaborator

Right now FM3 goes from 0 -> 32; where x in [epsilon,1) is the same as 1/x. My plan was to adjust the slider so it adjusts the float non-uniformly and let the typein let you say 1/16 or 1/16.002.

Much more to say here but that is one of the key things we can do without changing the synth at all.

FM2 is trickier.

@mkruselj mkruselj modified the milestones: 1.7.1, 1.7.2 Jul 30, 2020
@mkruselj
Copy link
Collaborator

mkruselj commented Aug 6, 2020

FM ratios are remarkably sensitive to being slightly off-ratio, and some users might want to exploit this by detuning by less than 0.01x. As a stretch goal, should we allow greater precision, or (at the risk of cluttering the interface) have a detune slider for each operator? Is the use case strong enough to warrant this (Yamaha thought so, with a Detune on each operator, units: 0.01 cents)?

This is already handled in Surge by having High-precision value readouts enabled in Menu->User settings.

@mkruselj
Copy link
Collaborator

@Jacky-Ligon This issue seems to be a sort of a duplicate of #2051, so I suppose just add Sine in title and we can close the older one?

@ghost
Copy link
Author

ghost commented Sep 13, 2020

@baconpaul

Just checking out FM3 in Surge-NIGHTLY-2020-09-12-aab5b49 | Windows 10 x64, VST3i

On first test here, ratios and float typeins seem to be working as intended for M1 and M2, and amazing new sounds are coming from FM3.

Forgive if I missed it in discussions, but M3 doesn't seem to yet have the extended functionality applied to this build.

And do seem to recall that absolute for all modulators will follow at some point.

But this is a really spectacular start. Thanks much for it all, and very excited for this new enhancement.

@baconpaul
Copy link
Collaborator

Yes just one step of many. But wanted to be sure step 1 was the right path!

@baconpaul baconpaul changed the title FM2 and FM3 Oscillators | Subharmonic and Harmonic Ratio Input FM3 Oscillators | Subharmonic and Harmonic Ratio Input Sep 24, 2020
@baconpaul
Copy link
Collaborator

Talking with Jacky: We decided to just apply these to FM3. Still work to do, but basically now ratio is extendable we just need to make each of the M sliders absolute/ratio swappable and preserve streaming.

@mkruselj
Copy link
Collaborator

Does it not make sense to have it on FM2 as well?

@baconpaul
Copy link
Collaborator

FM2 is harder for a couple of reasons, including those sliders all being ints.

baconpaul added a commit to baconpaul/surge that referenced this issue Nov 19, 2020
FM3 M1/M2 are specified as ratios and M3 is frequency based.
Add a mode where M1/M2 can swap to an absolute basis also,
and support the various typein and display variations in that
absolute case

Closes surge-synthesizer#2363
baconpaul added a commit to baconpaul/surge that referenced this issue Nov 19, 2020
FM3 M1/M2 are specified as ratios and M3 is frequency based.
Add a mode where M1/M2 can swap to an absolute basis also,
and support the various typein and display variations in that
absolute case

Closes surge-synthesizer#2363
baconpaul added a commit that referenced this issue Nov 19, 2020
FM3 M1/M2 are specified as ratios and M3 is frequency based.
Add a mode where M1/M2 can swap to an absolute basis also,
and support the various typein and display variations in that
absolute case

Closes #2363
@mkruselj mkruselj added this to the 1.8.0 milestone Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DSP Issues and feature requests related to sound generation in the synth Feature Request New feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants