Fixes for stereo panning.

Fixes for epiano tranpose.
pull/112/head
Holger Wirtz 3 years ago
parent 68508e9148
commit c8ea230e4b
  1. 4
      MicroDexed.ino
  2. 10
      effect_stereo_panorama.cpp

@ -1081,7 +1081,7 @@ void handleNoteOn(byte inChannel, byte inNumber, byte inVelocity)
{
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note)
{
ep.noteOn(inNumber + configuration.epiano.transpose, inVelocity);
ep.noteOn(inNumber + configuration.epiano.transpose - 23, inVelocity);
#ifdef DEBUG
char note_name[4];
getNoteName(note_name, inNumber);
@ -1166,7 +1166,7 @@ void handleNoteOff(byte inChannel, byte inNumber, byte inVelocity)
{
if (inNumber >= configuration.epiano.lowest_note && inNumber <= configuration.epiano.highest_note)
{
ep.noteOff(inNumber + configuration.epiano.transpose);
ep.noteOff(inNumber + configuration.epiano.transpose - 23);
#ifdef DEBUG
char note_name[4];
getNoteName(note_name, inNumber);

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

Loading…
Cancel
Save