Jump to content


Photo

Native Mid / Side Processing


  • Please log in to reply
23 replies to this topic

#1 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5543 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 28 July 2009 - 20:06

[Edited after some much needed sleep and clearer thinking]: Just skip down to this later post for a much simpler and less confusing example...

------

Earlier thread for reference: http://www.renoise.c...showtopic=21422

I've managed to get some basic mid/side processing working natively in Renoise, without the use of additional plugins like Voxengo MSED. I understood the basics of how it worked, and I've always suspected that it was possible to do within Renoise, but I've never bothered to actually sit down and figure it out until today. It was quite a fun little exercise :)

By running the audio through Renoise's stereo expander, and then through a series of send tracks that invert and mix everything back together in the correct way (essentially nulling/xor'ing certain parts), it's possible to isolate the mid (mono) and side (stereo) elements and process them separately.

Here's a quick example:
http://illformed.org...8-mid-side.xrns

Try muting/unmuting the "mid" and "side" tracks to hear the effect.

I've used a few more send tracks than is really necessary, but I like to set it up so there's one dedicated input/receiver track that's easy to route multiple things to, and also so the individual mid/send tracks are not cluttered with anything unnecessary.

Anyway... just thought I'd share :)

Let's face it, in real life you can save yourself a whole lot of time by simply using a VST for this, but I always find it interesting to see what kinda nifty stuff we can get natively. Renoise is fun!

.

Edited by dblue, 29 July 2009 - 15:51.


#2 Tarek-FM

Tarek-FM

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 539 posts
  • Gender:Male
  • Location:Madrid

Posted 28 July 2009 - 23:05

Brilliant!! To be honest there are so many sends that I am a bit confused but I have the xrns anyhow!!
I am all about trying to learn how to do things natively, you save cpu that way!!
Cutting Edge Drum and Bass.....check out my new 175bpm beast: Angelitronhttp://soundcloud.com/tarek-fm/angelitron


(Not so)NEW!! Driving, heavy and cinematic metal: Soundcloud Metal Page

#3 mr_mark_dollin

mr_mark_dollin

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2823 posts
  • Gender:Male
  • Location:In the Pattern Matrix.
  • Interests:Quiet Revolutions.

Posted 29 July 2009 - 00:28

Very clever! It's certainly a bit beyond me as to how this is done, and certainly academic compared to just using a simple VST setup to work on the same aspect. But there you go: you put your head to it in Renoise you can come up with just about anything.
Posted Image

#4 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5543 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 29 July 2009 - 02:05

As I'm sure many people have already noticed in the past, if we take an audio signal and combine it with a completely inverted version of itself, the two signals cancel each other out perfectly to create total silence. In other words: 1 + -1 = 0 (Makes total sense, but I was quite surprised the first time I actually tried it in a sample editor!)

You can test this very easily in Renoise by taking a sample and playing two identical notes on two separate tracks, but on the 2nd track you add a Gainer device and invert both the left and right channels.

If we now apply some kind of effect to one of the tracks, we get an interesting result that is the difference between the original signal and the effected version, but in a way that you might not expect at first. For example, if we add a lowpass filter to the 1st track, and leave the 2nd track in its original (but inverted) state, these two signals will now actually combine and create the opposite of a lowpass... a highpass! (Albeit a somewhat crude sounding highpass)

In Renoise, when using the Stereo Expander device, if we set the Expand parameter to "Mono", Surround to "0%", and Mono Mix to "[L + R]", this will actually give us the mid/mono portion from the signal. I thought that fully expanded might also give us the side/stereo portion on its own (which would make this a whole lot easier), but this does not seem to be the case.

Anyway, so, my basic idea was that: signal - mid = side

I tidied up my original example a bit now, since I realised I could do some things slightly differently. It's still kinda weird, but hopefully it's a *little* bit clearer now, haha. In any case, the process of combining these elements and subtracting the bits we need is quite trivial in theory, it just requires some interesting send track and gainer device mathematics :)

http://illformed.org...8-mid-side.xrns


