diff --git a/MicroDexed.ino b/MicroDexed.ino index 053e3d4..c0ebd64 100644 --- a/MicroDexed.ino +++ b/MicroDexed.ino @@ -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); diff --git a/effect_stereo_panorama.cpp b/effect_stereo_panorama.cpp index 524285b..8e03016 100644 --- a/effect_stereo_panorama.cpp +++ b/effect_stereo_panorama.cpp @@ -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