|
|
@ -68,7 +68,7 @@ inline float mapfloat(float val, float in_min, float in_max, float out_min, floa |
|
|
|
|
|
|
|
|
|
|
|
void AudioEffectStereoPanorama::panorama(float p) |
|
|
|
void AudioEffectStereoPanorama::panorama(float p) |
|
|
|
{ |
|
|
|
{ |
|
|
|
pan = mapfloat(p, -1.0, 1.0, -1.0, 1.0); |
|
|
|
pan = constrain(p, -1.0, 1.0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void AudioEffectStereoPanorama::update(void) |
|
|
|
void AudioEffectStereoPanorama::update(void) |
|
|
@ -98,14 +98,14 @@ void AudioEffectStereoPanorama::update(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (pan > 0.0) |
|
|
|
if (pan > 0.0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
out_f[0][n] = (pan * in_f[1][n]) + ((1.0 - pan) * in_f[0][n]); |
|
|
|
out_f[1][n] = (pan * in_f[0][n]) + ((1.0 - pan) * in_f[1][n]); |
|
|
|
out_f[1][n] = (1.0 - pan) * in_f[1][n]; |
|
|
|
out_f[0][n] = (1.0 - pan) * in_f[0][n]; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
float _pan_ = fabs(pan); |
|
|
|
float _pan_ = fabs(pan); |
|
|
|
out_f[1][n] = (_pan_ * in_f[0][n]) + ((1.0 - _pan_) * in_f[1][n]); |
|
|
|
out_f[0][n] = (_pan_ * in_f[1][n]) + ((1.0 - _pan_) * in_f[0][n]); |
|
|
|
out_f[0][n] = (1.0 - _pan_) * in_f[0][n]; |
|
|
|
out_f[1][n] = (1.0 - _pan_) * in_f[1][n]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|