[Edit]

Here's another quick example using a clip from the song "Young Folks" by Peter Bjorn and John. The mid/side isolation technique works particularly well on this song, creating a rather nice vocal extraction effect when you mute the mid portion and leave only the side.

http://illformed.org...mid-side-2.xrns

Disclaimer: the "Young Folks" sample is obviously copyrighted and is just used here for demonstration purposes. Please be sensible.

Edited by dblue, 29 July 2009 - 04:10.


#5 kazakore

kazakore

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6140 posts
  • Gender:Male

Posted 29 July 2009 - 11:32

Well you seem to have the right idea dBlue but your example seemed a little confusing to me so I set about doing one myself. Firstly I'll run through the mathematics of mid/side processing as I learn it years ago.

Starting with a basic stereo signal you have Left and Right (L & R.) Getting your Mid and Side (also known as Sum and Difference) signal from this is easy (especially as you pointed out you can invert channels with the Gainer.)

Mid = Left + Right
Side = Left - Right (Well side is really the difference and you could use Right - Left, you would just have to make sure to invert the correct one when recombining.)

As all Renoise tracks are stereo there is no need to invert all and combine in other Send tracks. Mid is a basic Mono conversion, as you did with the Stereo Expander. Now for the Side you want a Gainer to invert the Right channel then again convert to Mono. This should give you two dual-mono channels, which allows you to easily monitor either the sum or the difference signals.

Now combinations back into stereo is a little (but not much) more complicated.

Left = Mid + Side = (L+R) + (L-R) = 2L
Right = Mid - Side = (L+R) - (L-R) = 2R

As you can see the recombinations actually gives you double the signal so I have set the outputs of the left and right channels at -6dB.

The recombinations itself is basically the same though. Mid and Side and both sent to the Left channel (Send Track) which is panned left (and the minus 6dB mentioned earlier.) Then the Side track is sent to one called Inv which inverts both left and right (as it's dual mono) before being sent onto the Right channel. This could easily be put in the end of the chain of the Side track but wanted to leave the option to monitor the Side channel on its own it it's original state (although inverted signals are usually considered audibly indistinguishable from each other.)


WOW! I seem to have lost myself in writing that even more than I did quickly looking at your own example. Anyway here is what I did and it should be quite similar to yours. Hope it makes sense and maybe hopes people understand and simplify things :)
  • lhaastdaiz likes this

#6 kazakore

kazakore

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6140 posts
  • Gender:Male

Posted 29 July 2009 - 11:49

Sorry forgot to add the link to the .xrns.


http://www.sendspace.com/file/6uosoh

#7 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5543 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 29 July 2009 - 13:03

Hope it makes sense and maybe hopes people understand and simplify things :)

Kickass! I do tend to go overboard with the send tracks sometimes, haha, but I guess each person has their own weird style. Your example is definitely easier to follow and understand than my mess :D

Edited by dblue, 29 July 2009 - 13:14.


#8 danoise

danoise

    Probably More God or Borg Than Human Member

  • Renoise Team
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6006 posts
  • Gender:Male
  • Interests:wildlife + urban trekking

Posted 29 July 2009 - 14:09

Yay for workarounds!!!

When I get back home, I'll try feeding Jimi Hendrix through this -
It might prove to be even more psychedelic sounding than the original :)

Tracking with Stuff. API wishlist | Soundcloud


#9 kazakore

kazakore

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6140 posts
  • Gender:Male

Posted 29 July 2009 - 14:48

Kickass! I do tend to go overboard with the send tracks sometimes, haha, but I guess each person has their own weird style. Your example is definitely easier to follow and understand than my mess :D


Yeah but if it wasn't for you pointing out that the Gainer has Invert I wouldn't of even realised it was possible.


Am I right in thinking in your example it remains in M/S rather than going back to L/R for normal playback? I didn't study it as closely as I should of, got lost and tried my own to make cleared sense of it ;)

#10 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5543 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 29 July 2009 - 15:48

Am I right in thinking in your example it remains in M/S rather than going back to L/R for normal playback?

