Skip to content

Commit

Permalink
Phase protection for panning
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Sosnowski authored and Tomasz Sosnowski committed Mar 19, 2018
1 parent 5c685b5 commit fd991a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SLUG = KoralfxVCV

# Must follow the format in the Versioning section of https://vcvrack.com/manual/PluginDevelopmentTutorial.html
VERSION = 0.5.0
VERSION = 0.5.1

# FLAGS will be passed to both the C and C++ compiler
FLAGS +=
Expand Down
5 changes: 5 additions & 0 deletions src/Mixovnik.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ void Mixovnik::step() {

//Constant-power panning
float KNOB_PAN_POS = params[PAN_PARAM + i].value + (inputs[STRIPE_CV_PAN_INPUT + i].value / 5);

//Anti invert phase
if (KNOB_PAN_POS < -1) KNOB_PAN_POS = -1;
if (KNOB_PAN_POS > 1) KNOB_PAN_POS = 1;

double angle = KNOB_PAN_POS * PI_4;
float GAIN_SIGNAL_L = (float) (SQRT2_2 * (cos(angle) - sin(angle)));
float GAIN_SIGNAL_R = (float) (SQRT2_2 * (cos(angle) + sin(angle)));
Expand Down

0 comments on commit fd991a4

Please sign in to comment.