Correct pan law so balance in [0, 1] hardpans

main
Charlotte Som 2023-05-30 07:48:13 +01:00
parent 1919b0a166
commit a255009cc0
1 changed files with 2 additions and 2 deletions

View File

@ -29,8 +29,8 @@ fn decode_signal_balance(channel_0: &mut [f32], channel_1: &mut [f32]) {
let sig = channel_0[sample_idx];
let balance = channel_1[sample_idx];
let left = sig * (0.5 * -balance + 1.0);
let right = sig * (0.5 * balance + 1.0);
let left = sig * (1.0 - balance) * 0.5;
let right = sig * (1.0 + balance) * 0.5;
channel_0[sample_idx] = left;
channel_1[sample_idx] = right;