Yeah, I just isolated things in a slightly different (and unnecessarily complex) way, but it still combines to give the correct result in the end.

I loaded Renoise again now after having some sleep and clearing my head. Here is another version which is *much* simpler, requiring only 1 send track to do the processing, 1 send track to receive the mid data, and 1 send track for side data.

http://illformed.org...mid-side-3.xrns

*whew* :)

You could of course separate things further into left and right side data, if you wanted to apply totally different effects to each one for some reason. That's not really what I had in mind, so I didn't bother.

.

Edited by dblue, 29 July 2009 - 15:57.


#11 Beatslaughter

Beatslaughter

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2276 posts
  • Gender:Male
  • Location:Berlin, Germany
  • Interests:Music, Blu-ray, PC Games

Posted 29 July 2009 - 16:02

http://illformed.org...mid-side-3.xrns


Nifty little example... write a small explanation into the song comments box and i'd vote this to be included into Renoise as tutorial song. :)

#12 kazakore

kazakore

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6140 posts
  • Gender:Male

Posted 29 July 2009 - 16:28

Something's not quite sitting right with me and how you get your Side signal and as far as I can see you are never converting back into L/R stereo for normal playback, just mixing the M/S signals together.

EDIT2: Just rendered the Side signal only and it is out of phase. Mid and Side should each be Mono (single channel) signals so this obviously isn't correct.

Edited by kazakore, 29 July 2009 - 16:35.


#13 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5543 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 29 July 2009 - 17:19

Something's not quite sitting right with me and how you get your Side signal and as far as I can see you are never converting back into L/R stereo for normal playback, just mixing the M/S signals together.

EDIT2: Just rendered the Side signal only and it is out of phase. Mid and Side should each be Mono (single channel) signals so this obviously isn't correct.


The way I obtain the side signal: First I run the original signal through the stereo expander set to mono, which gives us the mid signal. I take that mid signal and invert it, and then mix it back with the original signal, causing the mono information to cancel itself out to silence. As far as I understand it, the remaining data leftover from this process - the mathematical difference between the original signal and the mid signal - is the side signal?

It's very possible that I've missed something, but to confirm that I was getting the correct output, I was simply comparing my results in Renoise to those created by Voxengo's MSED plugin when used in the default "inline" mode. Using the inverted phase cancellation technique, my output from Renoise mixed with the inverted output of MSED results in silence, which tells me that they are both producing identical results. I tested this overall, as well as for the individual mid and side signals.

Regarding your comment about converting back to L/R for normal playback, I am probably missing something here as well, but I don't see why it's necessary in this case? The output of the process already recombines to create a result that is identical to the original, untouched signal.

[Edit]
Additional L/R processing is probably required in order to maintain correct phase, if you were to apply any kind of effects to one of the signals... is that it?

Edited by dblue, 29 July 2009 - 17:37.


#14 kazakore

kazakore

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6140 posts
  • Gender:Male

Posted 29 July 2009 - 17:36

I showed you the matematics above of how to get from stereo to mid/side and back again. Mixing mid/side signal together does not give you stereo. The reason it appears to in your example is because you side signal is out of phase on each channel. Remember Mid/Side should only be two channels and you have three (although one is simply anti-phase) ignoring the fact we technically always have to work with four.

You Mid is a basic mono, which is correct, although you would usually use one channel rather than dual-mono but that's all Renoise will work with.


You Side has the correct signal on one side and the inverted signal on the other. This is going to give you serious phase cancellations when listening to it through your monitors! Although the result of this is that when mixed back with the Mid signal you have Mid+Side for Left and Mid-Side for Right and do get stereo back again with no extra workings (which has also shown me how much easier it is to get back to Stereo than how I did it in my example as it's unlikely many people are going to want to effect left and Right separately.)

Although, at the end of the day most effects work same on positive and negative half-cycles and if you never monitor your Side on it's own to see how much difference your effects are making on that part of the signal you will probably never notice. Personally I know I would want to listen to the changed I am making to my Mid and Side signals in isolation so would want to avoid anti-phase signals being routable to output.

Edited by kazakore, 29 July 2009 - 17:41.


#15 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5543 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 29 July 2009 - 17:43

I showed you the matematics above of how to get from stereo to mid/side and back again. Mixing mid/side signal together does not give you stereo.

Gotcha. I did notice earlier that the "side" I was getting was out of phase, and that this did not really fit in with the correct methods you mentioned, but it seemed like this method in Renoise was a happy little quirk we could take advantage of :)

