View Single Post
Old 15th February 2012, 14:00   #1003  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 693
I'm resigning myself with this issue. LoadDll it's gonna be until someday perhaps bass_ofr.dll and bass_tak.dll will search for external Dlls in the plugins directory first.

Something completely different now...

In the past I've always used BeSweet in combination with BeLight to do 5.1 AC3 to DPLII <audio-format> conversions. Lately I've been experimenting with Foobar, foo_input_avs (to load Avisynth scripts) and several DSPs, but I wasn't satisfied with the results. Before Foobar I already knew BeHappy could do the same thing more or less, but yesterday I really dug into it;

I noticed BeHappy uses another DPLII matrix, compared to the official one, which has been discussed here amongst other threads.
Now if I understand correctly how to derive a DPLII matrix's coefficients, and I did my calculations correctly in the draft below, those numbers have to correspond with the official DPLII matrix, don't they?

Draft with calculations I made in notepad yesterday:
Code:
BeHappy DPL2 matrix:
Lt = 1.0L + 0.7071(√½)*C + 0.8660(√¾)*Ls + 0.5000(√¼)*Rs	1 + 0.7071 + 0.8660 + 0.5000 = 3.0731
Rt = 1.0R + 0.7071(√½)*C - 0.5000(√¼)*Ls - 0.8660(√¾)*Rs	1 / 3.0731 = 0.3254

function Dmix6Dpl2(clip a) {
  flr = GetChannel(a, 1, 2)
  fcc = GetChannel(a, 3, 3)
  lrc = MixAudio(flr, fcc, 0.3254, 0.2301)			0.3254, (0.3254*0.7071)
  bl  = GetChannel(a, 5)
  br  = GetChannel(a, 6)
  sl  = MixAudio(bl, br, 0.2818, 0.1627)			(0.3254* 0.8660), (0.3254* 0.5000)
  sr  = MixAudio(bl, br, -0.1627, -0.2818)			(0.3254*-0.5000), (0.3254*-0.8660)
  blr = MergeChannels(sl, sr)
  return MixAudio(lrc, blr, 1.0, 1.0)
}
=====================================================================================================
Official DPL2 matrix:
Lt = 1.0L + 0.7071(√½)*C - 0.8165(√⅔)*Ls - 0.5774(√⅓)*Rs	1 + 0.7071 + 0.8165 + 0.5774 = 3.1010
Rt = 1.0R + 0.7071(√½)*C + 0.5774(√⅓)*Ls + 0.8165(√⅔)*Rs	1 / 3.1010 = 0.3225

function Dmix6Dpl2(clip a) {
  flr = GetChannel(a, 1, 2)
  fcc = GetChannel(a, 3, 3)
  lrc = MixAudio(flr, fcc, 0.3225, 0.2280)			0.3225, (0.3225*0.7071)
  bl  = GetChannel(a, 5)
  br  = GetChannel(a, 6)
  sl  = MixAudio(bl, br, -0.2633, -0.1862)			(0.3225*-0.8165), (0.3225*-0.5774)
  sr  = MixAudio(bl, br, 0.1862, 0.2633)			(0.3225* 0.5774), (0.3225* 0.8165)
  blr = MergeChannels(sl, sr)
  return MixAudio(lrc, blr, 1.0, 1.0)
}
=======================================================================================================================
Official DPL2+LFE matrix:
Lt = 1.0L + 0.7071(√½)*C + 0.7071(√½)*LFE - 0.8165(√⅔)*Ls - 0.5774(√⅓)*Rs	1 + 2*0.7071 + 0.8165 + 0.5774 = 3.8081
Rt = 1.0R + 0.7071(√½)*C + 0.7071(√½)*LFE + 0.5774(√⅓)*Ls + 0.8165(√⅔)*Rs	1 / 3.8081 = 0.2626

function Dmix6Dpl2Lfe(clip a) {
  flr = GetChannel(a, 1, 2)
  fcc = GetChannel(a, 3, 3)
  lrc = MixAudio(flr, fcc, 0.2626, 0.1857)			0.2626, (0.2626*0.7071)
  lfe = GetChannel(a, 4, 4)
  lrc = MixAudio(lrc, lfe, 1.0, 0.1857)					(0.2626*0.7071)
  bl  = GetChannel(a, 5)
  br  = GetChannel(a, 6)
  sl  = MixAudio(bl, br, -0.2144, -0.1516)			(0.2626*-0.8165), (0.2626*-0.5774)
  sr  = MixAudio(bl, br, 0.1516, 0.2144)			(0.2626* 0.5774), (0.2626* 0.8165)
  blr = MergeChannels(sl, sr)
  return MixAudio(lrc, blr, 1.0, 1.0)
}
Now, as I'm unsatisfied with Foobar's Dynamics Compressor, I'd like to do BeSweet.exe -azid(-s dplii -c normal -L -3db --maximize) -ota(-hybridgain) (which I've been using a lot in the past if I remember correctly) with Avisynth. Please tell me, am I getting close?:
Code:
NicDTSSource("FileName.dts", DRC=1)		# -azid(-c normal)
ConvertAudioToFloat()

flr = GetChannel(1, 2)
fc  = GetChannel(3, 3)
lrc = MixAudio(flr, fc, 0.2626, 0.1857)
lfe = GetChannel(4, 4)
lrc = MixAudio(lrc, lfe, 1.0, 0.1857)
-----------------------------------------
lfe = GetChannel(4, 4).AmplifydB(-3.0)	# -azid(-L -3db), or would this totally screw-up the DPLII-matrix?
lrc = MixAudio(lrc, lfe, 1.0, 1.0)
-----------------------------------------
bl  = GetChannel(5)
br  = GetChannel(6)
sl  = MixAudio(bl, br, -0.2144, -0.1516)
sr  = MixAudio(bl, br, 0.1516, 0.2144)
blr = MergeChannels(sl, sr)
MixAudio(lrc, blr, 1.0, 1.0)			# -azid(-s dplii)

Normalize()					# -azid(--maximize)
AmplifydB(10)					# -ota(hybridgain), I just picked a number (dB), because I don't
						#		    know what would be equivalent to hybridgain.
P.s. Although I believe this is the official DPLII matrix, it's strange this one is also mentioned on wikipedia...
__________________
My hobby website

Last edited by Reino; 15th February 2012 at 14:51. Reason: syntax
Reino is offline   Reply With Quote