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

M/S transform effect in FX or scene output section #3596

Closed
Oortseam opened this issue Jan 8, 2021 · 9 comments
Closed

M/S transform effect in FX or scene output section #3596

Oortseam opened this issue Jan 8, 2021 · 9 comments
Labels
DSP Issues and feature requests related to sound generation in the synth Effects Feature Request New feature request
Milestone

Comments

@Oortseam
Copy link

Oortseam commented Jan 8, 2021

Hi!

I'm speaking of a channel transformer performing the next algorithm: Lnew=M=0.5*(L+R); Rnew=S=0.5*(L-R)

It could be very useful in many situations. For example, it allows to build complicated unison-based pads with clear and straight control over mono and stereo part (to prevent undesired phase effects at low end and to have nice mono compatibility).

Now I'm using external plugin for this and it does the work nice. But it would also be useful if I had a possibility to store this as a part of preset (as I have many ones that I could share with others but now they need to be additionally processed with external plugin to sound right)

As I think, it wouldn't be a hard task. Just one more effect in FX group or RMB-menu controlled option for Pan or Width slider in Scene output section.

@mkruselj mkruselj added Effects Feature Request New feature request labels Jan 8, 2021
@mkruselj
Copy link
Collaborator

mkruselj commented Jan 8, 2021

So, basically a mid-side encoder. But then you also need a decoder to get the proper stereo signal back. So this definitely requires more FX slots as a prerequisite (#2446).

@baconpaul
Copy link
Collaborator

We have a m/s encoder decoder which are SSE coded already in the code base, so while I agree with @mkruselj that this would require slot expansion to be practical, it is a trivial matter to code.

The M/S encode is what is used in the 'width' parameter in many of the effects.

From the flanger code for instance:

  float M alignas(16)[BLOCK_SIZE],
         S alignas(16)[BLOCK_SIZE];
   encodeMS(dataL, dataR, M, S, BLOCK_SIZE_QUAD);
   width.multiply_block(S, BLOCK_SIZE_QUAD);
   decodeMS(M, S, dataL, dataR, BLOCK_SIZE_QUAD);

So really the thing you are after is an FX with two params

1: 'encode/decode' toggle
2: 'mix' (which is output = origin + encoded) default to 100% range -100 to 100.

Seems to me.

@mkruselj
Copy link
Collaborator

mkruselj commented Jan 9, 2021

Or, maybe a better way would be to add M/S processing option to each effect for which this makes sense, when right-clicking the Output/Mix slider (depending on the effect), where we would select standard processing, process sides only, process mid only?

@Oortseam
Copy link
Author

Oortseam commented Jan 9, 2021

@mkruselj Yes! To have hands completely free you should have M/S encoder also with a possibility to place it where you like in the circuit.
BUT even the decoder only (that can be simply placed in the existing FX slot) may also be a great help.

As an example, here is a setup for FM stereo house bass I use now with SURGE. It looks like this:

[OSC2 (FM2 mode)]->(fm modulation)->[OSC1 (SIN mode)]
where OSC1 has 2 voice unison.

Yes, it gives me a stereo. But it's unusable in fact (listen to MS_UNPROCESSED file)
MS_UNPROCESSED.zip
It has the extra wide and uncontrollable low end which gets unstable in loudness and character if you try to make it more narrow with some post processing.

What helps is to process the right channel with HPF filter and to attenuate it a bit. Then I use external M/S decoder which transforms L channel into M part (with nice solid low end) and R channel into S part. which gives needed stereo feel at mids and highs. Now it sounds like this (listen to MS_PROCESSED file):
MS_PROCESSED.zip

PS: If every stereo FX (including two main filters, HPF and a shaper) had the next structure: [M/S encoder (on/off)] ->[L/R balance (-50...50)]->[main effect processing]->[M/S decoder (on/off)], then ALL possible situations could be managed (all these tunings could be placed to FX RMB-menu maybe)

It could be extra-universal tool but I guess it to be much more complicated task then adding one simple FX for slot placing.

@magnetophon
Copy link
Contributor

magnetophon commented Jan 13, 2021

PS: If every stereo FX (including two main filters, HPF and a shaper) had the next structure: [M/S encoder (on/off)] ->[L/R balance (-50...50)]->[main effect processing]->[M/S decoder (on/off)], then ALL possible situations could be managed (all these tunings could be placed to FX RMB-menu maybe)

I came here to request exactly this.
To be clear: when you say L/R balance, you mean L/R or M/S, correct?

An added cherry on top would be a HP in the S channel, that can be toggled on and off, like in the noise-SH osc.

Just the decoder as a regular FX would also be awesome already: a big part of the usefulness for little effort, I think.

@Oortseam
Copy link
Author

@magnetophon L&R after M/S encoder is M&S in fact. You're right!

@mkruselj mkruselj added this to the 1.9.0 milestone Jan 18, 2021
@mkruselj mkruselj modified the milestones: 1.8.2, Surge XT Feb 4, 2021
@mkruselj
Copy link
Collaborator

I think we should just implement mdaStereo here. :)

@mkruselj mkruselj added the DSP Issues and feature requests related to sound generation in the synth label Sep 21, 2021
@ghost ghost mentioned this issue Sep 30, 2021
baconpaul pushed a commit that referenced this issue Sep 30, 2021
This attempts to solve issue #3596 and expands the idea a little.
- It has switchable I/O (LR->MS->LR, LR->MS, MS->LR)
- HP, LP and a semi parametric band per M and S channel
  (each activatable)
- separate gain for M/S
- L/R balance

possible use cases:
- sandwich fx between en- and decoder
- decode sources defined as m/s (2 oscillators or scenes)
  (incl. the option to mono low frequencies that was requested in the issue)
- eq/filter mid and side channels of l/r-stereo content
- etc.

It is currently in  a state where I'd like to hear opinions
and ask for a review

Adresses #3596
@baconpaul
Copy link
Collaborator

Hi!

Thanks to @mynameismuhl we will have these encoders and decoders in our next release so let me close this issue.

@magnetophon
Copy link
Contributor

Great!
Thanks @mynameismuhl!

baconpaul pushed a commit that referenced this issue Oct 2, 2021
- A deactivatable Highpass Filter for the Side Channel in Conditioner
  (named "Side Low Cut" for consistency)
  to roll off low frequencies in the stereo width.
- set threshold to-6dB in init preset to avoid level jump

This was a test in preparation for the ms tool.
I thought I'd ask before I throw it away...
It is patch compatible with 1.9
(but not compatible with old user-fx-presets)

Adresses #3596
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 Effects Feature Request New feature request
Projects
None yet
Development

No branches or pull requests

4 participants