Definitely very important to look after those monitors though! I had overlooked that vital concept with the phase. I have not worked with monitors for several years now, I just have some awful desktop speakers that make it impossible to truly know what the hell is going on... gah! I obviously heard the weirdness of the phase being wrong, but it did not jump out at me as being REAAAAALLY wrong... and since my right speaker is kinda crappy anyway... well, you get the idea. It simply didn't occur to me at the time, especially since the end result was OK.

Anyway.. good stuff. I love these threads, haha.

I definitely want to see what other kind of weird tricks are possible :)

Edited by dblue, 29 July 2009 - 18:00.


#16 kazakore

kazakore

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6140 posts
  • Gender:Male

Posted 29 July 2009 - 18:50

Yeah definitely interesting stuff! Glad you get what I'm saying and must admit it took me a while to work out why yours was working (which it obviously was) until I broke it down mentally. Listening on headphones at work myself and don't have a great set-up at home for critical listening but always try and be aware of things like phase issues and CD offset.

Tried to have a think of how to neaten my example up and remove the dedicated L&R Sends and although it could be done easy enough it would force you to use another Gainer device which you would have to turn on and off depending on if listening to the stereo mixdown or just to the Side signal. This I consider messier (or more prone to user-error at least) than using a couple of extra Sends and maybe some people would like to effect each channel separately... Can easily move the Inv Send to the end of the Side one though.

Shame this thread has shown me that Sends can only be routed to others further down the chain, had been tempted to play about with some strange feedback things at times but now I know it's not actually possible. Maybe I'll start playing about with Synth Edit or the like and see what sort of thing I come up with... But I never get around to making enough music as it is!

Edited by kazakore, 29 July 2009 - 18:51.


#17 vV

vV

    God's or Borg's Chief and Ruler of All Species

  • Moderator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 16855 posts
  • Gender:Male
  • Location:Netherlands

Posted 29 July 2009 - 19:56

As I'm sure many people have already noticed in the past, if we take an audio signal and combine it with a completely inverted version of itself, the two signals cancel each other out perfectly to create total silence. In other words: 1 + -1 = 0 (Makes total sense, but I was quite surprised the first time I actually tried it in a sample editor!)

Actually in computer terms, inverted is doing nothing more than making 1 bits 0 and 0 bits 1.
And if you do 1 AND 0, the result is always 0 ;) (because both samples disolve in eachother that way)
Vv....


cpu Intel Core i7-4820K @3.70GHz
chipset Intel X79 chipset
mem 32 Gb 2400Mhz
os Win 7 64-bit SP1, DirectX 11
audio ESI ESP1010e - > Driver rev:2.0.6.0
video nVidia Geforce GTX780 - > Driver rev:335.23


Renoise Official Manual

#18 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5543 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 29 July 2009 - 21:05

;)


Posted Image

That's all I was trying to say, Mr. Smartypants :P

Edited by dblue, 29 July 2009 - 21:15.


#19 kazakore

kazakore

    Probably More God or Borg Than Human Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 6140 posts
  • Gender:Male

Posted 29 July 2009 - 21:46

Actually in computer terms, inverted is doing nothing more than making 1 bits 0 and 0 bits 1.


