- made effect::processAudioBuffer(...) process a sampleFrame- instead of
surroundSampleFrame-array - divide out_sum by number of frames processed to have a period-size-independent value git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@876 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
58
ChangeLog
58
ChangeLog
@@ -1,3 +1,61 @@
|
||||
2008-04-03 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/ladspa_effect/ladspa_effect.cpp:
|
||||
* plugins/ladspa_effect/ladspa_effect.h:
|
||||
* plugins/bass_booster/bass_booster.cpp:
|
||||
* plugins/bass_booster/bass_booster.h:
|
||||
* plugins/stereo_enhancer/stereo_enhancer.cpp:
|
||||
* plugins/stereo_enhancer/stereo_enhancer.h:
|
||||
* include/effect.h:
|
||||
- made effect::processAudioBuffer(...) process a sampleFrame- instead of
|
||||
surroundSampleFrame-array
|
||||
- divide out_sum by number of frames processed to have a
|
||||
period-size-independent value
|
||||
|
||||
* src/core/note_play_handle.cpp:
|
||||
* include/automatable_model.h:
|
||||
renamed value( int ) to levelToValue( int ) as preparation for
|
||||
controller-framework
|
||||
|
||||
* include/mixer.h:
|
||||
* src/core/mixer.cpp:
|
||||
- made mixer::buffertToPort accept a stereoVolumeVector as audio-buffers
|
||||
have stereo-audio-buffers now
|
||||
- made peakValueLeft() and peakValueRight() take a sampleFrame-pointer
|
||||
- process in stereo internally
|
||||
|
||||
* include/instrument_track.h:
|
||||
* src/tracks/instrument_track.cpp:
|
||||
replaced surroundArea with panning-knob
|
||||
|
||||
* include/audio_port.h:
|
||||
* src/core/audio/audio_port.cpp:
|
||||
use sampleFrame-array instead of surroundSampleFrame-array for
|
||||
processing
|
||||
|
||||
* src/core/fx_mixer.cpp:
|
||||
* include/fx_mixer.h:
|
||||
made mixToChannel() take a sampleFrame-pointer
|
||||
|
||||
* include/volume.h:
|
||||
* src/core/sample_play_handle.cpp:
|
||||
* src/core/surround_area.cpp:
|
||||
added stereoVolumeVector and surroundVolumeVector-declarations
|
||||
|
||||
* include/dummy_effect.h:
|
||||
implement pure-virtual processAudioBuffer()-method
|
||||
|
||||
* include/panning.h:
|
||||
new panningToVolumeVector()-inline-method
|
||||
|
||||
* include/effect_chain.h:
|
||||
* src/core/effect_chain.cpp:
|
||||
made processAudioBuffer() take a sampleFrame-pointer
|
||||
|
||||
* include/visualization_widget.h:
|
||||
* src/gui/widgets/visualization_widget.cpp:
|
||||
use sampleFrame-array instead of surroundSampleFrame-array internally
|
||||
|
||||
2008-04-02 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* include/automatable_model.h:
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(lmms, 0.4.0-svn20080330, lmms-devel/at/lists/dot/sf/dot/net)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080330)
|
||||
AC_INIT(lmms, 0.4.0-svn20080403, lmms-devel/at/lists/dot/sf/dot/net)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.4.0-svn20080403)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
|
||||
@@ -62,8 +62,8 @@ public:
|
||||
}
|
||||
|
||||
|
||||
virtual bool processAudioBuffer(
|
||||
surroundSampleFrame * _buf, const fpp_t _frames );
|
||||
virtual bool processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames ) = 0;
|
||||
|
||||
inline ch_cnt_t getProcessorCount( void ) const
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include <QtGui/QListWidget>
|
||||
|
||||
#include "effect_chain.h"
|
||||
#include "effect.h"
|
||||
|
||||
class QScrollArea;
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
surroundAreaModel( ::model * _parent, track * _track = NULL,
|
||||
bool _default_constructed = FALSE );
|
||||
|
||||
volumeVector getVolumeVector( float _v_scale ) const;
|
||||
surroundVolumeVector getVolumeVector( float _v_scale ) const;
|
||||
|
||||
void saveSettings( QDomDocument & _doc, QDomElement & _this,
|
||||
const QString & _name = "surpos" );
|
||||
|
||||
@@ -70,7 +70,7 @@ bassBoosterEffect::~bassBoosterEffect()
|
||||
|
||||
|
||||
|
||||
bool FASTCALL bassBoosterEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
bool bassBoosterEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
if( !isEnabled() || !isRunning () )
|
||||
@@ -79,20 +79,20 @@ bool FASTCALL bassBoosterEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
}
|
||||
|
||||
double out_sum = 0.0;
|
||||
const float d = getDryLevel();
|
||||
const float w = getWetLevel();
|
||||
for( fpp_t f = 0; f < _frames; ++f )
|
||||
{
|
||||
sample_t s[2] = { _buf[f][0], _buf[f][1] };
|
||||
m_bbFX.nextSample( s[0], s[1] );
|
||||
for( ch_cnt_t ch = 0; ch < SURROUND_CHANNELS; ++ch )
|
||||
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
{
|
||||
_buf[f][ch] = getDryLevel() * _buf[f][ch] +
|
||||
getWetLevel() *
|
||||
s[ch%DEFAULT_CHANNELS];
|
||||
_buf[f][ch] = d * _buf[f][ch] + w * s[ch];
|
||||
out_sum += _buf[f][ch]*_buf[f][ch];
|
||||
}
|
||||
}
|
||||
|
||||
if( out_sum <= getGate()+0.00001f )
|
||||
if( out_sum / _frames <= getGate()+0.000001 )
|
||||
{
|
||||
incrementBufferCount();
|
||||
if( getBufferCount() > getTimeout() )
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
bassBoosterEffect( model * _parent,
|
||||
const descriptor::subPluginFeatures::key * _key );
|
||||
virtual ~bassBoosterEffect();
|
||||
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
|
||||
virtual bool processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames );
|
||||
|
||||
virtual effectControls * getControls( void )
|
||||
|
||||
@@ -328,7 +328,7 @@ ladspaEffect::~ladspaEffect()
|
||||
|
||||
|
||||
|
||||
bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
bool ladspaEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
if( !isOkay() || dontRun() || !isRunning() || !isEnabled() )
|
||||
@@ -403,6 +403,8 @@ bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
// Copy the LADSPA output buffers to the LMMS buffer.
|
||||
double out_sum = 0.0;
|
||||
channel = 0;
|
||||
const float d = getDryLevel();
|
||||
const float w = getWetLevel();
|
||||
for( ch_cnt_t proc = 0; proc < getProcessorCount(); proc++)
|
||||
{
|
||||
for( Uint16 port = 0; port < m_portCount; port++ )
|
||||
@@ -418,15 +420,15 @@ bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
frame < _frames; frame++ )
|
||||
{
|
||||
_buf[frame][channel] =
|
||||
getDryLevel() *
|
||||
d *
|
||||
_buf[frame][channel] +
|
||||
getWetLevel() *
|
||||
w *
|
||||
m_ports[proc][port]->buffer[frame];
|
||||
out_sum +=
|
||||
_buf[frame][channel] *
|
||||
_buf[frame][channel];
|
||||
}
|
||||
channel++;
|
||||
++channel;
|
||||
break;
|
||||
case AUDIO_RATE_OUTPUT:
|
||||
case CONTROL_RATE_OUTPUT:
|
||||
@@ -439,7 +441,7 @@ bool FASTCALL ladspaEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
|
||||
// Check whether we need to continue processing input. Restart the
|
||||
// counter if the threshold has been exceeded.
|
||||
if( out_sum <= getGate()+0.00001f )
|
||||
if( out_sum / _frames <= getGate()+0.000001 )
|
||||
{
|
||||
incrementBufferCount();
|
||||
if( getBufferCount() > getTimeout() )
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
const descriptor::subPluginFeatures::key * _key );
|
||||
virtual ~ladspaEffect();
|
||||
|
||||
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
|
||||
virtual bool processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames );
|
||||
|
||||
void FASTCALL setControl( Uint16 _control, LADSPA_Data _data );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* stereo_enhancer.cpp - stereo-enhancer-effect-plugin
|
||||
*
|
||||
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -79,7 +79,7 @@ stereoEnhancerEffect::~stereoEnhancerEffect()
|
||||
|
||||
|
||||
|
||||
bool FASTCALL stereoEnhancerEffect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
bool stereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
|
||||
@@ -96,6 +96,9 @@ bool FASTCALL stereoEnhancerEffect::processAudioBuffer( surroundSampleFrame * _b
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
const float d = getDryLevel();
|
||||
const float w = getWetLevel();
|
||||
|
||||
for( fpp_t f = 0; f < _frames; ++f )
|
||||
{
|
||||
|
||||
@@ -120,11 +123,9 @@ bool FASTCALL stereoEnhancerEffect::processAudioBuffer( surroundSampleFrame * _b
|
||||
|
||||
m_seFX.nextSample( s[0], s[1] );
|
||||
|
||||
for( ch_cnt_t ch = 0; ch < SURROUND_CHANNELS; ++ch )
|
||||
for( ch_cnt_t ch = 0; ch < DEFAULT_CHANNELS; ++ch )
|
||||
{
|
||||
_buf[f][ch] = getDryLevel() * _buf[f][ch] +
|
||||
getWetLevel() *
|
||||
s[ch%DEFAULT_CHANNELS];
|
||||
_buf[f][ch] = d * _buf[f][ch] + w * s[ch];
|
||||
out_sum += _buf[f][ch]*_buf[f][ch];
|
||||
}
|
||||
|
||||
@@ -133,7 +134,7 @@ bool FASTCALL stereoEnhancerEffect::processAudioBuffer( surroundSampleFrame * _b
|
||||
m_currFrame %= DEFAULT_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
if( out_sum <= getGate() )
|
||||
if( out_sum / _frames <= getGate()+0.00001 )
|
||||
{
|
||||
incrementBufferCount();
|
||||
if( getBufferCount() > getTimeout() )
|
||||
@@ -152,6 +153,8 @@ bool FASTCALL stereoEnhancerEffect::processAudioBuffer( surroundSampleFrame * _b
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void stereoEnhancerEffect::clearMyBuffer()
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* stereo_enhancer.h - stereo-enhancer-effect-plugin
|
||||
*
|
||||
* Copyright (c) 2006-2007 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -40,8 +40,8 @@ public:
|
||||
stereoEnhancerEffect( model * parent,
|
||||
const descriptor::subPluginFeatures::key * _key );
|
||||
virtual ~stereoEnhancerEffect();
|
||||
virtual bool FASTCALL processAudioBuffer( surroundSampleFrame * _buf,
|
||||
const fpp_t _frames );
|
||||
virtual bool processAudioBuffer( sampleFrame * _buf,
|
||||
const fpp_t _frames );
|
||||
|
||||
virtual effectControls * getControls( void )
|
||||
{
|
||||
|
||||
@@ -96,15 +96,6 @@ void effect::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
bool effect::processAudioBuffer( surroundSampleFrame * _buf,
|
||||
const fpp_t _frames )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
effect * effect::instantiate( const QString & _plugin_name,
|
||||
model * _parent,
|
||||
descriptor::subPluginFeatures::key * _key )
|
||||
|
||||
@@ -23,10 +23,6 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "track_container_view.h"
|
||||
#include "track_container.h"
|
||||
|
||||
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtGui/QMdiArea>
|
||||
#include <QtGui/QProgressDialog>
|
||||
@@ -34,9 +30,12 @@
|
||||
#include <QtGui/QWheelEvent>
|
||||
|
||||
|
||||
#include "track_container_view.h"
|
||||
#include "track_container.h"
|
||||
#include "bb_track.h"
|
||||
#include "config_mgr.h"
|
||||
#include "debug.h"
|
||||
#include "engine.h"
|
||||
#include "file_browser.h"
|
||||
#include "import_filter.h"
|
||||
#include "instrument.h"
|
||||
|
||||
Reference in New Issue
Block a user