Compare commits

..

22 Commits

Author SHA1 Message Date
Tres Finocchiaro
523e5d048b Bump version for stable-1.1 patch release 2015-01-15 15:32:55 -05:00
Vesa
e33645f9ab Fix monstro slopes 2015-01-15 17:17:33 +02:00
Vesa V
24f869c379 Merge pull request #1599 from curlymorphic/i1526
Proposed fix 1526 Watsyn shows wrong Osc
2015-01-12 21:20:40 +02:00
Vesa V
1abb37529d Merge pull request #1601 from curlymorphic/i1492
Proposed fix 1492 Nescaline crash when playing very high note
2015-01-12 21:04:58 +02:00
Dave French
49b3f36a57 1492 fixed type on line 313 2015-01-11 21:23:30 +00:00
Dave French
a1dce66ca8 Proposed fix 1492 Nescaline crash when playing very high note 2015-01-11 21:10:32 +00:00
Dave French
ffde891cfb Proposed fix 1526 Watsyn shows wrong Osc 2015-01-11 20:15:30 +00:00
Vesa V
5fdc452476 Merge pull request #1542 from DanWin/export
Fix export for some locales
2015-01-04 17:05:14 +02:00
Daniel Winzen
44f72b0f13 Added const 2015-01-02 14:21:39 +01:00
Daniel Winzen
93b6888394 Fix export for some locales 2015-01-02 13:08:11 +01:00
Vesa V
e503875a28 Merge pull request #1469 from DanWin/mem
Fix various memory leaks
2014-12-26 19:39:43 +02:00
Daniel Winzen
5bf095b6b9 Revert Zynaddsubfx changes 2014-12-24 20:08:14 +01:00
Vesa
62df768896 Autoquit improvement: On effect plugins where it's possible for the FX to silence the output, measure the levels of the input signal for autoquit
This so that the effect won't be turned off when there's input that the effect is muting (eg. when you use the Amplifier to temporarily mute a signal)
2014-12-24 19:53:05 +02:00
Tres Finocchiaro
58d864a630 Merge pull request #1491 from curlymorphic/i929n2
Proposed fix for 929 AFP wave display
2014-12-24 08:59:27 -05:00
Dave French
b5538c7da8 used newWaveView in constructor, to remove redundancy 2014-12-23 22:26:36 +00:00
Dave French
76a1b8c2b6 Proposed fix for 929 AFP wave display 2014-12-23 16:29:04 +00:00
Dave
ee39cbe94d Merge pull request #16 from LMMS/stable-1.1
Stable 1.1
2014-12-23 16:15:28 +00:00
Daniel Winzen
36d02b9887 Fix memory leaks in Audio setup tab in the settings dialog 2014-12-22 11:42:35 +01:00
Daniel Winzen
e0f7ea57ac Check if object already exists instead of deleting and recreating it 2014-12-20 16:30:28 +01:00
Daniel Winzen
0a732fbc04 Fix mismatched free() / delete / delete [] in RmsHelper.h 2014-12-20 09:07:21 +01:00
Daniel Winzen
b59a50133a Fix memory leaks in ZynAddSubFX 2014-12-19 21:35:43 +01:00
Daniel Winzen
ddbb180800 Fix memory leaks in LADSPA plugins 2014-12-19 21:33:49 +01:00
32 changed files with 128 additions and 55 deletions

View File

@@ -15,7 +15,7 @@ INCLUDE(FindPkgConfig)
SET(VERSION_MAJOR "1")
SET(VERSION_MINOR "1")
SET(VERSION_PATCH "0")
SET(VERSION_PATCH "1")
#SET(VERSION_SUFFIX "")
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
IF(VERSION_SUFFIX)

View File

@@ -38,7 +38,7 @@ public:
}
virtual ~RmsHelper()
{
if( m_buffer ) delete m_buffer;
if( m_buffer ) delete[] m_buffer;
}
inline void setSize( int size )

View File

