surge-synthesizer / surge

Synthesizer plug-in (previously released as Vember Audio Surge)
https://surge-synthesizer.github.io/
GNU General Public License v3.0
3.09k stars 395 forks source link

Oscillator Phase control #867

Open Kwurqx opened 5 years ago

Kwurqx commented 5 years ago

This is a feature request.

Control over the Phase of the Oscillator.

Since almost all Surge parameters are also modulation targets.....it's 2 request in one.

  1. Static / Initial Oscillator Phase angle (0 - 360 degrees). Obviously only relevant when the oscillators involved are phase synced/locked.

  2. Oscillator Phase as a modulation target. Both when freerunning and/or phase locked oscillators.

Additional info

Oscillator Phase control is very usefull when mixing 2 (or more) oscillators. By changing the relative Phase angle, many additional spectra can be achieved. Either as a Comb filter effect (when mixing richer spectra) or as as precision shaping tool (when mixing in just 1 or a few partials, or partials in specific places/bands).

Phasing effects are very evident when detuning oscillators/signals. A common technique in synthesizer programming.

Actually, modulating phase with a saw tooth LFO would sort of emulate detuning (since the actual phase shift would travel only one way).

Obviously also in FX like Chorus and Phaser (where both rely on phase shifting/cancellation).

Examples:

When when mixing a Sine (e.g. at -1, same or +1 oct) into a Saw, you can use the relative Saw/Sine amplitudes and the relative phase to shape the lower frequencies.

When mixing 2 richer oscillators like Saw and/or Pulse you can use the relative phase to create new static spectra. Or modulate phase to get Comb filter effects (on similar/richer spectra) or achive phase cancelling effetcs at specific frequencies/bands (using other specific spectra ranging from a single sine to more complex spectra).

When mixing a Saw and Inverted Saw, you can set/modulate phase to create PWM.

Alternative

Well, a very short detune (using an appropriate modulation source) will change the (relative) phase. But this approach lacks the desired amount of precision and control.

baconpaul commented 5 years ago

Thank you; we also had a request for exact frequency (vs note) detune. Seems these phase concepts are getting interest as people use the synth. We are trying to wrap up 1.6.0 and do a couple of things in another setting (are you a VCV Rack user?) but this is a good idea we can add to the list for (probably) the summer or early fall (unless you are a programmer!). Appreciate the clarity of description.

naquela commented 5 years ago

+1 Control over the Phase of the Oscillator its very very very usefull thanks

SallyVate commented 5 years ago

+1 it's very useful and simple to code it

baconpaul commented 5 years ago

Awesome! The oscillator code is a little hairy because of the SSE stuff but would be thrilled to review a pull request that added this! We are out of space in the UI to put a slider I think but I may be wrong.

naquela commented 5 years ago

Out of space i sugest small buton and open a small window with the controls. Tanks baconpaul

theofficialajyoung commented 5 years ago

This is a bit of an older feature request, but I thought I'd chime in and suggest a possible GUI solution, since fitting an Oscillator Phase control was an issue.

I notice there's a rather empty space here:

Surge Phase

When set to "Retrigger", perhaps a phase % could appear?

As an example, check out how VPS Avenger does phase:

Avenger Phase

Pros:

Cons:

baconpaul commented 5 years ago

Thanks for that!

I’ve decided that once we ship 1.6.2 (within the next week to two) I’m gonna attack the ui inflexibility and parameter expansion problem head on. That’s all over I. Issue #1117 - and if I can make that work then issues like this get u locked easily and properly. Definitely not ignoring all these great feature requests but the base code of the synth is a bit inflexible in a couple of key areas so want to fix that problem first.

If I do that I will just be able to add a proper ui element and grow the ui for this and other features!

weltering commented 4 years ago

+1. This is really important for psytrance and reese bass :)

Oortseam commented 3 years ago

+1 It would be a very useful feature!

Moreover I'd like to see one more OSC unison mode: with not detune but static phase shift among voices controlled. Would be so useful with 2 voice unison and 'wide' filter setup for making nice phase stereo (musthave feature for FM modulated and modulating OSC's, as to me).

mkruselj commented 3 years ago

We already have point 2 from the opening post (modulating osc phase), which is inter-osc FM, really. This will improve once we have a full FM matrix in Surge XT.

So, basically, knowing that reduces this FR to just point 1, which is static phase adjustment for oscillators (obviously only makes sense when Retrigger button is enabled).

jopoet commented 3 years ago

+1 We really need it!

ershov commented 5 months ago

Hey I'd like to add by 5 cents: I also was looking for this feature - I need it to create a stereo effect. This can be achieved indirectly with just one waveshape: classic sawtooth/square by setting "sub mix" to 100%, then "width 1" will rotate the phase. But it'd be cool to be able to control it for any waveshape.

Yes, I understand the problem of the number of controls blowing up. There's already a huge number of parameters. This one could quite organically be fitted next to the "pitch" slider under the wave form view.

An alternative solution could be: if I had the existing waveforms as a Lua source, there could be a "Formula" waveshape added similarly to the LFO one and anyone could program any number of sliders and code any desirable waveshape.

blancoberg commented 1 month ago

+1 on being able to modulate the phase offset on each oscillator.

Is the lack of UI space the main reason this hasn't been implemented?

mkruselj commented 1 month ago

Note that this won't be a continuous modulation, it would be snapped at note on. We already have continuous phase modulation with inter-oscillator FM (basically).

But yes, this will happen in Surge XT 2. Eventually. We don't want to spite nor cramp the current UI.

Andreya-Autumn commented 1 month ago

That's TBD IMO. Modulation of phase at non-audio rates can be useful for many things, which would be annoying/difficult to set up using the FM stuff. But agreed, not before XT2.

blancoberg commented 1 month ago

Isn't it a bit redundant to first add an initial phase and then later introduce a phase offset? When the phase offset is finally added in xt2, the initial phase parameter would become kind of useless, as the phase offset would handle both things.

I don't know if this is out of the question, but wouldn't it be possible to add a phase offset without including it in the UI at first? It could be accessible only in the mod matrix, allowing users to take advantage of this feature. Then, later on, when there is space for it in the GUI, it can be added there as well.

Andreya-Autumn commented 1 month ago

Yeah we certainly wouldn't do both! Indeed a (continuous) phase control acts as a startphase control until you modulate it. Only nuance is if you wanna modulate start phase, you need to use a modulator that snaps at note-on and holds still after.

Adding the param as a mod target only in the meantime is a clever idea! I wouldn't be opposed to it. Unfortunately, while adding a startphase control is fairly trivial DSP-wise (as noted in #7220), adding a continuous one is harder. Each oscillator DSP being different etc etc... Not "impossible" but "definitely a bit of work". And most of us are busy in Shortcircuit-land for the next while.

So, anyone saying "hey I wanna do this" is very welcome to! Otherwise the plan remains "revisit this properly for XT2".

mkruselj commented 1 month ago

The way it is set up in Surge right now you must have a parameter and a UI widget (=slider) for it in order to be able to modulate. So even setting a modulation-only thing is not straightforward, it would make the code even more dirty with a ton of special cases etc.