Skip to content

Commit

Permalink
Fix for A Phaser parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jnonis committed Jul 28, 2024
1 parent 38f9f5f commit d695762
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 35 deletions.
44 changes: 18 additions & 26 deletions src/effect_audio/effect_aphaser.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,18 @@ class AudioEffectAPhaser : public AudioEffect
{
BYPASS,
WETDRY,
PAN,
DISTORTION,
PH_FREQ,
PH_RND,
TYPE,
STDL,
PH_DEPTH,
WIDTH,
FB,
STAGES,
LRCR,
OFFSET,
SUB,
PHASE,
PH_DEPTH,
HYPER,
UNKNOWN
};

Expand All @@ -41,20 +42,6 @@ class AudioEffectAPhaser : public AudioEffect
this->init_params = true;

this->phaser->setpreset(0);
/*
this->setParameter(AudioEffectAPhaser::Param::WETDRY, 64);
this->setParameter(AudioEffectAPhaser::Param::PAN, 64);
this->setParameter(AudioEffectAPhaser::Param::PH_FREQ, 11);
this->setParameter(AudioEffectAPhaser::Param::PH_RND, 0);
this->setParameter(AudioEffectAPhaser::Param::TYPE, 0);
this->setParameter(AudioEffectAPhaser::Param::STDL, 64);
this->setParameter(AudioEffectAPhaser::Param::PH_DEPTH, 110);
this->setParameter(AudioEffectAPhaser::Param::FB, 64);
this->setParameter(AudioEffectAPhaser::Param::STAGES, 4);
this->setParameter(AudioEffectAPhaser::Param::LRCR, 0);
this->setParameter(AudioEffectAPhaser::Param::SUB, 0);
this->setParameter(AudioEffectAPhaser::Param::PHASE, 20);
*/
}

