# Mid-Side control and "Wider" SynthDefs

**URL:** <https://uzu.lurk.org/t/mid-side-control-and-wider-synthdefs/5113>\
**Category:** TidalCycles\
**Tags:** resources\
**Created:** [10 March 2024 16:01 UTC](https://uzu.lurk.org/t/mid-side-control-and-wider-synthdefs/5113 "2024-03-10T16:01:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geikha](https://uzu.lurk.org/user_avatar/uzu.lurk.org/geikha/32/2701_2.png) [@geikha](https://uzu.lurk.org/u/geikha)\
**Post date:** [10 March 2024 16:01 UTC](https://uzu.lurk.org/t/mid-side-control-and-wider-synthdefs/5113/1 "2024-03-10T16:01:18Z")

</div>

Just sharing some Synthdefs I've made and have been shared in the Discord, but not documented anywhere else. So I'm leaving them here for everyone to use:

* * *

## Side

Balances between the mid and the side of the stereo signal. Receives values from -1 to +1 (0 being unnafected signal, -1 mid and +1 side), but I like to set it on Tidal such that I use values from 0 to 1  
(0.5 being unnafected, 0 mid and 1 side).

```haskell
(
~dirt.addModule('side', { |dirtEvent|
	dirtEvent.sendSynth('side2')
}, { ~side.notNil });

SynthDef("side2", { |out, side = 0, sustain|
	var signal = In.ar(out, 2);
	var ms = Balance2.ar(signal[0] + signal[1], signal[0] - signal[1], side);
	signal = [ms[0] + ms[1], ms[0] - ms[1]] * sqrt ( (side.max(0)+1)/2 );
	ReplaceOut.ar(out, signal);
}).add;
);

```

```haskell
let side n = pF "side" $ ((n-0.5)*2)

```

* * *

## Wider

Widens any signal, even if mono. Replicates the behaviour of the original [Wider plugin](https://polyversemusic.com/products/wider/). It applies a bit of a comb filter to one side, and the inverse of the filter on the other side. So it accentuates the frequences it lowers from one side and vicecersa. This means the signal is still mono compatible.

```haskell
(
~dirt.addModule('wider', { |dirtEvent|
	dirtEvent.sendSynth('wider' ++ 2)
}, { ~wider.notNil });

SynthDef("wider" ++ 2, { |out, wider = 0, sustain|
	var signalL = In.ar(out, 1);
	var signalR = In.ar(out+1, 1);
	var maxdt = 1/44100*32; var mindt = 1/44100*24;
	var dt = wider * (mindt-maxdt) + maxdt;
	var left = (signalL + DelayL.ar(signalL,dt,dt,wider));
	var right = (signalR - DelayL.ar(signalR,dt,dt,wider));
	ReplaceOut.ar(out, [left,right]);
}).add;
);

```

```haskell
let wider = pF "wider"

```