And this is all you have to do to invert an audio signal in the digital realm due to the way it is represented (well the way most formats work, don't rely on Wikipedia to tell you how PCM works.) Centre of the waveform is 0000 (assuming four bits), maximum positive peak is 0111 and lowest negative peak is 1000. Does mean waveforms are offset to the negative by a single bit but allows you to use simple addition of values and have it behave like a real waveform, with two negative values giving a greater negative value (although you have to remember to drop the produced MSB) and so on and simple inversion, Was almost tempted to draw a little Paint diagram but too lazy and you probably all know this anyway.


And if you do 1 AND 0, the result is always 0 ;) (because both samples disolve in eachother that way)


Not sure what you are talking about here. Sounds like you are referring to binary logic but as nobody else had done I wasn't quite sure...

#20 Tarek-FM

Tarek-FM

    Big Masta Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPip
  • 539 posts
  • Gender:Male
  • Location:Madrid

Posted 29 July 2009 - 22:41

Whoa, this is amazing! I ask one question and a huge thread has emerged from it! Thank you dblue for being inspired to figure out a method....this is one of the reasons why I love Renoise, it has a great community behind it!:)
Cutting Edge Drum and Bass.....check out my new 175bpm beast: Angelitronhttp://soundcloud.com/tarek-fm/angelitron


(Not so)NEW!! Driving, heavy and cinematic metal: Soundcloud Metal Page

#21 Johann

Johann

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 2774 posts
  • Gender:Not Telling

Posted 29 July 2009 - 22:46

Just to make sure I understood correctly: If I get one apple, and then eat it, I actually have no apple?

music / photos / renoise scripts


hay guises! action/reaction. I'm not into leaving or avoiding places, I ban 'em by making sure I get banned.. loadsa noise, little signal.. basically anything else makes more sense to spend energy on. thanks for the app, but from here on out we simply don't have any use for each other period. oh, and of course big shoutouts to bit-arts and kaneel and anyone else I forgot :D :D

#22 vV

vV

    God's or Borg's Chief and Ruler of All Species

  • Moderator
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 16855 posts
  • Gender:Male
  • Location:Netherlands

Posted 29 July 2009 - 22:47

Posted Image

That's all I was trying to say, Mr. Smartypants :P

It is the same logic for Dumbpants :P
Was that why you needed two emails to answer mine? (no pun intended)
Vv....


cpu Intel Core i7-4820K @3.70GHz
chipset Intel X79 chipset
mem 32 Gb 2400Mhz
os Win 7 64-bit SP1, DirectX 11
audio ESI ESP1010e - > Driver rev:2.0.6.0
video nVidia Geforce GTX780 - > Driver rev:335.23


Renoise Official Manual

#23 dblue

dblue

    Dodgy Geezer

  • Admins
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 5543 posts
  • Gender:Male
  • Location:Berlin
  • Interests:Code. Music. Graphics.

Posted 29 July 2009 - 22:57

Just to make sure I understood correctly: If I get one apple, and then eat it, I actually have no apple?

You won't not have no apple.

Thank you dblue for being inspired to figure out a method....

Well, huge thanks to kazakore for pointing out that, while this method does "work", it is probably not the best way to approach it... and you also risk ruining the phase of your signal if you're not careful! So, use with caution :)

this is one of the reasons why I love Renoise, it has a great community behind it!:)

Definitely!

RENOISE!
:w00t: :yeah: :panic: :guitar: :drummer: :dribble: :walkman: B)

Edited by dblue, 29 July 2009 - 22:59.


#24 00.1

00.1

    Guruh Motha Fakka is Levitating and Knows Everything About Renoise Member

  • Normal Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1343 posts
  • Gender:Male

Posted 05 August 2009 - 06:36

Actually in computer terms, inverted is doing nothing more than making 1 bits 0 and 0 bits 1.
And if you do 1 AND 0, the result is always 0 ;) (because both samples disolve in eachother that way)

Like Agent Smith and Mr. Anderson/Neo.

edit: Peter Bjorn And John - "Young Folks" catchy tune, thanks.

Edited by 00.1, 05 August 2009 - 06:47.

Windows 10
Toshiba Satellite L875D
AMD A8-4500M APU with Radon™ HD Graphics 1.90 Ghz
6.00 GB RAM
64bit Operating System, x64-based processor