summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXANTRONIX Development2022-02-01 00:23:29 -0500
committerXANTRONIX Development2022-02-01 00:23:29 -0500
commit4db12c6c0442a284b3c8c3b3aaf196aca546130a (patch)
tree33858f18b05c09cd76ec5284ae3278bcff75cdbf
parent617cac672b997ffde087caafbbbf54f7a6c46714 (diff)
downloadxas-4db12c6c0442a284b3c8c3b3aaf196aca546130a.tar.gz
xas-4db12c6c0442a284b3c8c3b3aaf196aca546130a.tar.bz2
xas-4db12c6c0442a284b3c8c3b3aaf196aca546130a.zip
Fix panning
-rw-r--r--src/mixer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mixer.c b/src/mixer.c
index 0f3b5b1..3b49ba2 100644
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -191,6 +191,8 @@ xas_audio_stream *xas_mixer_output(xas_mixer *mixer) {
}
static inline void input_set_pan(xas_mixer_input *input, float pan) {
+ static float range = 45.0f * (M_PI / 180.0);
+
float angle,
term,
cosf_angle,
@@ -200,7 +202,7 @@ static inline void input_set_pan(xas_mixer_input *input, float pan) {
return;
}
- angle = pan * (M_PI / 2.0f);
+ angle = pan * range;
term = sqrtf(2.0f) / 2.0f;
cosf_angle = cosf(angle);
sinf_angle = sinf(angle);