User-Defined Opcode Database

stereoMS

Converts Stereo to MS and MS to Stereo.

Download UDO File

Description

Converts Stereo to Middle/Side and Middle/Side to Stereo.

Syntax

aout1, aout2 stereoMS ain1, ain2

Initialization

ain1 -- left or middle audio channel
ain2 -- right or side audio channel

Performance

Converts Stereo to Middle/Side and Middle/Side to Stereo. The math is the same so this opcode can be used in both directions.

Code

opcode stereoMS, aa, aa

	ain1, ain2	xin

	ifac	=	.5 * sqrt(2)
	aout1	=	ifac * (ain1 + ain2)
	aout2	=	ifac * (ain1 - ain2)

	xout aout1, aout2

endop

Examples

instr 1

ainl, ainr ins   ; input signal
am, as stereoMS ainl, ainr  ;convert to ms
aoutl, aoutr  stereoMS  am, as*.25  ; and back to l/r but with reduced side
outs aoutl, aoutr

endin

Credits

Joseph Anderson and ma++, jan 2005


Previous Home Next
ampSlider   stereoRotate