Allow changing envelope sin transform frequency
This commit is contained in:
parent
b4c3b026e1
commit
b0e0cd673e
@ -339,6 +339,11 @@ bool EnvelopeComponent::keyPressed(const KeyPress & ev)
|
|||||||
r = f(m_envelope->m_transform_y_tilt,0.02);
|
r = f(m_envelope->m_transform_y_tilt,0.02);
|
||||||
if (ev == 'H')
|
if (ev == 'H')
|
||||||
r = f(m_envelope->m_transform_y_tilt,-0.02);
|
r = f(m_envelope->m_transform_y_tilt,-0.02);
|
||||||
|
if (ev == 'V')
|
||||||
|
r = f(m_envelope->m_transform_y_sinus_freq,1.0);
|
||||||
|
if (ev == 'B')
|
||||||
|
r = f(m_envelope->m_transform_y_sinus_freq,-1.0);
|
||||||
|
m_envelope->m_transform_y_sinus_freq = jlimit(1.0,64.0, m_envelope->m_transform_y_sinus_freq);
|
||||||
if (r==true)
|
if (r==true)
|
||||||
{
|
{
|
||||||
repaint();
|
repaint();
|
||||||
|
@ -563,6 +563,7 @@ public:
|
|||||||
double m_transform_y_shift = 0.0;
|
double m_transform_y_shift = 0.0;
|
||||||
double m_transform_y_scale = 1.0;
|
double m_transform_y_scale = 1.0;
|
||||||
double m_transform_y_sinus = 0.0;
|
double m_transform_y_sinus = 0.0;
|
||||||
|
double m_transform_y_sinus_freq = 8.0;
|
||||||
double m_transform_y_tilt = 0.0;
|
double m_transform_y_tilt = 0.0;
|
||||||
inline double getTransformedValue(double x)
|
inline double getTransformedValue(double x)
|
||||||
{
|
{
|
||||||
@ -574,7 +575,8 @@ public:
|
|||||||
double v = GetInterpolatedNodeValue(temp);
|
double v = GetInterpolatedNodeValue(temp);
|
||||||
double diff = 0.5 - v;
|
double diff = 0.5 - v;
|
||||||
double scaled = 0.5 - m_transform_y_scale * diff;
|
double scaled = 0.5 - m_transform_y_scale * diff;
|
||||||
double shifted = scaled + m_transform_y_shift + m_transform_y_sinus*sin(2*3.141592653*(x-m_transform_x_shift)*8.0);
|
double shifted = scaled + m_transform_y_shift + m_transform_y_sinus*
|
||||||
|
sin(2*3.141592653*(x-m_transform_x_shift)*m_transform_y_sinus_freq);
|
||||||
double tiltline = 0.5+m_transform_y_tilt*x;
|
double tiltline = 0.5+m_transform_y_tilt*x;
|
||||||
double tilted = shifted+tiltline;
|
double tilted = shifted+tiltline;
|
||||||
return jlimit(0.0,1.0,tilted);
|
return jlimit(0.0,1.0,tilted);
|
||||||
|
Loading…
Reference in New Issue
Block a user