Random graph approximation and cleanup

This commit is contained in:
Oskar Wallgren
2014-05-23 03:46:40 +02:00
parent 3d61768538
commit 768f0e54b0
3 changed files with 17 additions and 14 deletions

View File

@@ -90,7 +90,9 @@ private:
ledCheckBox * m_x100Cb;
ledCheckBox * m_controlEnvAmountCb;
float m_randomGraph;
void updateRandomGraph();
} ;
#endif

View File

@@ -68,6 +68,7 @@ void EnvelopeAndLfoParameters::LfoInstances::reset()
void EnvelopeAndLfoParameters::LfoInstances::add( EnvelopeAndLfoParameters * lfo )
{
QMutexLocker m( &m_lfoListMutex );
@@ -86,7 +87,6 @@ void EnvelopeAndLfoParameters::LfoInstances::remove( EnvelopeAndLfoParameters *
EnvelopeAndLfoParameters::EnvelopeAndLfoParameters(
float _value_for_zero_amount,
Model * _parent ) :
@@ -219,12 +219,11 @@ inline sample_t EnvelopeAndLfoParameters::lfoShapeSample( fpp_t _frame_offset )
shape_sample = m_userWave.userWaveSample( phase );
break;
case RandomWave:
shape_sample = m_random;
if( frame == 0 )
{
updateRandomWave();
shape_sample = m_random;
}
shape_sample = m_random;
break;
case SineWave:
default:

View File

@@ -535,16 +535,11 @@ void EnvelopeAndLfoView::paintEvent( QPaintEvent * )
val = Oscillator::squareSample( phase );
break;
case EnvelopeAndLfoParameters::RandomWave:
val = Oscillator::sawSample( phase );
// val = Oscillator::noiseSample( phase );
// shape_sample = m_random;
// if( frame == 0 )
// {
// updateRandomWave();
// shape_sample = m_random;
// }
// break;
// val = Oscillator::squareSample( phase );// <- dummy!
if( x % (int)( 900 * m_lfoSpeedKnob->value<float>() + 1 ) == 0 )
{
updateRandomGraph();
}
val = m_randomGraph;
break;
case EnvelopeAndLfoParameters::UserDefinedWave:
val = m_params->m_userWave.
@@ -577,6 +572,13 @@ void EnvelopeAndLfoView::paintEvent( QPaintEvent * )
void EnvelopeAndLfoView::updateRandomGraph()
{
m_randomGraph = Oscillator::noiseSample( 0.0f );
}
void EnvelopeAndLfoView::lfoUserWaveChanged()
{