Skip to content

Commit

Permalink
Remove redundant calculation in BASS matrix generation (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicfind authored Jul 6, 2023
1 parent e171156 commit a067c0a
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
Expand Down Expand Up @@ -246,14 +246,11 @@ public static void Generate(ExtractedConSongEntry song, DataArray dta, List<Data

for (int i = 0; i < PanData.Length; i++)
{
float theta = PanData[i] * ((float) Math.PI / 4);
float ratioL = (float) (Math.Sqrt(2) / 2) * ((float) Math.Cos(theta) - (float) Math.Sin(theta));
float ratioR = (float) (Math.Sqrt(2) / 2) * ((float) Math.Cos(theta) + (float) Math.Sin(theta));

float theta = (PanData[i] + 1) * ((float) Math.PI / 4);
float volRatio = (float) Math.Pow(10, VolumeData[i] / 20);

song.MatrixRatios[i, 0] = volRatio * ratioL;
song.MatrixRatios[i, 1] = volRatio * ratioR;
song.MatrixRatios[i, 0] = volRatio * (float) Math.Cos(theta);
song.MatrixRatios[i, 1] = volRatio * (float) Math.Sin(theta);
}

// END BASS Matrix calculation ------------------------------------------------------------------
Expand Down

0 comments on commit a067c0a

Please sign in to comment.