kicker: some cleanup

This commit is contained in:
Hannu Haahti
2014-03-29 01:21:44 +02:00
parent 29c2d3fb1a
commit b4421700fa
3 changed files with 6 additions and 22 deletions

View File

@@ -59,7 +59,6 @@ public:
for( fpp_t frame = 0; frame < frames; ++frame )
{
const double gain = ( 1 - fastPow( ( m_counter < m_length ) ? m_counter / m_length : 1, m_env ) );
//~ qDebug( "%f", gain );
const sample_t s = ( Oscillator::sinSample( m_phase ) * ( 1 - m_noise ) ) + ( Oscillator::noiseSample( 0 ) * gain * gain * m_noise );
buf[frame][0] = s * gain;
buf[frame][1] = s * gain;
@@ -67,7 +66,6 @@ public:
m_phase += m_freq / sampleRate;
const double change = ( m_counter < m_length ) ? ( ( m_startFreq - m_endFreq ) * ( 1 - fastPow( m_counter / m_length, m_slope ) ) ) : 0;
//~ qDebug( "%f (%f) [%lu, %f]", change, powf( m_counter / m_length, m_slope ), m_counter, m_length );
m_freq = m_endFreq + change;
++m_counter;
}

View File

@@ -1,7 +1,8 @@
/*
* kicker.cpp - bassdrum-synthesizer
* kicker.cpp - drum synthesizer
*
* Copyright (c) 2006-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
* Copyright (c) 2014 Hannu Haahti <grejppi/at/gmail.com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
@@ -44,7 +45,7 @@ Plugin::Descriptor PLUGIN_EXPORT kicker_plugin_descriptor =
STRINGIFY( PLUGIN_NAME ),
"Kicker",
QT_TRANSLATE_NOOP( "pluginBrowser",
"Versatile kick- & bassdrum-synthesizer" ),
"Versatile drum synthesizer" ),
"Tobias Doerffel <tobydox/at/users.sf.net>",
0x0100,
Plugin::Instrument,
@@ -126,7 +127,6 @@ QString kickerInstrument::nodeName() const
//typedef DspEffectLibrary::foldbackDistortion<> DistFX;
typedef DspEffectLibrary::Distortion DistFX;
typedef KickerOsc<DspEffectLibrary::MonoToStereoAdaptor<DistFX> > SweepOsc;
@@ -156,25 +156,10 @@ void kickerInstrument::playNote( NotePlayHandle * _n,
_n->noteOff();
}
//const float freq = instrumentTrack()->frequency( _n ) / 2;
//~ const float fdiff = m_endFreqModel.value() - m_startFreqModel.value();
/* const fpp_t frames = _n->isReleased() ?
tMax( tMin<f_cnt_t>( desiredReleaseFrames() -
_n->releaseFramesDone(),
engine::mixer()->framesPerAudioBuffer() ), 0 )
:
engine::mixer()->framesPerAudioBuffer();*/
const fpp_t frames = _n->framesLeftForCurrentPeriod();
//~ const float slopePoint = powf( fdiff / decfr, 1 + m_slopeModel.value() * 6 );
//~ const float f1 = m_startFreqModel.value() + tfp * ((fdiff/decfr) * slopePoint);
//~ const float f2 = m_startFreqModel.value() + (frames+tfp-1) * ((fdiff/decfr) * slopePoint);
SweepOsc * so = static_cast<SweepOsc *>( _n->m_pluginData );
so->update( _working_buffer, frames,
engine::mixer()->processingSampleRate() );
so->update( _working_buffer, frames, engine::mixer()->processingSampleRate() );
if( _n->isReleased() )
{

View File

@@ -1,5 +1,6 @@
/*
* kicker.h - bassdrum-synthesizer
* kicker.h - drum synthesizer
* Copyright (c) 2014 Hannu Haahti <grejppi/at/gmail.com>
*
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*