Skip to content

Commit b48aa32

Browse files
authored
fix reversed pan values (#278)
* fix reversed pan values * update version * code rev
1 parent bfee5e3 commit b48aa32

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
55
endif()
66

77

8-
project ("sdl2-hyper-sonic-drivers" VERSION 0.15.1 DESCRIPTION "SDL2 based Hyper-Sonic Drivers for emulating old soundcards")
8+
project ("sdl2-hyper-sonic-drivers" VERSION 0.15.2 DESCRIPTION "SDL2 based Hyper-Sonic Drivers for emulating old soundcards")
99
include (TestBigEndian)
1010
TEST_BIG_ENDIAN(IS_BIG_ENDIAN)
1111
if(IS_BIG_ENDIAN)

sdl2-hyper-sonic-drivers/src/HyperSonicDrivers/audio/mixer/Channel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ namespace HyperSonicDrivers::audio::mixer
118118
const float pan = (127.5f + m_pan) / 255.0f;
119119
// TODO: create different selectable pan laws
120120
// -3dB pan law
121-
m_volL = static_cast<uint16_t>(std::round(sqrt(1 - pan) * vol / ch_max_vol));
122-
m_volR = static_cast<uint16_t>(std::round(sqrt(pan) * vol / ch_max_vol));
121+
m_volL = static_cast<uint16_t>(std::round(sqrt(pan) * vol / ch_max_vol));
122+
m_volR = static_cast<uint16_t>(std::round(sqrt(1 - pan) * vol / ch_max_vol));
123123

124124
// adjust for master volume
125125
const auto m_vol = m_mixer.getMasterVolume();

0 commit comments

Comments
 (0)