virtual ~AudioEffectAPhaser()
Expand Down Expand Up @@ -88,7 +75,7 @@ class AudioEffectAPhaser : public AudioEffect
case AudioEffectAPhaser::Param::WETDRY:
this->phaser->changepar(0, value);
break;
case AudioEffectAPhaser::Param::PAN:
case AudioEffectAPhaser::Param::DISTORTION:
this->phaser->changepar(1, value);
break;
case AudioEffectAPhaser::Param::PH_FREQ:
Expand All @@ -103,7 +90,7 @@ class AudioEffectAPhaser : public AudioEffect
case AudioEffectAPhaser::Param::STDL:
this->phaser->changepar(5, value);
break;
case AudioEffectAPhaser::Param::PH_DEPTH:
case AudioEffectAPhaser::Param::WIDTH:
this->phaser->changepar(6, value);
break;
case AudioEffectAPhaser::Param::FB:
Expand All @@ -112,15 +99,18 @@ class AudioEffectAPhaser : public AudioEffect
case AudioEffectAPhaser::Param::STAGES:
this->phaser->changepar(8, value);
break;
case AudioEffectAPhaser::Param::LRCR:
case AudioEffectAPhaser::Param::OFFSET:
this->phaser->changepar(9, value);
break;
case AudioEffectAPhaser::Param::SUB:
this->phaser->changepar(10, value);
break;
case AudioEffectAPhaser::Param::PHASE:
case AudioEffectAPhaser::Param::PH_DEPTH:
this->phaser->changepar(11, value);
break;
case AudioEffectAPhaser::Param::HYPER:
this->phaser->changepar(12, value);
break;
default:
break;
}
Expand All @@ -134,7 +124,7 @@ class AudioEffectAPhaser : public AudioEffect
return this->getBypass() ? 1 : 0;
case AudioEffectAPhaser::Param::WETDRY:
return this->phaser->getpar(0);
case AudioEffectAPhaser::Param::PAN:
case AudioEffectAPhaser::Param::DISTORTION:
return this->phaser->getpar(1);
case AudioEffectAPhaser::Param::PH_FREQ:
return this->phaser->getpar(2);
Expand All @@ -144,18 +134,20 @@ class AudioEffectAPhaser : public AudioEffect
return this->phaser->getpar(4);
case AudioEffectAPhaser::Param::STDL:
return this->phaser->getpar(5);
case AudioEffectAPhaser::Param::PH_DEPTH:
case AudioEffectAPhaser::Param::WIDTH:
return this->phaser->getpar(6);
case AudioEffectAPhaser::Param::FB:
return this->phaser->getpar(7);
case AudioEffectAPhaser::Param::STAGES:
return this->phaser->getpar(8);
case AudioEffectAPhaser::Param::LRCR:
case AudioEffectAPhaser::Param::OFFSET:
return this->phaser->getpar(9);
case AudioEffectAPhaser::Param::SUB:
return this->phaser->getpar(10);
case AudioEffectAPhaser::Param::PHASE:
case AudioEffectAPhaser::Param::PH_DEPTH:
return this->phaser->getpar(11);
case AudioEffectAPhaser::Param::HYPER:
return this->phaser->getpar(12);
default:
return 0;
}
Expand Down
20 changes: 11 additions & 9 deletions src/uimenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,17 +286,18 @@ CUIMenu::TMenuItem CUIMenu::s_FXAPhaser[] =
{
{"Bypass", EditTGFXParameter, 0, AudioEffectAPhaser::Param::BYPASS},
{"Mix", EditTGFXParameter, 0, AudioEffectAPhaser::Param::WETDRY},
{"Pan", EditTGFXParameter, 0, AudioEffectAPhaser::Param::PAN},
{"Distortion", EditTGFXParameter, 0, AudioEffectAPhaser::Param::DISTORTION},
{"Freq", EditTGFXParameter, 0, AudioEffectAPhaser::Param::PH_FREQ},
{"Random", EditTGFXParameter, 0, AudioEffectAPhaser::Param::PH_RND},
{"Type", EditTGFXParameter, 0, AudioEffectAPhaser::Param::TYPE},
{"Stereo", EditTGFXParameter, 0, AudioEffectAPhaser::Param::STDL},
{"Depth", EditTGFXParameter, 0, AudioEffectAPhaser::Param::PH_DEPTH},
{"Width", EditTGFXParameter, 0, AudioEffectAPhaser::Param::WIDTH},
{"Feedback", EditTGFXParameter, 0, AudioEffectAPhaser::Param::FB},
{"Stages", EditTGFXParameter, 0, AudioEffectAPhaser::Param::STAGES},
{"L/R Cross", EditTGFXParameter, 0, AudioEffectAPhaser::Param::LRCR},
{"Offset", EditTGFXParameter, 0, AudioEffectAPhaser::Param::OFFSET},
{"Sub", EditTGFXParameter, 0, AudioEffectAPhaser::Param::SUB},
{"Phase", EditTGFXParameter, 0, AudioEffectAPhaser::Param::PHASE},
{"Depth", EditTGFXParameter, 0, AudioEffectAPhaser::Param::PH_DEPTH},
{"Hyper", EditTGFXParameter, 0, AudioEffectAPhaser::Param::HYPER},
{0}
};

Expand Down Expand Up @@ -575,21 +576,22 @@ const CUIMenu::TParameter CUIMenu::s_TGFXPhaserParam[AudioEffectPhaser::Param::U
};

// must match AudioEffectAPhaser::Param
const CUIMenu::TParameter CUIMenu::s_TGFXAPhaserParam[AudioEffectPhaser::Param::UNKNOWN] =
const CUIMenu::TParameter CUIMenu::s_TGFXAPhaserParam[AudioEffectAPhaser::Param::UNKNOWN] =
{
{0, 1, 1, ToOnOff}, // BYPASS
{0, 127, 1}, // WETDRY
{0, 127, 1}, // PAN
{0, 127, 1}, // DISTORTION
{1, 600, 1}, // PH_FREQ
{0, 127, 1}, // PH_RND
{0, 11, 1}, // TYPE
{0, 127, 1}, // STDL
{0, 127, 1}, // PH_DEPTH
{0, 127, 1}, // WIDTH
{0, 127, 1}, // FB
{0, 12, 1}, // STAGES
{0, 127, 1}, // LRCR
{0, 127, 1}, // OFFSET
{0, 1, 1, ToOnOff}, // SUB
{0, 127, 1}, // PHASE
{0, 127, 1}, // PH_DEPTH
{0, 1, 1, ToOnOff}, // HYPER
};

// must match MidiArp::Param
Expand Down

0 comments on commit d695762

Please sign in to comment.