From b48aa32ddaa60d94ceaf7f3a49e99f95801023c2 Mon Sep 17 00:00:00 2001 From: Raffaello Bertini Date: Sat, 11 Nov 2023 12:49:05 +0000 Subject: [PATCH] fix reversed pan values (#278) * fix reversed pan values * update version * code rev --- CMakeLists.txt | 2 +- .../src/HyperSonicDrivers/audio/mixer/Channel.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ba94995..bf6754c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,7 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE) endif() -project ("sdl2-hyper-sonic-drivers" VERSION 0.15.1 DESCRIPTION "SDL2 based Hyper-Sonic Drivers for emulating old soundcards") +project ("sdl2-hyper-sonic-drivers" VERSION 0.15.2 DESCRIPTION "SDL2 based Hyper-Sonic Drivers for emulating old soundcards") include (TestBigEndian) TEST_BIG_ENDIAN(IS_BIG_ENDIAN) if(IS_BIG_ENDIAN) diff --git a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/mixer/Channel.cpp b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/mixer/Channel.cpp index f0c87746..814a9fb0 100644 --- a/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/mixer/Channel.cpp +++ b/sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/mixer/Channel.cpp @@ -118,8 +118,8 @@ namespace HyperSonicDrivers::audio::mixer const float pan = (127.5f + m_pan) / 255.0f; // TODO: create different selectable pan laws // -3dB pan law - m_volL = static_cast(std::round(sqrt(1 - pan) * vol / ch_max_vol)); - m_volR = static_cast(std::round(sqrt(pan) * vol / ch_max_vol)); + m_volL = static_cast(std::round(sqrt(pan) * vol / ch_max_vol)); + m_volR = static_cast(std::round(sqrt(1 - pan) * vol / ch_max_vol)); // adjust for master volume const auto m_vol = m_mixer.getMasterVolume();