<commit_before>define(["Tone/core/Tone", "Tone/effect/StereoEffect"], function(Tone){

	"use strict";

	/**
	 *  @class Mid/Side processing separates the the 'mid' signal 
	 *         (which comes out of both the left and the right channel) 
	 *         and the 'side' (which only comes out of the the side channels) 
	 *         and effects them separately before being recombined. <br>
	 *         Applies a Mid/Side seperation and recombination. <br>
	 *         http://musicdsp.org/showArchiveComment.php?ArchiveID=173<br>
	 *         http://www.kvraudio.com/forum/viewtopic.php?t=212587<br>
	 *         M = (L+R)/sqrt(2);   // obtain mid-signal from left and right<br>
	 *         S = (L-R)/sqrt(2);   // obtain side-signal from left and righ<br>
	 *         // amplify mid and side signal seperately:<br>
	 *         M/S send/return<br>
	 *         L = (M+S)/sqrt(2);   // obtain left signal from mid and side<br>
	 *         R = (M-S)/sqrt(2);   // obtain right signal from mid and side<br>
	 *
	 *  @extends {Tone.StereoEffect}
	 *  @constructor
	 */
	Tone.MidSideEffect = function(){
		Tone.StereoEffect.call(this);

		/**
		 *  a constant signal equal to 1 / sqrt(2)
		 *  @type {Tone.Signal}
		 *  @private
		 */
		this._sqrtTwo = new Tone.Signal(1 / Math.sqrt(2));

		/**
		 *  the mid send.
		 *  connect to mid processing
		 *  @type {Tone.Expr}
		 */
		this.midSend = new Tone.Expr("($0 + $1) * $2");

		/**
		 *  the side send.
		 *  connect to side processing
		 *  @type {Tone.Expr}
		 */
		this.sideSend = new Tone.Expr("($0 - $1) * $2");

		/**
		 *  recombine the mid/side into Left
		 *  @type {Tone.Expr}
		 *  @private
		 */
		this._left = new Tone.Expr("($0 + $1) * $2");

		/**
		 *  recombine the mid/side into Right
		 *  @type {Tone.Expr}
		 *  @private
		 */
		this._right = new Tone.Expr("($0 - $1) * $2");

		/**
		 *  the mid return connection
		 *  @type {GainNode}
		 */
		this.midReturn = this.context.createGain();

		/**
		 *  the side return connection
		 *  @type {GainNode}
		 */
		this.sideReturn = this.context.createGain();

		//connections
		this.effectSendL.connect(this.midSend, 0, 0);
		this.effectSendR.connect(this.midSend, 0, 1);
		this.effectSendL.connect(this.sideSend, 0, 0);
		this.effectSendR.connect(this.sideSend, 0, 1);
		this._left.connect(this.effectReturnL);
		this._right.connect(this.effectReturnR);
		this.midReturn.connect(this._left, 0, 0);
		this.sideReturn.connect(this._left, 0, 1);
		this.midReturn.connect(this._right, 0, 0);
		this.sideReturn.connect(this._right, 0, 1);
		this._sqrtTwo.connect(this.midSend, 0, 2);
		this._sqrtTwo.connect(this.sideSend, 0, 2);
		this._sqrtTwo.connect(this._left, 0, 2);
		this._sqrtTwo.connect(this._right, 0, 2);
	};

	Tone.extend(Tone.MidSideEffect, Tone.StereoEffect);

	/**
	 *  clean up
	 *  @returns {Tone.MidSideEffect} `this`
	 */
	Tone.MidSideEffect.prototype.dispose = function(){
		Tone.StereoEffect.prototype.dispose.call(this);
		this._sqrtTwo.dispose();
		this._sqrtTwo = null;
		this.midSend.dispose();
		this.midSend = null;
		this.sideSend.dispose();
		this.sideSend = null;
		this._left.dispose();
		this._left = null;
		this._right.dispose();
		this._right = null;
		this.midReturn.disconnect();
		this.midReturn = null;
		this.sideReturn.disconnect();
		this.sideReturn = null;
		return this;
	};

	return Tone.MidSideEffect;
});<commit_msg>defined MidSideEffect in terms of MidSideSplit/Merge<commit_after>define(["Tone/core/Tone", "Tone/effect/Effect", "Tone/component/MidSideSplit", "Tone/component/MidSideMerge"], 
	function(Tone){

	"use strict";

	/**
	 *  @class Mid/Side processing separates the the 'mid' signal 
	 *         (which comes out of both the left and the right channel) 
	 *         and the 'side' (which only comes out of the the side channels) 
	 *         and effects them separately before being recombined. <br>
	 *         Applies a Mid/Side seperation and recombination. <br>
	 *         http://musicdsp.org/showArchiveComment.php?ArchiveID=173<br>
	 *         http://www.kvraudio.com/forum/viewtopic.php?t=212587<br>
	 *         M = (L+R)/sqrt(2);   // obtain mid-signal from left and right<br>
	 *         S = (L-R)/sqrt(2);   // obtain side-signal from left and righ<br>
	 *         // amplify mid and side signal seperately:<br>
	 *         M/S send/return<br>
	 *         L = (M+S)/sqrt(2);   // obtain left signal from mid and side<br>
	 *         R = (M-S)/sqrt(2);   // obtain right signal from mid and side<br>
	 *
	 *  @extends {Tone.Effect}
	 *  @constructor
	 */
	Tone.MidSideEffect = function(){
		Tone.Effect.call(this);

		/**
		 *  The mid/side split
		 *  @type  {Tone.MidSideSplit}
		 *  @private
		 */
		this._midSideSplit = new Tone.MidSideSplit();

		/**
		 *  The mid/side merge
		 *  @type  {Tone.MidSideMerge}
		 *  @private
		 */
		this._midSideMerge = new Tone.MidSideMerge();

		/**
		 *  The mid send. Connect to mid processing
		 *  @type {Tone.Expr}
		 */
		this.midSend = this._midSideSplit.mid;

		/**
		 *  The side send. Connect to side processing
		 *  @type {Tone.Expr}
		 */
		this.sideSend = this._midSideSplit.side;

		/**
		 *  The mid return connection
		 *  @type {GainNode}
		 */
		this.midReturn = this._midSideMerge.mid;

		/**
		 *  The side return connection
		 *  @type {GainNode}
		 */
		this.sideReturn = this._midSideMerge.side;

		//the connections
		this.effectSend.connect(this._midSideSplit);
		this._midSideMerge.connect(this.effectReturn);
	};

	Tone.extend(Tone.MidSideEffect, Tone.Effect);

	/**
	 *  clean up
	 *  @returns {Tone.MidSideEffect} `this`
	 */
	Tone.MidSideEffect.prototype.dispose = function(){
		Tone.Effect.prototype.dispose.call(this);
		this._midSideSplit.dispose();
		this._midSideSplit = null;
		this._midSideMerge.dispose();
		this._midSideMerge = null;
		this.midSend = null;
		this.sideSend = null;
		this.midReturn = null;
		this.sideReturn = null;
		return this;
	};

	return Tone.MidSideEffect;
});
{'fraction_non_alphanumeric': 0.1510355278666442, 'fraction_numerical': 0.011112981983498905, 'mean_word_length': 2.7714285714285714, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5740929', 'n_tokens_mistral': 2354, 'n_tokens_neox': 2041, 'n_words': 455}