@@ -77,30 +77,30 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames )
for( fpp_t f = 0; f < frames; ++f )
{
// qDebug( "offset %d, value %f", f, m_ampControls.m_volumeModel.value( f ) );
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
sample_t s[2] = { buf[f][0], buf[f][1] };
// convert vol/pan values to left/right values
const float left1 = m_ampControls.m_volumeModel.value( f ) *
( m_ampControls.m_panModel.value( f ) <= 0
const float left1 = m_ampControls.m_volumeModel.value() *
( m_ampControls.m_panModel.value() <= 0
? 1.0
: 1.0 - m_ampControls.m_panModel.value( f ) / 100.0 );
const float right1 = m_ampControls.m_volumeModel.value( f ) *
( m_ampControls.m_panModel.value( f ) >= 0
const float right1 = m_ampControls.m_volumeModel.value() *
( m_ampControls.m_panModel.value() >= 0
? 1.0
: 1.0 + m_ampControls.m_panModel.value( f ) / 100.0 );
: 1.0 + m_ampControls.m_panModel.value() / 100.0 );
// first stage amplification
s[0] *= ( left1 / 100.0 );
s[1] *= ( right1 / 100.0 );
// second stage amplification
s[0] *= ( m_ampControls.m_leftModel.value( f ) / 100.0 );
s[1] *= ( m_ampControls.m_rightModel.value( f ) / 100.0 );
s[0] *= ( m_ampControls.m_leftModel.value() / 100.0 );
s[1] *= ( m_ampControls.m_rightModel.value() / 100.0 );
buf[f][0] = d * buf[f][0] + w * s[0];
buf[f][1] = d * buf[f][1] + w * s[1];
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
}
checkGate( outSum / frames );

View File

@@ -88,13 +88,13 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
const float w = wetLevel();
for( fpp_t f = 0; f < frames; ++f )
{
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
sample_t s[2] = { buf[f][0], buf[f][1] };
m_bbFX.nextSample( s[0], s[1] );
buf[f][0] = d * buf[f][0] + w * s[0];
buf[f][1] = d * buf[f][1] + w * s[1];
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
}
checkGate( outSum / frames );

View File

@@ -155,11 +155,11 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames
s[0] += ( s2[0] * mix2 );
s[1] += ( s2[1] * mix2 );
}
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
// do another mix with dry signal
buf[f][0] = d * buf[f][0] + w * s[0];
buf[f][1] = d * buf[f][1] + w * s[1];
outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1];
}
checkGate( outSum / frames );

View File

@@ -567,6 +567,22 @@ lookahead_limiter::lookahead_limiter() {
asc_coeff = 1.f;
}
lookahead_limiter::~lookahead_limiter()
{
if( buffer != NULL)
{
free(buffer);
}
if( nextpos != NULL)
{
free(nextpos);
}
if( nextdelta != NULL)
{
free(nextdelta);
}
}
void lookahead_limiter::activate()
{
is_active = true;

View File

@@ -608,6 +608,7 @@ public:
void reset_asc();
bool get_asc();
lookahead_limiter();
~lookahead_limiter();
void set_multi(bool set);
void process(float &left, float &right, float *multi_buffer);
void set_sample_rate(uint32_t sr);

View File

@@ -47,6 +47,7 @@ struct ladspa_instance: public plugin_ctl_iface
#endif
ladspa_instance(audio_module_iface *_module, ladspa_plugin_metadata_set *_ladspa, int sample_rate);
virtual ~ladspa_instance();
virtual const line_graph_iface *get_line_graph_iface() const { return module->get_line_graph_iface(); }
virtual float get_param_value(int param_no);
virtual void set_param_value(int param_no, float value);

View File

@@ -263,6 +263,7 @@ class mono_audio_module:
}
public:
mono_audio_module();
~mono_audio_module();
void params_changed();
void activate();
void set_sample_rate(uint32_t sr);
@@ -291,6 +292,7 @@ class stereo_audio_module:
}
public:
stereo_audio_module();
~stereo_audio_module();
void params_changed();
void activate();
void set_sample_rate(uint32_t sr);

View File

@@ -84,6 +84,7 @@ public:
uint32_t srate;
bool is_active;
multibandlimiter_audio_module();
~multibandlimiter_audio_module();
void activate();
void deactivate();
void params_changed();

View File

@@ -460,6 +460,14 @@ stereo_audio_module::stereo_audio_module() {
meter_outR = 0.f;
}
stereo_audio_module::~stereo_audio_module()
{
if( buffer != NULL )
{
free(buffer);
}
}
void stereo_audio_module::activate() {
active = true;
}
@@ -686,6 +694,14 @@ mono_audio_module::mono_audio_module() {
meter_outR = 0.f;
}
mono_audio_module::~mono_audio_module()
{
if( buffer != NULL )
{
free(buffer);
}
}
void mono_audio_module::activate() {
active = true;
}

