volume and pan effects are now logarithmic closer to human hearing (#77)

This commit is contained in:
itsmattkc
2018-06-21 11:04:15 -07:00
parent f344e262e8
commit 72d15b9ed9
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -2,6 +2,7 @@
#include <QGridLayout>
#include <QLabel>
#include <QtMath>
#include <cmath>
#include "ui/labelslider.h"
@@ -52,7 +53,7 @@ void PanEffect::process_audio(quint8 *samples, int nb_bytes) {
qint16 left_sample = (qint16) ((samples[i+1] << 8) | samples[i]);
qint16 right_sample = (qint16) ((samples[i+3] << 8) | samples[i+2]);
float val = pan_val->value()*0.01f;
float val = qPow(pan_val->value()*0.01f, 3);
if (val < 0) {
// affect right channel
right_sample *= (1-std::abs(val));