View File

@@ -252,6 +252,14 @@ multibandlimiter_audio_module::multibandlimiter_audio_module()
asc_old = true;
}
multibandlimiter_audio_module::~multibandlimiter_audio_module()
{
if( buffer != NULL)
{
free(buffer);
}
}
void multibandlimiter_audio_module::activate()
{
is_active = true;

View File

@@ -54,6 +54,11 @@ ladspa_instance::ladspa_instance(audio_module_iface *_module, ladspa_plugin_meta
module->post_instantiate();
}
ladspa_instance::~ladspa_instance()
{
delete module;
}
float ladspa_instance::get_param_value(int param_no)
{
// XXXKF hack

View File

@@ -116,6 +116,8 @@ static void activateDj_eq_mono(LADSPA_Handle instance) {
}
static void cleanupDj_eq_mono(LADSPA_Handle instance) {
Dj_eq_mono *plugin_data = (Dj_eq_mono *)instance;
free(plugin_data->filters);
free(instance);
}
@@ -283,6 +285,8 @@ static void activateDj_eq(LADSPA_Handle instance) {
}
static void cleanupDj_eq(LADSPA_Handle instance) {
Dj_eq *plugin_data = (Dj_eq *)instance;
free(plugin_data->filters);
free(instance);
}

View File

@@ -137,6 +137,7 @@ static void cleanupFastLookaheadLimiter(LADSPA_Handle instance) {
#line 188 "fast_lookahead_limiter_1913.xml"
FastLookaheadLimiter *plugin_data = (FastLookaheadLimiter *)instance;
free(plugin_data->buffer);
free(plugin_data->chunks);
free(instance);
}

View File

@@ -202,6 +202,11 @@ static void cleanupImp(LADSPA_Handle instance) {
local_free(plugin_data->op);
local_free(plugin_data->overlap);
local_free(plugin_data->opc);
unsigned int i;
for (i=0; i<IMPULSES; i++) {
local_free(plugin_data->impulse_freq[i]);
}
local_free(plugin_data->impulse_freq);
free(instance);
}

View File

@@ -163,6 +163,7 @@ static void cleanupVynil(LADSPA_Handle instance) {
free(plugin_data->buffer_m);
free(plugin_data->buffer_s);
free(plugin_data->click_buffer);
free(plugin_data->highp);
free(plugin_data->lowp_m);
free(plugin_data->lowp_s);
free(plugin_data->noise_filt);

View File

@@ -145,7 +145,8 @@ activate_eq(LADSPA_Handle instance) {
static
void
cleanup_eq(LADSPA_Handle instance) {
eq *plugin_data = (eq *)instance;
free(plugin_data->filters);
free(instance);
}

View File

@@ -167,7 +167,8 @@ activate_eq(LADSPA_Handle instance) {
static
void
cleanup_eq(LADSPA_Handle instance) {
eq *plugin_data = (eq *)instance;
free(plugin_data->filters);
free(instance);
}

View File

@@ -575,13 +575,8 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument,
m_interpBox->setFont( pointSize<8>( m_interpBox->font() ) );
// wavegraph
m_waveView = new AudioFileProcessorWaveView( this, 245, 75, castModel<audioFileProcessor>()->m_sampleBuffer );
m_waveView->move( 2, 172 );
m_waveView->setKnobs(
dynamic_cast<AudioFileProcessorWaveView::knob *>( m_startKnob ),
dynamic_cast<AudioFileProcessorWaveView::knob *>( m_endKnob ),
dynamic_cast<AudioFileProcessorWaveView::knob *>( m_loopKnob )
);
m_waveView = 0;
newWaveView();
connect( castModel<audioFileProcessor>(), SIGNAL( isPlaying( f_cnt_t ) ),
m_waveView, SLOT( isPlaying( f_cnt_t ) ) );
@@ -630,6 +625,25 @@ void AudioFileProcessorView::dragEnterEvent( QDragEnterEvent * _dee )
void AudioFileProcessorView::newWaveView()
{
if ( m_waveView )
{
delete m_waveView;
m_waveView = 0;
}
m_waveView = new AudioFileProcessorWaveView( this, 245, 75, castModel<audioFileProcessor>()->m_sampleBuffer );
m_waveView->move( 2, 172 );
m_waveView->setKnobs(
dynamic_cast<AudioFileProcessorWaveView::knob *>( m_startKnob ),
dynamic_cast<AudioFileProcessorWaveView::knob *>( m_endKnob ),
dynamic_cast<AudioFileProcessorWaveView::knob *>( m_loopKnob ) );
m_waveView->show();
}
void AudioFileProcessorView::dropEvent( QDropEvent * _de )
{
QString type = stringPairDrag::decodeKey( _de );
@@ -638,6 +652,7 @@ void AudioFileProcessorView::dropEvent( QDropEvent * _de )
{
castModel<audioFileProcessor>()->setAudioFile( value );
_de->accept();
newWaveView();
return;
}
else if( type == QString( "tco_%1" ).arg( track::SampleTrack ) )
@@ -691,6 +706,7 @@ void AudioFileProcessorView::paintEvent( QPaintEvent * )
void AudioFileProcessorView::sampleUpdated( void )
{
newWaveView();
m_waveView->update();
update();
}
@@ -707,6 +723,7 @@ void AudioFileProcessorView::openAudioFile( void )
{
castModel<audioFileProcessor>()->setAudioFile( af );
engine::getSong()->setModified();
newWaveView();
}
}

View File

@@ -118,7 +118,7 @@ public:
AudioFileProcessorView( Instrument * _instrument, QWidget * _parent );
virtual ~AudioFileProcessorView();
void newWaveView();
protected slots:
void sampleUpdated();
void openAudioFile();

View File

@@ -214,11 +214,10 @@ bool dynProcEffect::processAudioBuffer( sampleFrame * _buf,
s[0] *= outputGain;
s[1] *= outputGain;
out_sum += _buf[f][0]*_buf[f][0] + _buf[f][1]*_buf[f][1];
// mix wet/dry signals
_buf[f][0] = d * _buf[f][0] + w * s[0];
_buf[f][1] = d * _buf[f][1] + w * s[1];
out_sum += _buf[f][0]*_buf[f][0] + _buf[f][1]*_buf[f][1];
}
checkGate( out_sum / _frames );

View File

@@ -817,18 +817,11 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float *
}
inline sample_t MonstroSynth::calcSlope1( sample_t s )
inline sample_t MonstroSynth::calcSlope( int slope, sample_t s )
{
if( m_parent->m_slope1 == 1.0f ) return s;
if( m_parent->m_slope[slope] == 1.0f ) return s;
if( s == 0.0f ) return s;
return fastPow( s, m_parent->m_slope1 );
}
inline sample_t MonstroSynth::calcSlope2( sample_t s )
{
if( m_parent->m_slope2 == 1.0f ) return s;
if( s == 0.0f ) return s;
return fastPow( s, m_parent->m_slope2 );
return fastPow( s, m_parent->m_slope[slope] );
}
@@ -1439,14 +1432,14 @@ void MonstroInstrument::updateSamplerate()
void MonstroInstrument::updateSlope1()
{
const float slope = m_env1Slope.value();
m_slope1 = exp10f( slope * -1.0f );
m_slope[0] = exp10f( slope * -1.0f );
}
void MonstroInstrument::updateSlope2()
{
const float slope = m_env2Slope.value();
m_slope2 = exp10f( slope * -1.0f );
m_slope[1] = exp10f( slope * -1.0f );
}

View File

@@ -177,10 +177,7 @@ private:
return s1 + ( s2 - s1 ) * x;
}*/ // using interpolation.h from now on
inline sample_t calcSlope1( sample_t s );
inline sample_t calcSlope2( sample_t s );
inline sample_t calcSlope( int slope, sample_t s );
// checks for lower bound for phase, upper bound is already checked by oscillator-functions in both
// oscillator.h and bandlimitedwave.h so we save some cpu by only checking lower bound
@@ -411,8 +408,7 @@ protected:
f_cnt_t m_env1_relF;
f_cnt_t m_env2_relF;
float m_slope1;
float m_slope2;
float m_slope [2];
f_cnt_t m_lfo1_att;
f_cnt_t m_lfo2_att;

View File

@@ -234,7 +234,7 @@ void NesObject::renderOutput( sampleFrame * buf, fpp_t frames )
// update framecounters
m_ch1Counter++;
m_ch1Counter = m_ch1Counter % m_wlen1;
m_ch1Counter = m_wlen1 ? m_ch1Counter % m_wlen1 : 0;
m_ch1EnvCounter++;
if( m_ch1EnvCounter >= ch1EnvLen )
@@ -287,7 +287,7 @@ void NesObject::renderOutput( sampleFrame * buf, fpp_t frames )
// update framecounters
m_ch2Counter++;
m_ch2Counter = m_ch2Counter % m_wlen2;
m_ch2Counter = m_wlen2 ? m_ch2Counter % m_wlen2 : 0;
m_ch2EnvCounter++;
if( m_ch2EnvCounter >= ch2EnvLen )
@@ -310,13 +310,13 @@ void NesObject::renderOutput( sampleFrame * buf, fpp_t frames )
////////////////////////////////
// make sure we don't overflow
m_ch3Counter %= m_wlen3;
m_ch3Counter = m_wlen3 ? m_ch3Counter % m_wlen3 : 0;
// render triangle wave
if( m_wlen3 <= m_maxWlen && ch3Enabled )
{
ch3Level = static_cast<int>( m_parent->m_ch3Volume.value() );
ch3 = TRIANGLE_WAVETABLE[ ( m_ch3Counter * 32 ) / m_wlen3 ];
ch3 = m_wlen3 ? TRIANGLE_WAVETABLE[ ( m_ch3Counter * 32 ) / m_wlen3 ] : 0;
ch3 = ( ch3 * ch3Level ) / 15;
}
else ch3 = ch3Level = 0;

View File

@@ -748,6 +748,8 @@ WatsynView::WatsynView( Instrument * _instrument,
m_selectedGraphGroup -> addButton( a2_selectButton );
m_selectedGraphGroup -> addButton( b1_selectButton );
m_selectedGraphGroup -> addButton( b2_selectButton );
WatsynInstrument * w = castModel<WatsynInstrument>();
m_selectedGraphGroup -> setModel( &w -> m_selectedGraph);
// A-modulation button group
pixmapButton * amod_mixButton = new pixmapButton( this, NULL );

View File

@@ -130,11 +130,10 @@ bool waveShaperEffect::processAudioBuffer( sampleFrame * _buf,
s[0] *= output;
s[1] *= output;
out_sum += _buf[f][0]*_buf[f][0] + _buf[f][1]*_buf[f][1];
// mix wet/dry signals
_buf[f][0] = d * _buf[f][0] + w * s[0];
_buf[f][1] = d * _buf[f][1] + w * s[1];
out_sum += _buf[f][0]*_buf[f][0] + _buf[f][1]*_buf[f][1];
}
checkGate( out_sum / _frames );

View File

@@ -523,7 +523,7 @@ AudioAlsa::setupWidget::setupWidget( QWidget * _parent ) :
AudioAlsa::setupWidget::~setupWidget()
{
delete m_channels->model();
}

View File

@@ -464,6 +464,7 @@ AudioJack::setupWidget::setupWidget( QWidget * _parent ) :
AudioJack::setupWidget::~setupWidget()
{
delete m_channels->model();
}

View File

@@ -356,7 +356,7 @@ AudioOss::setupWidget::setupWidget( QWidget * _parent ) :
AudioOss::setupWidget::~setupWidget()
{
delete m_channels->model();
}

View File

@@ -307,7 +307,7 @@ AudioPulseAudio::setupWidget::setupWidget( QWidget * _parent ) :
AudioPulseAudio::setupWidget::~setupWidget()
{
delete m_channels->model();
}

View File

@@ -253,10 +253,13 @@ ProjectRenderer* exportProjectDialog::prepRender()
static_cast<Mixer::qualitySettings::Interpolation>(interpolationCB->currentIndex()),
static_cast<Mixer::qualitySettings::Oversampling>(oversamplingCB->currentIndex()) );
const int samplerates[5] = { 44100, 48000, 88200, 96000, 192000 };
const int bitrates[6] = { 64, 128, 160, 192, 256, 320 };
ProjectRenderer::OutputSettings os = ProjectRenderer::OutputSettings(
samplerateCB->currentText().section(" ", 0, 0).toUInt(),
samplerates[ samplerateCB->currentIndex() ],
false,
bitrateCB->currentText().section(" ", 0, 0).toUInt(),
bitrates[ bitrateCB->currentIndex() ],
static_cast<ProjectRenderer::Depths>( depthCB->currentIndex() ) );
engine::getSong()->setExportLoop( exportLoopCB->isChecked() );